How to get Current Location in a Android Emulator using Flex

Hi
In the following code I am able to plot the Location using Latitude and Longitude but the requirement is
in an Android Emulator on launch of the application I need google map to display the users current location,
How can this be achieved ??? I tried to get the Latitude and Longitude of the current position using
geoLocation class by I am not able to get that working,
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark" title="Home">
    <s:layout>
        <s:VerticalLayout />
    </s:layout>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            import com.google.maps.LatLng;
            import com.google.maps.MapEvent;
            import com.google.maps.MapType;
            import com.google.maps.controls.PositionControl;
            import com.google.maps.controls.ZoomControl;
            import flash.sensors.Geolocation;
            private var myGeo:Geolocation;
            protected function showBtn_clickHandler(event:MouseEvent):void
                if(Geolocation.isSupported == 'true')
                    myGeo = new Geolocation();
                    myGeo.setRequestedUpdateInterval(100);
                    myGeo.addEventListener(GeolocationEvent.UPDATE, onUpdate);
                else
                    myTextArea.text = "Device Not Supported";
            private function onUpdate(event:GeolocationEvent):void
                myTextArea.text += "Hi"+ "/n"+ event.latitude.toString() + "/n" +
                    event.longitude.toString();
            protected function myMap_mapevent_mapreadyHandler(event:MapEvent):void
                myMap.setCenter(new LatLng(24,58),9,MapType.NORMAL_MAP_TYPE);
                myMap.addControl(new ZoomControl);
                myMap.addControl(new PositionControl);
        ]]>
    </fx:Script>
    <s:Button id="showBtn" label="Show" click="showBtn_clickHandler(event)"/>
    <s:TextArea id="myTextArea" width="100%" height="50%" />
    <maps:Map id="myMap" width="100%" height="50%"
              xmlns:maps="com.google.maps.*"
              sensor="true"
              key="ABQIAAAA2Fwy6HLBheYSAWRBEZKwEhRLum8XdHegG17d4EymNgK0o7h2qRRWVBVQywiGHEiGtKahjfGW8xxc RA"
              mapevent_mapready="myMap_mapevent_mapreadyHandler(event)"
              url="http://www.xyz.com"/>
</s:View>

Geolocation isn't supported in the Emulator. You'll have to set up a test case that gives the geolocation without relying on the Emulator.

