You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by PKumar <pr...@gmail.com> on 2016/06/20 10:12:41 UTC

FlexJS: Getting geolocation using Cordova

Hi,

I want to get the geoLocation using FlexJS & Cordova. Please suggest the
steps this.



-----
Regards,
Prashant
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation-using-Cordova-tp12878.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

AW: AW: FlexJS: Getting geolocation using Cordova

Posted by Christofer Dutz <ch...@c-ware.de>.
Hi Prashant,


You should have Maven 3.3.1 or greater for the mavenizer to work.

You should have a max of Java 1.7.x because in case of Java 1.8 libs would be produced that are incompatible with previous Java versions, therefore I have restricted the build to a max of 1.7 for now.


You require the Flash Debug player to be located on your drive somewhere and require to have the FLASHPLAYER_DEBUGGER variable to point to this. If you have already built with Ant, this should already have happened. I hope I will be able to get rid of this requirement soon. You could also provide the "-DskipTest" option to the second build step. Then the build should work fine without the debug flashplayer.


The following sequence should build FlexJS and ASJS with maven:


In the falcon root directory:
mvn -s settings-template.xml -P utils clean install
mvn -s settings-template.xml -P compiler clean install
(Add "-DskipTests" to skip tests)
mvn -s settings-template.xml -P externs clean install

In the ASJS root directory:
mvn -s settings-template.xml clean install

Please report back any problems you are having (if you are)


Chris

________________________________
Von: PKumar <pr...@gmail.com>
Gesendet: Dienstag, 28. Juni 2016 11:58:59
An: users@flex.apache.org
Betreff: Re: AW: FlexJS: Getting geolocation using Cordova

I have downloaded the source code and also setup Maven . could you please
share the steps for Maven build?



-----
Regards,
Prashant
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation-using-Cordova-tp12878p12937.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: AW: FlexJS: Getting geolocation using Cordova

Posted by PKumar <pr...@gmail.com>.
I have downloaded the source code and also setup Maven . could you please
share the steps for Maven build?



-----
Regards,
Prashant
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation-using-Cordova-tp12878p12937.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

AW: FlexJS: Getting geolocation using Cordova

Posted by Christofer Dutz <ch...@c-ware.de>.
Or you could give the Maven build a try ... that should be easier to setup [?]


Chris

________________________________
Von: PKumar <pr...@gmail.com>
Gesendet: Mittwoch, 22. Juni 2016 10:07:35
An: users@flex.apache.org
Betreff: Re: FlexJS: Getting geolocation using Cordova

Thanks Peter,

I will wait for next nightly build and trying to understand the  FlexJS
development setup, so that i can add more methods to the class  and also
contribute my code to Apache. I am referring below mentioned URL for setup.

https://cwiki.apache.org/confluence/display/FLEX/FlexJS+Developer+Setup



-----
Regards,
Prashant
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation-using-Cordova-tp12878p12913.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: FlexJS: Getting geolocation using Cordova

Posted by Alex Harui <ah...@adobe.com>.

On 6/22/16, 10:17 PM, "PKumar" <pr...@gmail.com> wrote:

>Thanks for update Peter,
>
>can i use FlexSDK installer to generate the FlexJS Nightly build?
>

Yes.  For information about accessing nightly builds, please ask on the
dev@flex.apache.org mailing list (or search the archives).

Thanks,
-Alex


Re: FlexJS: Getting geolocation using Cordova

Posted by PKumar <pr...@gmail.com>.
Thanks for update Peter,

can i use FlexSDK installer to generate the FlexJS Nightly build?



-----
Regards,
Prashant
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation-using-Cordova-tp12878p12923.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: FlexJS: Getting geolocation using Cordova

Posted by Peter Ent <pe...@adobe.com>.
To night's build (or you can grab build #1175 now) will have the addition
of the Geolocation stuff and it will have a new example: MobileMap. This
example shows how to combine Google Maps and Cordova Geolocation plugin.

—peter

On 6/22/16, 9:10 AM, "Peter Ent" <pe...@adobe.com> wrote:

>Hi,
>
>If you do plan on contributing, you will need to use git and work from the
>repository. That will also save you from having to wait for the nightly
>build.
>
>‹peter
>
>On 6/22/16, 4:07 AM, "PKumar" <pr...@gmail.com> wrote:
>
>>Thanks Peter,
>>
>>I will wait for next nightly build and trying to understand the  FlexJS
>>development setup, so that i can add more methods to the class  and also
>>contribute my code to Apache. I am referring below mentioned URL for
>>setup.
>>
>>https://cwiki.apache.org/confluence/display/FLEX/FlexJS+Developer+Setup
>>
>>
>>
>>-----
>>Regards,
>>Prashant
>>--
>>View this message in context:
>>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation
>>-
>>using-Cordova-tp12878p12913.html
>>Sent from the Apache Flex Users mailing list archive at Nabble.com.
>


Re: FlexJS: Getting geolocation using Cordova

Posted by Peter Ent <pe...@adobe.com>.
Hi,

If you do plan on contributing, you will need to use git and work from the
repository. That will also save you from having to wait for the nightly
build.

