cancel
Showing results for 
Search instead for 
Did you mean: 

Connection Error with Android Starter Application consuming OData Service from Gateway

BernardF
Explorer
0 Kudos

Hello,

I’m trying to run the sample flight application. The Problem I get always a connection error.

My System:

Windows 7 64bit, Eclipse Juno,  (tried with Android SDK API 17 , API 13 )

SAP NetWeaver Application Server ABAP 7.02 SP011 with Gateway SP04 Trial is running in a virtualbox with win2008 on my Windows 7 host.

REST Client on the host:

Works fine!

Now i create a Starter Application Project in Eclipse (Host) …

until then everything works well 🙂


Running Android Application …


     And now i get always this Error  !!!!

LogCat:

Error: unable to resolve host "sapnwgw.de": No address associated with hostname !!

Comment: for the test the Windows Firewall (HOST) is deactivated!

I really hope that someone can help me.

thanks a lot

Bernard

Accepted Solutions (0)

Answers (2)

Answers (2)

BernardF
Explorer
0 Kudos

Hi All,

i uninstalled the toolkit for Android ... and istalled the SAPNetWeaverGatewayPluginForEclipse_2.6.400 and now everything works.



Best regards

Bernard

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

good to hear Bernard Fricaud

If you have find your solution, please close this thread.

Rgrds,

Jitendra

michal_keidar
Active Contributor
0 Kudos

Hi Bernard,

Usually when getting this error of "unable to resolve host..." it means that you need to configure a proxy.

Do you have a proxy in your environment? if so, try to configure it in the Android emulator.

Regards,

Michal.

BernardF
Explorer
0 Kudos

Hi Michal,

it is the same machine. I have no proxy.

if i test with the rest client ...

all works fine.

in the windows host file i mapped the virtual box ip to the hostname.

192.168.1.104 sapnwgw.de

and therefore i can use in the browser the name to test the odata service and also to call the catalog service from gateway to create the starter application.

regards

bernard

michal_keidar
Active Contributor
0 Kudos

Hi Bernard,

If the gateway is located on your local host then how do you reach the service in the emulator?

If you're using localhost then Android emulator has a problem that it refers "localhost" as itself, and then you need to reach it through this ip 10.0.2.2. See here for example:

Accessing localhost:port from Android emulator - Stack Overflow

Hope this helps,

Michal.

BernardF
Explorer
0 Kudos

Hi Michal,

the gateway is running i a virtualbox (GUEST) on the same pc and the ip is 192.168.101.60. Eclipse is running on HOST with ip 192.168.101.95 on the same pc. There is no proxy.

hosts file on the host PC :

192.168.101.60 sapnwgw.de.

I have read your link, but i think i have an another enviroment.

regards

Bernard

boris_tsirulnik
Participant
0 Kudos

Hi,

It looks like the problem is not related to GWPA.

This is an issue with Android emulator and it's connectivity to the virtualbox machine.

Please try to use IP instead of the host name. Android emulator probably can't see the hosts file mapping.

To test if your configuration is correct and the Gateway OData service is accessible from the app, you need to test it from the Android emulator using Android browser and not the REST client from the windows machine.

Best Regards,

Boris

BernardF
Explorer
0 Kudos

Hi Boris,

now i change to IP. The Test in the Browser Android emulator is successful.


But if i run the application

i get a error ...

User and Password is checked and ok !!

I attached he hole LogCat ...

Regards

Bernard