Similar Messages

  • Get current LOCATION in ProcessFlow (PF) or Mapping

    How can I get current LOCATION from running PF or Mapping?
    I need to run PF.
    Name of PF passing via parameter of PF.
    I know about wb_rt_api_exec.run_task, but first parameter is LOCATION.

    It is possible to get location from ALL_RT_AUDIT_EXECUTIONS OWB public view (column OBJECT_LOCATION_NAME),
    if I understand your requirements properly.
    Filter rows from ALL_RT_AUDIT_EXECUTIONS via execution_audit_id, in processflow you can use predefined variable AUDIT_ID for currently running processflow audit id
    Regards,
    Oleg

  • How to get current view name on clicking device back button?

    Hi,
    iam wriing a function for handling device back button(in android) press in my app.controller.js .How to get current viewname when clicking device back button.
    code samples will be helpful.
    my app.controller.js looks like below
    sap.ui.controller("com.opensap.App", {
      onInit : function() {
      document.addEventListener("deviceready", onDeviceReady, false);
      onBeforeShow : function(evt) {
      navButtonTap : function(evt) { 
    function onBackKeyDown(){
      //alert("hai");
      //sap.ui.getCore().byId("SalesDetail").app.backToPage("ProductList");
      //sap.ui.getCore().byId("ProductList").app.backToPage("Dashboard");
      //sap.ui.getCore().byId("SupplierDetail").app.backToPage("Dashboard");
    function onDeviceReady(){
       document.addEventListener("backbutton", onBackKeyDown, false);

    I somehow managed to find the solution
    function onBackKeyDown(){
      var app = sap.ui.getCore().byId("LoginDetail").app;
      app.back();

  • How to get current time in TimesTen

    I need to get the current timestamp of TimesTen DB located node, how can get it?
    In PSQL, I can use built-in function now(), In Oracle, I can use LOCALTIMESTAMP, thanks. a lot.

    Hi Vikas,
    Firstly, the syntax you give
    select to_char(sysdate,'dd-mm-yyyy hh24:mi:ss.FF') as ts from dual;
    does not work in Oracle DB - it gives an eror due to the '.FF' in the format string.
    This syntax does work just fine in TimesTen (which is a little more tolerant).
    However, this is not a very useful thing since the resolution of SYSDATE is 1 second and to accurately measure data fetch times you need accurate microsecond resolution. Also, you would need to take an average over many millions of measurements to get any degree of accuracy.
    Realistically, this will be a very difficult thing to measure with any accuracy. Might I understand what you are exactly looking to achieve here? For the same amount of data, separateing 'fetch' from SQL execution, TimesTen in direct mode will return data much, much faster than an Oracle client/server connection wven when the client is on the same machine as oracle. For Tt client/server mode the data transfer performance will be very similar to that for Oracle.
    Chris

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • How to get the location of the browser?(pt_BR, en_US, es_ES...)

    How to get the location of the browser?
    example: pt_BR, en_US, es_ES...

    Hi Eduardo Cordeiro,
    Sorry in reaching you late...I was out on a trip...
    You need to put the javascript in your Flex application html wrapper file ...in which your  Flex application SWF is embedded.
    Write the Javascript function in your html file as below :
    function getBrowserLanguage()
      var browserLanguage = navigator.browserLanguage;
      return browserLanguage;
    //In your mxml File you can access the JavaScript function in your MXML as below:
    var browserLang:String  = ExternalInterface.call('getBrowserType');
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

  • How to get current version of safari. without having safari browser?

    how to get current version of safari. without having safari browser?

    I don't understand the question. Safari is a browser.
    Can you elaborate on what your are trying to do that initiated the question? People may be able to come up with some other option that gets you working the away you want.
    When you respond, please post the version of the Mac OS and the version of Safari you currently have. Otherwise, people are guessing and the quailty of help you get plummets.

  • How to get current rowindex of clicked object in cr2008 preview control

    hi
    i want to get selected raw data when user click on crystal report 2008 preview control.
    i can achieve using following code for particular row no.
    Dim repReport as new ReportDocument
    repReport.Rows(RowIndex).Item(ColumnIndex)
    how to get current rowindex ? 
    Thanks
    Sanjiv Sharma

    Only way I can think of is to use the rowset controller from the InProc RAS SDK. Here is a snippet of a sample code on how to:
    //Load the report
    if (clientDoc != null) {
    //create metadata structure
    RowsetMetaData rowSetMetaData = new RowsetMetaData();  rowSetMetaData.setDataFields
    (clientDoc.getDataDefinition().getResultFields());
           Fields fields = rowSetMetaData.getDataFields();
           String colName,colTypeName;
           int colType, len;
           Field field;
           HashMap colNames = new HashMap();
           HashMap colTypes = new HashMap();
           for (int i = 0; i < fields.size(); i++) {
                   field = (Field) fields.get(i);
                   colName =field.getDisplayName(FieldDisplayNameType.description, Locale
    .ENGLISH);
                   colNames.put("COL"+i,colName);
           colType = getColTypeFromVariant(field.getType().toVariantTypeString());
           len=field.getLength();
                  //Placeholder
            //add column metadata to data structure or XML
            Object colValue;
            int rowCount=0;
            if (getMaxRows() != 0) {
                   RowsetCursor rowsetCursor = clientDoc.getRowsetController(). createCursor
    (null, rowSetMetaData);
                  //Setting the batch size to make sure that you get back all the
                  //rows by setting the batch size.
                        clientDoc.getRowsetController().setRowsetBatchSize (rowsetCursor
    .getRowset().getTotalRecordCount());
               //Getting the Results back starting from the first row
               RowsetCursor resultCursor = clientDoc.getRowsetController(). createCursor(null,
    rowSetMetaData);
               resultCursor.moveTo(0);
                  while (!resultCursor.isEOF()) {
                      for (int i = 0; i < fields.size(); i++) {
                               colName=(String)colNames.get("COL"+i);
                               colTypeName=(String)colTypes.get("COL"+i);
    colValue=record.getValue(i);
                                //Placeholder
    //add row data to data structure or XML
    resultCursor.moveNext();
    For more details, consult the Report Application Server .NET SDK Developer Guide
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • How to get Current row of ViewObject in the DoDML methode

    Hi all
    I have two ViewObject EmplyesView and DeptView
    How to get Current row of ViewObject DeptView in the DoDML methode of EmplyesView

    OK, we can play this game on and on...
    I'll ask for a use case (http://en.wikipedia.org/wiki/Use_case) and you don't give any info we don't already know. After an other 10 posts we probably know what you real problem is and can give you the advice which you could have gotten in the fist place.
    So please take some time and describe the problem as if you would ask your mother for help. Tell us how the data model is build and how the VO are related. Is there any input from an user involved? Which information from the other view do you need? How do you get to the doDML method? Is there a button in the ui involved?
    Timo

  • How to get current month and last month dynamically??

    how to get current month and last month dynamically
    like
    month = getCurrentMonth();
    lastmonth = getcurrentMonth() -1;
    please help
    thanks

    hi :-)
    /* depracated but can be still useful */
    java.util.Date dtCurrent = new java.util.Date();
    int month = dtCurrent.getMonth();
    int lastmonth = dtCurrent.getMonth() - 1;
    System.out.println("* " + month);
    System.out.println("* " + lastmonth);
    /* better to use this one */
    Calendar cal = new GregorianCalendar();     
    int imonth = cal.get(Calendar.MONTH);
    int ilastmonth = cal.get(Calendar.MONTH) - 1;
    System.out.println("*** " + imonth);
    System.out.println("*** " + ilastmonth);
    regards,

  • How to get current IUser (com.sapportals.portal.security.usermanagement)

    Hi,
    does anybody know how to get IUser for the current user?
    I know how to get current IUser from com.sap.security.api package:
    IWDClientUser wdcu = WDClientUser.getCurrentUser();
    IUser sapUser = wdcu.getSAPUser();
    but I need to have IUser from com.sapportals.portal.security.usermanagement package.
    Regards,
    Ladislav

    Ladislav,
    Try this:
    Get the IUser uisng the API com.sap.security.api.IUser and store it in a variable, say <i>sapUser</i>.
    Then,
    // Convert the logged in user to old EP5 usermanagement API
    com.sapportals.portal.security.usermanagement.IUser user = null;
    try
         com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getEP5User(sapUser);
    catch (UserManagementException e)
         e.printStackTrace();
    Bala

  • How to get current assigned participant id?

    Hi mates,
    This might be a basic questions, but useful for me :)
    How to get current assigned participant id from screenflow? Or How to pass it as an argument from interactive activity?
    Below is what I tried.
    Participant.id or Instance.participant.id - returns login user id
    Thanks

    Hi,
    Please correct me if I understood wrong.
    You want to know whether an instance is assigned or not and if assigned then you want to fetch the assigned participant id.
    If this is your requirement then please find the code below and make the necessary changes into it.
    Write the following code in screen flow automatic activity but before that you need to pass the instanceid as argument to the screen flow.
    In the process as well as screen flow layer make an instance variable instanceid as Int.
    Then make an argument variable instanceidArg as Int in both the screenflow and process layer and map accordingly so that it will take the instanceid from process layer to the screen flow layer.
    Assign instanceid = id.number; in process layer automatic activity but before the global interactive activity where you have maped the screen flow.
    Write the following code in screen flow automatic activity.
    logMessage("============= instanceid ==============" + instanceid); //instanceid is the id of the instance that you have passed from process layer.
    ProcessService ps;
    InstanceFilter instF = InstanceFilter();
    ps.connectTo(url : Fuego.Server.directoryURL, user : "<userid>", password : "<password>"); //In studio the userid and password will be same
    logMessage("Connected");
    instF.create(processService : ps);
    instF.searchScope = SearchScope(participantScope : ParticipantScope.ALL, statusScope : StatusScope.ONLY_INPROCESS);
    //<ProessId Name> is the id of the process where you want to know the assighed participant id
    instF.addAttributeTo(variable : VarDefinition.processid, comparator : Comparison.CONTAINS, value : "/" + "<ProessId>");
    instF.addAttributeTo(variable : VarDefinition.INSTANCE_NUMBER, comparator : Comparison.IS, value : Int(instanceid));
    Fuego.Papi.Instance[] instances = getInstancesByFilter(ps, filter : instF);
    foreach (instance in instances) {
    logMessage("Assigned ?: " + instance.participantId.empty);
    logMessage("instance.participantId: " + instance.participantId);
    ps.disconnectFrom();
    Bibhu

  • How to get current date for posting date

    hi,
    how to get current date for posting date ? any sample code ?
    Thanks

    Hi......
    Use
    Select getdate()
    for current date.......
    Regards,
    Rahul

  • Urgent : How to get current user id

    Hello,
    fnd_global.user_id returns -1
    fnd_profile.get('user_id',x_user_id) return null
    can anyone help how to get current logged in user to apps.
    Regards,
    Dinesh.

    Hi Dinesh,
    You must also make sure you have initialised the app.
    If you run this from sqlplus then it will return -1.
    If however you run this from within a concurrent program then the user id will be returned.
    Try using this from sqlplus fnd_global.apps_initialize
    Eg.
    begin
    dbms_output.put_line(fnd_global.user_id);
    fnd_global.apps_initialize(user_id => 3551,
    resp_id => 1,
    resp_appl_id => 1);
    dbms_output.put_line(fnd_global.user_id);
    end;
    /

  • How to get current time and date??

    How to get current time and date from my PC time and date to the java application??
    i use java.util.* package but got error, that is:
    - java.util.* and java.sql.* class are match
    - abstract class cannot be instantiated
    so what can i do, pls guide...thanks...

    There is a method in the System class that will return the current system time. You could also instantiate a Date, Time, Timestamp, or Calendar object, all of which get created with the system time by default.
    Don't import *. Import the specific classes you need.
    Next time, post the actual text of the exceptions/compile errors. If you make people guess, most just won't bother.

Maybe you are looking for

  • Does my motherboar​d support wol

    I am having an hp pavillion dv6580en notebook. As a part of my project i gotto implement Wake-on-lan function . i found that my ethernet card supports this feature and is enabled. But my bios doesnt seem to have this option . Therefore the power to m

  • Viewing in landscape mode

    I am running FaceTime on a MacPro. Viewing seems to be locked in portrait mode. When I go to Video/Use Landscape (Command+R), it is grayed out. Do I have to be connected to someone for this to be active? I notice the Enter Full Screen option is graye

  • The order of elements in an array.

    Hi I have an array whose array.length is 3. I need to add a new element at the the first position in the array. For example the existing values in the array are 1,2,3. Now I need to add 10 in the first position so that the array looks like : 10,1,2,3

  • Sharepoint 2010 package problem

    I have a Sharepoint 2010 projet, when I click right the solution and select "Package All Sharepoint Projects (CKSDev)" it gives me the output message: ------ Build started: Project: ABCDE.Intranet, Configuration: Debug Any CPU ------   ABCDE.Intranet

  • IDM & GRC (including Firefighter ) role in SAP Security

    Please provide me information reg IDM,GRC & FIREFIGHTER in SAP