‹peter

On 6/22/16, 4:07 AM, "PKumar" <pr...@gmail.com> wrote:

>Thanks Peter,
>
>I will wait for next nightly build and trying to understand the  FlexJS
>development setup, so that i can add more methods to the class  and also
>contribute my code to Apache. I am referring below mentioned URL for
>setup.
>
>https://cwiki.apache.org/confluence/display/FLEX/FlexJS+Developer+Setup
>
>
>
>-----
>Regards,
>Prashant
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation-
>using-Cordova-tp12878p12913.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: FlexJS: Getting geolocation using Cordova

Posted by PKumar <pr...@gmail.com>.
Thanks Peter,

I will wait for next nightly build and trying to understand the  FlexJS
development setup, so that i can add more methods to the class  and also
contribute my code to Apache. I am referring below mentioned URL for setup.

https://cwiki.apache.org/confluence/display/FLEX/FlexJS+Developer+Setup



-----
Regards,
Prashant
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation-using-Cordova-tp12878p12913.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: FlexJS: Getting geolocation using Cordova

Posted by Peter Ent <pe...@adobe.com>.
Hi,

In order to use an expression like:

navigator.geolocation.getCurrentPosition(onSuccess, onError);

from an ActionScript file there has to be a definition of the components
somewhere for the FlexJS compiler to use. My apologies for
misunderstanding what you were trying to do. I thought you were trying to
get locations through Google Maps and we have defined that API for
ActionScript.

If you were to look at the org.apache.cordova.camera package (found in
flex-asjs/frameworks/projects/Mobile project), you'll see "navigator"
being used within a COMPILE::JS block. This class is not available at the
application level. Basically, a package like
org.apache.cordova.geolocation needs to be added so that a wrapper class
can be made to expose the plugin to applications.

I have added this package (org.apache.cordova.geolocation) and class
(Geolocation) to the Mobile framework project. You can either wait for the
next successful nightly build or pull it down from the Apache FlexJS
(flex-asjs) git repository.

Note that I only added a single function:

public function getCurrentPosition(onSuccess:Function,
onError:Function):void

to the Geolocation class. I can add more functions from the plugin right
now if you need them. If you plan on using a lot of Cordova and would like
to contribute to the Apache FlexJS project, you can submit updates via
Apache JIRA to the framework yourself and someone on the Apache Flex
project (eg, me) can incorporate them. Do this enough and you can become a
member of the Apache Flex team!

Regards,
Peter

On 6/21/16, 9:16 AM, "Peter Ent" <pe...@adobe.com> wrote:

>I am looking into it.
>‹peter
>
>On 6/21/16, 6:30 AM, "PKumar" <pr...@gmail.com> wrote:
>
>>Thanks Peter,
>>
>>I have successfully added MAP but i need to get the device current
>>location
>>also. I checked the cordova geolocation plugin but i do not know, how to
>>use
>>it. check the mentioned plugin URL.
>>
>>https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-geoloc
>>a
>>tion/
>>
>>
>>
>>-----
>>Regards,
>>Prashant
>>--
>>View this message in context:
>>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation
>>-
>>using-Cordova-tp12878p12908.html
>>Sent from the Apache Flex Users mailing list archive at Nabble.com.
>


Re: FlexJS: Getting geolocation using Cordova

Posted by Peter Ent <pe...@adobe.com>.
I am looking into it.
‹peter

On 6/21/16, 6:30 AM, "PKumar" <pr...@gmail.com> wrote:

>Thanks Peter,
>
>I have successfully added MAP but i need to get the device current
>location
>also. I checked the cordova geolocation plugin but i do not know, how to
>use
>it. check the mentioned plugin URL.
>
>https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-geoloca
>tion/
>
>
>
>-----
>Regards,
>Prashant
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation-
>using-Cordova-tp12878p12908.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: FlexJS: Getting geolocation using Cordova

Posted by PKumar <pr...@gmail.com>.
Thanks Peter,

I have successfully added MAP but i need to get the device current location
also. I checked the cordova geolocation plugin but i do not know, how to use
it. check the mentioned plugin URL.

https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-geolocation/



-----
Regards,
Prashant
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation-using-Cordova-tp12878p12908.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: FlexJS: Getting geolocation using Cordova

Posted by Peter Ent <pe...@adobe.com>.
Hi,

The first thing you need to do is add the cordoba-plugins-googlemaps to
your Cordova app package. If you've used the file structure suggested on
the wiki, then this will be in the app sub-directory.

Once you have it there, you just use the Google Maps API. The
examples/DesktopMap project can get you started. Look at the
frameworks/projects (specifically in the main/flex/google directory tree)
for more APIs.

Please keep us informed of your progress and we're looking forward to
seeing what you have come up with.

Regards,
Peter Ent
Apache Flex Project

On 6/20/16, 6:12 AM, "PKumar" <pr...@gmail.com> wrote:

>Hi,
>
>I want to get the geoLocation using FlexJS & Cordova. Please suggest the
>steps this.
>
>
>
>-----
>Regards,
>Prashant
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Getting-geolocation-
>using-Cordova-tp12878.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.