Refreshing BlackBerry maps


Here is an example of code that I wrote a few days back...

I used RealTimeCloclListener which is used to update the location of every minute...

public class MappingFieldSelfTrial extends UiApplication implements RealtimeClockListener{

        /**
         * Pushes the main screen onto the display stack
         */
    private double DEFAULT_LAT = 45.504512;
    private double DEFAULT_LONG = -73.557029;
    private RichMapField map = MapFactory.getInstance().generateRichMapField();
    private MapDataModel Mapdata = map.getModel();
    private MapLocation julieHome = new MapLocation( DEFAULT_LAT, DEFAULT_LONG, "Julie - Home new", "Home" );
        public MappingFieldSelfTrial() {
                pushScreen(new RichMapScreenTest(DEFAULT_LAT,DEFAULT_LONG));
                this.addRealtimeClockListener(this);
        }

        /**
         * Main Entry point for the application
         */
        public static void main(String[] args) {
                MappingFieldSelfTrial myClass = new MappingFieldSelfTrial();
                myClass.enterEventDispatcher();

        }

        public void clockUpdated() {

            DEFAULT_LAT = DEFAULT_LAT+ 1; // new location latitude
            DEFAULT_LONG = DEFAULT_LONG+1; // new location longitude
            UiApplication.getUiApplication().invokeLater(new Runnable()
            {
                public void run() {
                   Dialog.alert("Timer alert"+DEFAULT_LAT);
                }
            });
            Mapdata.removeAll();
            setLocation(DEFAULT_LAT,DEFAULT_LONG);
        }

        private void setLocation(double DEFAULT_LAT, double DEFAULT_LONG ){
            julieHome.setLat(DEFAULT_LAT);
            julieHome.setLon(DEFAULT_LONG);
            Mapdata.add((Mappable) julieHome );
            map.getMapField().update( true );
        }

private class RichMapScreenTest extends MainScreen {

    /**
     * The map field that will be displayed on the screen.
     */
    RichMapScreenTest(double DEFAULT_LAT, double DEFAULT_LONG) {

            add(map);

            Mapdata.add((Mappable) julieHome );
            map.getMapField().update( true );  // To automatically update zoom and center point
    }
}
}

Tags: BlackBerry Developers

