port existing Android app into phoneGap eclipse

38 views
Skip to first unread message

nasim

unread,
Apr 21, 2015, 1:08:21 PM4/21/15
to phon...@googlegroups.com
Hello

I have a complex android app project (not developed by me) in eclipse with multiple packages and activities. My goal is to convert it into a phoneGap project and then build an ios app with the minimum code change.
What I've done so far is that I created a phoneGap project using CLI and add android platform and copied my project files into android platform directory and then I import that folder in eclipse , I changed the main activity to have the starting point of program an empty html file and was able to run this project on android device. But when trying to build android in CLI it does not build. 
There is also another android project created in that directory called cordovaLib. My question is how should I change these 2 projects with the least code changes ( I don't want to convert java files into html/css code) in order to be able to build android in CLI and build ios app afterward?

Thanks,

Steve Husting

unread,
Apr 21, 2015, 3:54:47 PM4/21/15
to phon...@googlegroups.com
PhoneGap only uses html, css, and JavaScript files in the www folder. It's up to you to decide how your Java files will interact with them from outside the www folder.

nasim

unread,
Apr 21, 2015, 5:24:21 PM4/21/15
to phon...@googlegroups.com
I set the start point of my android app to an empty index.html file and app is working fine when built in eclipse. Can I build it in CLI too?

Steve Sobol - Lobos Studios

unread,
Apr 21, 2015, 5:26:28 PM4/21/15
to phon...@googlegroups.com
Yes.

nasim wrote:
--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Lobos Studios - Website and Mobile App Design & Development; IT Support; Computer Maintenance
Toll Free  877.919.4WEB - Apple Valley 760.684.8859 - Los Angeles 310.945.2410 - Cleveland 216.242.4010
www.LobosStudios.com * www.facebook.com/LobosStudios * @LobosStudios

Steve Husting

unread,
Apr 22, 2015, 10:36:01 AM4/22/15
to phon...@googlegroups.com
Message has been deleted

nasim

unread,
Apr 27, 2015, 5:22:08 PM4/27/15
to phon...@googlegroups.com
Thanks, I'm now trying to write a custom cordova plugin.
In my plugin java class that extends CordovaPlugin I have to import a package like import com.example.hello.my.package;
When I try to run android I get this error:

>cordova run android 
.....
    [javac] C:\Users\nasim\Desktop\MyPhoneGapApp\platforms\android\src\c
om\example\hello\MyPlugin.java:11: error: package  com.example.hello.my does not exist
    [javac] import com.example.hello.my.package;
    [javac]                                                   ^
    [javac] 2 errors
    [javac] 3 warnings

BUILD FAILED

Any help on how can i import a package into my plugin?

Thanks,
Reply all
Reply to author
Forward
0 new messages