• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to call a Restful web services from Android using two different IDEs

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I have a Spring MVC web application and I believe that this application is a RESTful web service application I'm not very sure I think that is a RESTful web service application because it have methods like POST GET in the controllers and those controllers have the @ResponseBody tag and some of then return JSON strings.

My question is that I'm now doing an Android application in Eclipse IDE, and my Spring MVC web application is in Netbeans IDE, It is possible to call a RESTful web services from my Android app in Eclipse if this RESTful web services is in a Spring MVC Nentbeans IDE application? I don't know if my Android application that runs in a virtual device it's using in a way the localhost and if then I try to run my netbeans application it somehow create a conflict between the two IDEs.
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A web application typically serves requests from localhost - 127.0.0.1 - on some port - usually 80 or 8080.
An android application running in emulator can reach the machine's localhost through the special IP address, 10.0.2.2. Read this link to understand emulator networking.
When android app in emulator opens a connection to "http://10.0.2.2:8080/yourservice", the emulator translates that 10.0.2.2:8080 into 127.0.0.1:8080 of host machine and forwards request to your web application.
There won't be any conflict.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic