Eclipse with ADT and xmlrpc?

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Eclipse with ADT and xmlrpc?

Postby TheKog » Thu Mar 04, 2010 9:51 pm

I apologize in advance if this is too simple or stupid. I have searched the web far and wide and read every post regarding pskink's package here (thanks for the package!)

I have an existing site with published XML-RPC interfaces that work fine and dandy from a PHP client or from a simple Java app running in Eclipse Galileo with either the Redstone or Apache xml-rpc libs.

I installed the ADT plugin and have run the tutorials and am trying now to see a Hello World Android app talk to my XML-RPC API on our site - we need this so we can move ahead with our "real" application.

Now for the problems. Redstone and Apache throw a ton of errors about inner class garbage - so I found all of the refs to pskink's code and completely understand how tutorials etc but I cannot seem to get Eclipse happy with the xml-rpc project package.

Could someone please tell me how this thing is supposed to be loaded in Eclipse with ADT? I have tried "Import" to bring it into the workspace as a project and it shows numerous errors in the xml-rpc src that I am certain have to do with missing libraries or something in the build configuration. What libraries do I need around and how should they be configured? I have imported it a million ways but something here is just not setup so it can find everything it needs.

I have Galileo for Java Devs + ADT

Thanks in advance - once we see this working we can actually move forward with the Android port!
TheKog
Freshman
Freshman
 
Posts: 5
Joined: Thu Mar 04, 2010 9:16 pm

Top

Postby pskink » Thu Mar 04, 2010 10:19 pm

hmm, i don't understand your problem at all

what's the issue?
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby TheKog » Thu Mar 04, 2010 10:48 pm

Ugh I am so embarrassed - it was this http://stackoverflow.com/questions/1095 ... clipse-won

android classes were not getting setup right by Eclipse

Now I am going back and just trying to run your test program to verify everything is OK.

I have placed server.py in the public_html diectory of one of our virtual hosts, then changed the URI in the tets program to http://www.myvirtualhost.com - do I need to designate a port or anything? I wonder if my firewall might be getting in the way.

I logged in with putty and started "python server.py"

At the moment I am getting Error org.xmlpull.v1.XmlPullParsrException: expected: START_TAG
{null}methodResponse....

Not sure where my problem is but I am close...
TheKog
Freshman
Freshman
 
Posts: 5
Joined: Thu Mar 04, 2010 9:16 pm

Postby pskink » Thu Mar 04, 2010 11:00 pm

TheKog wrote:Ugh I am so embarrassed - it was this http://stackoverflow.com/questions/1095 ... clipse-won

android classes were not getting setup right by Eclipse

Now I am going back and just trying to run your test program to verify everything is OK.

I have placed server.py in the public_html diectory of one of our virtual hosts, then changed the URI in the tets program to http://www.myvirtualhost.com - do I need to designate a port or anything? I wonder if my firewall might be getting in the way.

I logged in with putty and started "python server.py"

At the moment I am getting Error org.xmlpull.v1.XmlPullParsrException: expected: START_TAG
{null}methodResponse....

Not sure where my problem is but I am close...


test program tries to connect to your development box (10.0.2.2) so just start server.py on your development machine by simply: python server.py

then try to test activity

if it works you can test with your virtual host but change 10.0.2.2 to its address

hope this helps
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby TheKog » Thu Mar 04, 2010 11:30 pm

I'm almost there. Got it running fine on localhost, but not on a real server.

If it's running at www.mysite.com at some IP address that is shared by multiple virtual hosts via apache what should I change the server.py file to have for a server address? Continue with port 8888? Or should I change to 80?

Also I guess I need the same change in the java test case?

I really appreciate you taking the time to get me right on this. Once I have the plumbing I can handle the rest. THis is just very different from how I interfaced to the server from PHP clients or other Java clients
TheKog
Freshman
Freshman
 
Posts: 5
Joined: Thu Mar 04, 2010 9:16 pm

Postby TheKog » Fri Mar 05, 2010 3:27 am

OK it's all working now, locally and on the web. Found a couple little gotchas along the way.

When running server.py I had Python 3.X which is not very happy with the syntax. Switched to 2.X and all was happy with the demo.

Then I went back to figuring out WTF was wrong with Eclipse. I took my code to interface to our server and pasted it into your Test.Java in Eclipse and everything worked! Glory Glory I was happy my code was fine the whole time but still frustrated at Eclipse for wasting much of my day.

So I went back to my HelloWorld Android app and put the EXACT code back in it and as soon as I reference a method in the xmlrpc library it crashes. I did set of the build config to reference your XMLRPC project which contained the lib and the client test code but at runtime things just would not work. If I COPIED the entire org.xmlpc.android package into my hellow world project then everything was fine.

It would seem pretty straightforward to be able to call code from another project but perhaps I was still missing something in the build process to enable this?

Anyway if a newbioe out there is trying to build his own test of your xmlrpc lib they should copy the entire lib into their project, not reference it... I've never had to fight the tools so hard in ages!
TheKog
Freshman
Freshman
 
Posts: 5
Joined: Thu Mar 04, 2010 9:16 pm

Top

Postby pskink » Fri Mar 05, 2010 7:31 am

TheKog wrote:Anyway if a newbioe out there is trying to build his own test of your xmlrpc lib they should copy the entire lib into their project, not reference it... I've never had to fight the tools so hard in ages!


i'm glad all worked fine

and i'm pretty sure its possible to reference android project (or maybe jar???) from another one (without copying sources)

i saw couple discussions about that, ask Mr Google - i think it was jar placed into lib folder or something - i'll verify this in my eclipse configuration & let you know
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby pskink » Fri Mar 05, 2010 8:01 am

ok, i got it working

solution: using e.g. eclipse make XMLRPC.jar file -> export -> jar

make sure it contains only org/xmlrpc/android/*.class files

and in your project build path go to libraries tab and "add external jar" or place XMLRPC.jar in your project lib folder and "add jar"
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby TheKog » Fri Mar 05, 2010 2:46 pm

Thank you very much Mr. Pskink! I have been an operating system developer for 30 years and it is greatly appreciated when someone like yourself not only puts such helpful modules in the public domain but is nice enough to help someone use it as well. May the Gods of Programming look upon you with favor!
TheKog
Freshman
Freshman
 
Posts: 5
Joined: Thu Mar 04, 2010 9:16 pm

Postby pskink » Fri Mar 05, 2010 3:21 pm

TheKog wrote:Thank you very much Mr. Pskink! I have been an operating system developer for 30 years and it is greatly appreciated when someone like yourself not only puts such helpful modules in the public domain but is nice enough to help someone use it as well. May the Gods of Programming look upon you with favor!


you are welcome!

hope my libs are gonna be helpful
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests