aspose file tools*
The moose likes Android and the fly likes PhoneGap/Eclipse: but none of the examples work ch.2 (ch.1 no examples) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "PhoneGap/Eclipse: but none of the examples work ch.2 (ch.1 no examples)" Watch "PhoneGap/Eclipse: but none of the examples work ch.2 (ch.1 no examples)" New topic
Author

PhoneGap/Eclipse: but none of the examples work ch.2 (ch.1 no examples)

Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
I try use the book: Beginning PhoneGap - Mobile Web Framework for JavaScript and HTML5, by Rohit Ghatol , Yogesh Patel | published 22 Feb 2012

but none of the examples work ch.2 (ch.1 no examples)...

I submit to Eclipse attachments, code here: https://bitbucket.org/rohitghatol/apress-phonegap/src/67848b004644/android/PhoneGap-DeviceInfo?at=default


[Thumbnail for apress-phonegap-book-error-in-all-exa2.jpg]

Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
I tried exa like was without modify...

see another attachment...


[Thumbnail for apress-phonegap-book-error-in-all-exa3.jpg]

Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
android 2.2 + enough old phone gap 1.1
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Leonidas Savvides wrote:android 2.2 + enough old phone gap 1.1

Is that the solution or is that just a random statement?


Steve
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
It is info about project ... you may download & try,... I have Eclipse Juno
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

So the problem persists...

I don't think I am about to set up a phonegap environment to test your problem. Here is what I can say:

1) At least on my machine, Eclipse can be a bit of a jerk and randomly decides to not build a working application. This has various and weird behaviour at runtime. Whenever something happens that makes no sense to me, the first thing I do is do Project > clean.

2) The ClassNotFoundException is pretty singular in its cause. If it persists after a clean build it means your class is not found in the classpath. Have you built your Manifest correctly?
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
added jars need to re-added after a CLEAN executed?
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Leonidas Savvides wrote:added jars need to re-added after a CLEAN executed?

Can you please get in the habit of using full sentences? Reading short blurbs like this make it hard to tell what you mean. I think you are asking if a JAR you added to the build path needs to be re-added to the build path after you do Project > clean. If that is the question: the answer is no.
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
yes this meant... about jar... were included before import...Well, seems impossible to debug... have you have time to download code and run it (org.examples.phonegap.deviceinfo)?

the matter that is very old phonegap version... well?
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
http://www.apress.com/9781430239031

download here^
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Hopefully someone else will have time to download and setup a new application environment to help you, but I can not.

I have two last suggestions for you though:
1) Make sure the JARs are selected for export in the Project > Preferences > Java Build Path > Order and Export tab

2) Perhaps someone at PhoneGap can help you out, do they have forums or a support site/email?
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
if a book refers to relatively very old version of phonegap should still function in a new IDE?
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Leonidas Savvides wrote:if a book refers to relatively very old version of phonegap should still function in a new IDE?

That depends on the changes between versions. You should:
1) Try to use up to date books when possible, because you will know the latest changes/improvements and will not be stuck using old APIs or strategies which have been replaced with newer more effiecient APIs

2) Read the documentation to see what changes have been made between versions, and check out compatibility lists

3) If all else fails, contact Phonegap to see if they can help you. Phonegap is pretty heavy and specialized, it is not something all mobile developers will use. So it is less likely that you can get good support from third party forums like this one, since there will be a small pool of people who actually use the product. You will be more likely to get answers from Phonegap themselves, or from forums dedicated to the product if they exist.
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
A.
I went to phonegap site at:
Getting Started with Android

http://docs.phonegap.com/en/2.5.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android

I followed the above
4. Setup New Project
but got
'.' is not recognized as an internal or external command,
operable program or batch file.

can you provide a sample create command? Also Ant come pre-installed when install java 6?


is the ./create command an ant command ,...? http://docs.phonegap.com/en/2.4.0/guide_getting-started_android_index. md.html#Getting%20Started%20with%20Android describes this command ....

b.
CLI used with phonegap project create, most recent version?

c.
if I install JDK 7 , to my ANDROID development PC. android tools should continue to operate???
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Leonidas Savvides wrote:but got
'.' is not recognized as an internal or external command,
operable program or batch file.

Then you either didn't install all the prerequisites, or you didn't follow their directions well enough, or their directions aren't any good.

can you provide a sample create command? Also Ant come pre-installed when install java 6?

I don't use Phonegap (as I have said) and so don't know what a valid command would look like. I don't think Ant comes with Java6, but it does come with Eclipse.


is the ./create command an ant command ,...?

No, nor is it a Windows or Linux command. My guess is that it is something from Phonegap

CLI used with phonegap project create, most recent version?

What is CLI in this context? Can you ask phonegap? They would know best.

if I install JDK 7 , to my ANDROID development PC. android tools should continue to operate???

Android SDK and Eclipse will operate. But you can't use any of the Java 7 features in code, because Android only uses Java 5 with some of Java 6. So you need to build targeting Java 6.
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
Building a phone gap with dreamweaver cs6 and jquery mobile requires jquery , jquery mobile libraries as well only PhoneGap.js for phone gap, or anything else from PhoneGap?

I build my sample under a textbook app in dw cs6 but book was for cs5.5 not cs6 , you have any idea where insert Application settings...in cs6...?

Also in Menu - PhoneGap service compile appear only insert Android sdk and web os sdk location either in my mac or windows...PCs... How appear to insert the other platforms sdk locations...?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PhoneGap/Eclipse: but none of the examples work ch.2 (ch.1 no examples)