Similar Questions

  • My BB CUrve 9320 blackBerry smartphones are not supported Blackberry Map (GPS)

    Why I can't open Map (GPS) Blackberry in my BB Curve 9320?

    kyachinumog wrote:

    Yes, I'm the India... n its Airtel India... so can I know when people India get service map BB... why the r negleted India?

    Hi kyachinumog

    No, I'm sorry but you are wrong! RIM has never neglected the India or any country in Asia, infact they do much more for us than America or Europe. Regarding the support for BlackBerry Maps questions have been raised regularly. As she opened a Forums I don't want to explain all the facts, but some of our Government policies restricting these Services in India and a few country neighbors. I hope you understand.

    Prince

    ____________________________________________________________________________

    Click 'Like' If you want to thank someone.

    If problem resolves mark message (s) as a 'Solution', so that others can use.

  • Possible to send location for BlackBerry maps using the cards: / / URI?

    I was wondering, since we can launch BlackBerry maps maps: / / is there a way that we could send a location for maps of the URL?

    As maps://Kingston-Upon-Hull

    You can use ' geo:,' uri without the ' / /'.

    For example, this url should get you close to where I live:
    Geo:46.29, - 72.66

  • Z10 blackBerry how do you remove BlackBerry Maps of the Z10

    Maps does not work so I would remove and reinstall from BlackBerry World.

    How do you remove BlackBerry Maps of the Z10?

    Try this

    http://supportforums.BlackBerry.com/T5/General-BlackBerry-10-Smartphone/how-to-reload-your-Blackberr...

  • BlackBerry Blackberry Maps Z10 does not not on Telus

    BlackBerry Maps were not loading for me since yesterday at 19:00.  I rebooted my phone, took in the SIM without success.  The map loads and get my position, but the entire map is just a blank white screen.

    A friend in one of the BBM groups in that I am is also having the same problem with a Z10 on Telus.  It is in Calgary, I'm in Toronto.  Internet and everything works.  Third-party applications that use the API of the card still work perfectly.

    I'm on Telus with an OS Z10 10.1.0.4181

    I use the Blackberry Maps 10.1.0.810 version

    There work.  had clear the history:

    1. open maps

    2. pull on the adjustment of the top menu (sliding down the top and press settings)

    3 clear history

    4. all clear

    5 cards close and restart maps

    Don't know why it would have created a problem although...

  • Display the current location on Blackberry Maps

    Hi all

    I have an application that displays a number of places on a map. I have create a situation with all the included sites document and then call blackberry maps. This all works fine, but I can't work on how to show the current location of the user and the sites that I spent in.

    Ideally, I would like to the user's location to display a small blue mark (like it on google maps) and sites to display as normal red pawns. Is this possible?

    Otherwise, I thought to put the current location in the rental document (which I did successfully for more information getRoute) but how then the user distinguished between their situation and sites? Is it possible to create custom pins?

    MapField gives you the opportunity to paint your own markers. I suggest that you look on this.

  • Z10 BlackBerry Z10 STL100-1 update blackBerry than BlackBerry Maps 10.1.0.805 install failed

    Device: BlackBerry Z10
    Model: STL100-1
    Software version: 10.1.0.273
    OS version: 10.1.0.1720
    Carrier: Beeline KZ
    Country: Kazakhstan

    1. Update for BlackBerry Maps downloaded but not installed. What can be the problem?

    2. the maps are not available for the Kazakhstan now. When do you intend to run this country's support?

    Thanks to you all. In update 10.1.0.808 has solved the problem

  • BlackBerry Maps Z10

    Cards work fine, except that the screen is empty. Occurs with Blackberry Maps and BeMaps Pro. So useless for navigation.

    Mine stays on then anyway using cards, I don't know why yours is not. This is why it is not a parameter.

  • BlackBerry Maps or Google Maps

    Hello.

    I'm integrating maps in my application. Nothing GPS using this time just a map showing a location. The location only info I have is an address string that I will be back from a web service call, in other cases, we can access the latitude and longitude, but for now I have only the address string.

    With Google Maps, I know it's too easy because I can just manipulate the URL a bit with my address string and it seems to works of 80 to 90% of the time. But I leaned in BlackBerry maps, as our BlackBerry users are probably already very familiar with BB maps, I would use if possible.

    Can I enter an address string and have BB maps to show me the location? I looked at the MapFieldDemo, the cards look rather bland and it seems I have to program the real movement of the cursor in detail. Is there a simple way to display a map?

    Should I use BB Maps or Google Maps? And anyone know any good examples?

    Thank you.

    How about using google maps api for geocoding. It converts the address in latitiude, pair of longitude. and then you can open that in blackberry maps

  • BlackBerry Maps vs Google Maps

    Hi, I'm developing an app for the Blackberry Curve 8520. The application must be able to pick up the location of the user and view the nearest locations on a map. The user can then select which store that they would like to visit and the application displays the route of their current location.

    I read a little the advantages and disadvantages for Blackberry and Google maps and not sure as for the one to use.

    Google Maps is supported on the Blackberry Curve? And if I use it in my application it requires the user to also download Google Maps before using the app? If I had to use Blackberry maps rather it will have the ability to establish a route to the destination?

    Any thoughts on this topic would be welcome.

    the google maps app is available for the device, Yes.

    but it does not offer an API. There are workaround solutions such as calling it with a document lbs, but nothing official or sufficient for more complex operations.

    BlackBerry maps can draw a route to the destination. Note that some advanced features are only available to certain OS levels upward (but unless you have a very old curve which is not a problem).

    I would say blackberry maps, the built-in API makes it much easier to use and they have come a long way since their first release.

    I use google maps personally most of the time, but not for development.

  • Reg; Invoking in blackberry maps

    Hello

    In my application I want to call cards, for that I have use mapview and everything is fine.but unfortunately I heard that blackberry maps is supported only in some countries...

    in my application, I want to show the County such as the India, Afghanistan etc... those who are not supported by blackberry maps...

    so please someone suggest me how can I get these countries also if I select it in of my very urgent application.it to me pls give answer me as soon as possible...

    I use jde 4.7 for my application...

    Here is the sample code snippet that works very well for me.

    Using this code, you can display unique location on the map.

    class GoogleSingleLocation_Scr extends MainScreen {
     public GoogleSingleLocation_Scr() {
     }
     protected void makeMenu(Menu menu, int instance) {
      super.makeMenu(menu, instance);
      menu.add(mInvokeGMaps);
     }
     MenuItem mInvokeGMaps = new MenuItem("Run GMaps", 0, 0) {
      public void run() {
       GMLocation location
        = new GMLocation(51.507778, -0.128056, "London");
       invokeGMaps(location);
      };
     };
     public void invokeGMaps(GMLocation l) {
      int mh = CodeModuleManager.getModuleHandle("GoogleMaps");
      if (mh == 0) {
       try {
        throw new ApplicationManagerException(
          "GoogleMaps isn't installed");
       } catch (ApplicationManagerException e) {
        System.out.println(e.getMessage());
       }
      }
      URLEncodedPostData uepd = new URLEncodedPostData(null, false);
      uepd.append("action", "LOCN");
      uepd.append("a", "@latlon:" + l.getLatitude()
       + "," + l.getLongitude());
      uepd.append("title", l.getName());
      uepd.append("description", l.getDescription());
      String[] args = { "http://gmm/x?" + uepd.toString() };
      ApplicationDescriptor ad = CodeModuleManager
        .getApplicationDescriptors(mh)[0];
      ApplicationDescriptor ad2 = new ApplicationDescriptor(ad, args);
      try {
       ApplicationManager.getApplicationManager()
         .runApplication(ad2, true);
      } catch (ApplicationManagerException e) {
       System.out.println(e.getMessage());
      }
     }
    }
    

    Suppose if you display several location on google maps, you need to prepare a KML file and make it available on the public server what google map can be accessed

    Some links to URLS that might be useful for you.

    http://code.Google.com/intl/en/APIs/maps/documentation/mapsdata/developers_guide_java.html#audience

    http://StackOverflow.com/questions/3301378/Google-maps-apidynamic-plot-multiple-locations-via-URL-sh...

  • Clickable PINS in BlackBerry map / Google Map in BlackBerry

    Dear all,

    Can I make clickable PINS on the map of the BlackBerry / Google Map in BlackBerry to call specific screen or call dialogue

    the 5.0 OS and more.

    Thank you.

    In OS 6.0, you have the optin to using a RuchMapField.

    Before that, there are possibilities, ranging from what you will find in the following links, but I suspect it's a lot of work.

    http://supportforums.BlackBerry.com/T5/Java-development/clickable-pin-points-on-a-map/m-p/452540#M89...

    http://StackOverflow.com/questions/10930115/how-to-draw-clickable-pin-point-on-BlackBerry-map

    http://StackOverflow.com/questions/10636855/BlackBerry-map-with-user-defined-images-as-pin-and-click...

  • Services Z10 Blackberry Maps blackBerry in Beijing

    I have Blackberry bought z10 of Pakistan. Now I'm in Beijing, China. Whenver I try to use the card application, it opens and after a treatment, the message "the map data are currently unavailable for this country." How to activate map for China in Z10 services?

    Hi @mkaleemkhan

    BlackBerry Maps does not support China. For a checklist of the availability of the cards on this link. Thank you!

  • Invoke Blackberry Maps using the location document

    Greeting, developers...
    I use call blackberry maps in my application using document location...
    I put 3 rental, my location, Room A and room B
    example:





    but my problem is
    1. how the development of the cards to my location (the first location)
    2. how to make the maps zoom? I use lbs document as above, but there is no zoom at all in blackberry maps...

    Any solution?
    Thanx

    Visit this link for more details on the books and the location tags.

    http://docs.BlackBerry.com/en/developers/deliverables/17954/Invoking_BB_Maps_using_a_location_docume...

    But to my knowledge, I Don t think centeralized zoom is not possible in this method of calling cards.

    There are many ways by which you can invoke the card / use mapField in your application. You must choose the right pair that meets your needs.

  • DETECT if BlackBerry Maps is installed

    Hello world:

    I extend the MapField class in my application and I need to detect if BlackBerry Maps is installed on the device. I was under the impression that it was distributed with OS4.5 or newer. However, it seems that some network providers that withdrawing from the device. Accordingly, I have users to get a "Eception exception: LBS map API is not installed ' when installing the OTA.

    Any help would be greatly appreciated.

    Try this:

    CodeModuleManager.getModuleHandle ("net_rim_bb_lbs")

    If the return is< 1,="" then="" it="" is="" not="">

