Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic