cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect Android emulator to SAP network

0 Kudos

I want Android to connect to SAP network and call the HTTP server that i have crated on one of SAP System to interact with the Android emulator.

Accepted Solutions (0)

Answers (1)

Answers (1)

rohith_deraje
Advisor
Advisor
0 Kudos

Hi Shrinivas,

If your emulator is in the same network, you can directly call the HTTP URL from your app on simulator.

make sure you have added the below permission in the androidmanifest.xml of your app.

    <uses-permission android:name="android.permission.INTERNET"></uses-permission>

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

If you are looking for the details on connection to SAP via SUP, you can check out this doc http://scn.sap.com/docs/DOC-23532

Regards

Rohith

0 Kudos

Hi Rohith,

Thanks a lot for your reply.

My emulator is on the same network.

I gave the IP address of the SAP system where my HTTP service is present.

I am giving full path of my HTTP server.

http://IP-address:port//Full_path_to_the server

As the SAP server is have authnetication; i am using "Client Authentication" from the following path

http://hc.apache.org/httpcomponents-client-ga/examples.html for authentication client.

But i am getting HTTP 404 Error.

I dont know why i am getting these error; and where exactly i am going wrong.

Thanks and regards

Shrinivas K.

rohith_deraje
Advisor
Advisor
0 Kudos

Hi,

The error is because of HTTP authentication failure. You can try sending the authentication is headers. I could successfully call oData service from SAP NW gateway using the below.

Ex:    

  HttpGet GetRequest =  new HttpGet("HTTP URL");

   

      //GetRequest.setHeader("Authorization","Basic Base64Encoding of UserName;password");

       GetRequest.setHeader("Authorization","Basic c3VwdXNlcjM6czNwdXNlcg==");

Regards

Rohith