Maybe you are looking for

  • Tecra A11 - USB is not loan Express Port Replicator II

    Hey people, I'm absolutely fed up with this, so I hope you can help me with this: Iam using a Tecra A11 with Express Port Replicator II. There are three problems: 1 USB mouse and USB keyboard are not ready to use so that until that Windows7 is fully

  • 18-5202 po: could not get the impressions

    The printer I use is: HP Deskjet Ink Advantage all-in - One Printer - K209a. He stopped taking the print documents I get print outs when I want to get photocopies or when I give print release of the desktop computer.

  • quotazione 4 disc request

    Salve, few need di una offer by 4 hard drive E' has he support my having it keep your drive hard e quindi non restituirvi can I have brain. CI servirebbe quindi una quotazione per ricevere 4 disc (senza restituzione dei vecchi) I have the service TAG

  • Level only 10 levels of brightness, cannot change the level of brightness at 5,15,25,35,45,55,65,75,85,95

    Hi, Im kenny, I have Windows 7 Enterprise 64-bit and my laptop is HP g4-1311AU pavvilionmy system is as followsSo, I have problem with my windows 7 not in windows 8. My brightness on WINDOWS 8, can change to 0,5,10,15,20,25,30,35,40,45,50,55,60,65,75

  • When I click on "my network icon" nothing happens...

    Original title: Network icon Hi, my network icon does not work... which means that when I click on it nothing happens... and my control panel freezes... is it possible to fix this? IM using windows 8. Thank you.