Skip to Content
Update

[9/29/2014] – Please note that GWPA (available with Eclipse Juno) is superseded by SAP Mobile Platform Tools (Eclipse Kepler). SAP has officially ended the support of Eclipse Juno and hence you need to now use Eclipse Kepler and work with SAP Mobile Platform Tools.


You can refer SAP Development Tools for Eclipse and also this blog How to install SAP Mobile Platform Tools for Integration Gateway in Eclipse Kepler for more details.


Refer End of support for Eclipse Juno in SAP HANA Cloud Platform Tools planned for end of June 2014 for more details on Eclipse Support



It was my dream to build at least one android application which will display SAP data on mobile/tablet devices. As I am not very much skilled in developing android application, I was struggling on how to start with this. And then I came across GWPA and started exploring it. I explored it; I liked it and now I’m loving it!

It is very simple to create android application consuming OData with the help of Gateway Productivity Accelerator (GWPA) plug in installed on Eclipse IDE.

Let’s get into the details,


Introduction –


In this technical blog, I will focus on how we can build simple Android application consuming OData service with the help of SAP NetWeaver Gateway Productivity Accelerator (GWPA).


To know more about GWPA, please refer http://scn.sap.com/community/netweaver-gateway/blog/2013/06/03/gateway-productivity-accelerator-10-launched


It can be downloaded from https://tools.hana.ondemand.com/#gateway

Prerequisites –


We need to follow steps as mentioned below [Reference – https://tools.hana.ondemand.com/#gateway ]

Installation Instructions

To start using SAP NetWeaver Gateway Productivity Accelerator (GWPA), proceed as follows:

  1. Download and install Java SE6 .
  2. Download and install the Eclipse IDE for Java EE Developers from Eclipse .
  3. Install the SAP NetWeaver Gateway Productivity Accelerator (GWPA) feature(s).

From the Eclipse menu, choose Help > Install New Software…
Add the URL
https://tools.hana.ondemand.com/juno.
Select the feature(s) you want to install and follow the steps of the installation wizard.
For information about the individual features, see the documentation.

To Develop Android application using GWPA, we need to install Android SDK tools on Eclipse IDE and then install GWPA features.

  • Toolkit for Android (GWPA)
    The Android Toolkit consists of an environment, a pattern and templates, suitable for developing SAP solutions for use in the Android environment.
    Prerequisite for installation of this feature is to install the
    Android SDK Tools.


Once you install Android SDK tools, it will look as below under Window –> preferences.

/wp-content/uploads/2013/06/android_gw1_229323.jpg

After doing all these steps, I faced issue with android application regarding getting error, “R cannot be resolved to a variable” and hence after searching lot on it, I resolved it by installing Android SDK Build-tools and hence your Android SDK Manager image should look as below.

/wp-content/uploads/2013/06/android_gw2_229324.jpg

After this step, you can start installing Toolkit for Android (GWPA) as mentioned below. You need to select checkbox for Toolkit for Android (GWPA).

/wp-content/uploads/2013/06/android_gw3_229334.jpg

Once installed successfully, you can open Windows –> Preferences and check under SAP NetWeaver Gateway.

/wp-content/uploads/2013/06/android_gw4_229336.jpg

Please note: we do not require separate installation for SAP OData Mobile Client SDK.

With all above required steps, you are now ready to develop Android application!

Procedure –

Create new project. Under OData Development, select Starter Application Project.

/wp-content/uploads/2013/06/android_gw5_229337.jpg

Give appropriate project name, select Build Target and package name and press Next.

/wp-content/uploads/2013/06/android_gw6_229338.jpg

We can create 3 types of application using below templates. Here, we will select List/Details Application.

/wp-content/uploads/2013/06/android_gw7_229339.jpg

Now, we need to select service URL from Remote location. Click on Catalog.

/wp-content/uploads/2013/06/android_gw8_229340.jpg

Click on Manage Connection if no connection is maintained earlier.

/wp-content/uploads/2013/06/android_gw9_229341.jpg

As displayed below, provide required details and click OK.

/wp-content/uploads/2013/06/android_gw10_229342.jpg

P.S. – If you do not have access to SAP NetWeaver Gateway system then you can access demo system from SAP at http://scn.sap.com/docs/DOC-31221?rid=/webcontent/uuid/1051f6d9-e87a-2e10-d188-e2786c7878b1 and accordingly configure connections and access OData services. Please refer my blog http://scn.sap.com/community/developer-center/front-end/blog/2013/05/31/how-to-create-sapui5-application-consuming-gateway-service-with-the-help-of-sap-nw-gateway-plugin and see section Additional Details for more information.


If the connection is made, you will be able to see services. For this demo, we will select service RMTSAMPLEFLIGHT and click OK.

/wp-content/uploads/2013/06/android_gw11_229343.jpg

Provide Activity title, select Activity type and add fields.

/wp-content/uploads/2013/06/android_gw12_229344.jpg

Add 2nd Activity of type Details.

/wp-content/uploads/2013/06/android_gw13_229346.jpg

We selected Flights as List activity and FlightBooking as Details Activity. Our final project structure will look something like below screen.

/wp-content/uploads/2013/06/android_gw14_229347.jpg

As displayed below, SAP Gateway system service details will be found under res/raw folder.

/wp-content/uploads/2013/06/android_gw15_229348.jpg

Also the auto-generated code provides commented code to handle Sybase Unwired Platform (SUP) server mode. This is really nice feature as when we have SUP, we need not to modify much logic.

/wp-content/uploads/2013/06/android_gw16_229349.jpg

Now we are ready with Android application and want to test it. To test android application, you can use Real device or Android Emulator http://developer.android.com/tools/help/emulator.html


We need to manage device using AVD. Please refer http://developer.android.com/tools/devices/index.html


An Android Virtual Device (AVD) is an emulator configuration that lets you model an actual device by defining hardware and software options to be emulated by the Android Emulator.


As displayed below, AVD can be added.

/wp-content/uploads/2013/06/android_gw17_229350.jpg

That’s it!!!


Now we are absolutely ready to test our application on emulator. We need to test as mentioned below,

/wp-content/uploads/2013/06/android_gw18_229351.jpg

Under Console screen, you will be able to see the log of AVD launch etc…

/wp-content/uploads/2013/06/android_gw19_229353.jpg

Please note: Android emulator sometime is very slow and hence you need to be patience and can take break for Coffee 😎 .


AVD will launch emulator device as displayed below,

/wp-content/uploads/2013/06/android_gw20_229354.jpg

Here sometime you need to press F2 or keyboard commands as per your AVD settings. Refer Keyboard commands at http://developer.android.com/tools/help/emulator.html


You may see screen as below. Here you can see all your Android based application. In this case, you can see MyFlightAndroidApp. Double click on app icon.

/wp-content/uploads/2013/06/android_gw21_229355.jpg

It will launch login screen. Provide credentials that you used while connecting to your gateway SAP system.

/wp-content/uploads/2013/06/android_gw22_229356.jpg

Under LogCat window, you will see the log of application being executed.

/wp-content/uploads/2013/06/android_gw23_229357.jpg

After successful launching, you will see the Flights list view.

/wp-content/uploads/2013/06/android_gw24_229359.jpg

Selecting any item will open details screen for FlightBooking as below

/wp-content/uploads/2013/06/android_gw25_229360.jpg

You can search for different flight id and it will be displayed accordingly.

/wp-content/uploads/2013/06/android_gw26_229361.jpg

Note that under LogCat window, all these events will be logged which can be very useful for troubleshooting purpose.

/wp-content/uploads/2013/06/android_gw27_229362.jpg

Closing Remarks –


With the help of SAP NetWeaver Gateway Productivity Accelerator (GWPA), we can create Android application with very minimum efforts.

This step-by-step blog is written to explain how we can,


  1. Install Android SDK tools, GWPA etc. in Eclipse IDE.
  2. Configure SAP NetWeaver Gateway system and search for OData services
  3. Create simple Android application
  4. Configure and Launch Android application on ADV
  5. Use Console and LogCat for troubleshoot purpose

GWPA is extremely helpful tool from SAP to leverage OData capability and it will certainly helpful for all developer community who want to develop simple android application based on SAP business suite data in the form of OData.


It is generating starter application which we can modify as per our business/organizational requirement 🙂

To report this post you need to login first.

74 Comments

You must be Logged on to comment or reply to a post.

  1. Paul Aschmann

    Hi  Chandrashekhar,

    Thanks for sharing your positive experience with GWPA and fulfilling your dream of a Mobile SAP app 🙂 . The types of tools are great as they can really make POC’s easier to accomplish at little cost while encouraging the business to adopt innovative solutions.

    Cheers, Paul

    PS. My android emulator also makes me drink too much coffee 😉

    (0) 
    1. Chandrashekhar Mahajan Post author

      Hi Paul,

      Thanks a lot for your comments!

      Yes I agree with you. These types of tools really makes development work easy and we can learn, explore lot many things quickly. We can build demos, PoC’s for business so that business can decide to adopt newer technological stuff.

      and about android emulator, I am planning to install HAXM (Intel Hardware Accelerated Execution Manager) which may boost the speed of emulator ( http://stackoverflow.com/questions/1554099/slow-android-emulator)

      This might reduce my coffee breaks 😉

      Regards,

      Chandra

      (0) 
  2. Devraj Singh

    Hi Chandrashekhar,

    I am a beginner in SAP Mobility n App developments.

    Q 1 – First I want to understand what is the basic diff with creating an andriod app in SAP SuP & GWPA.

    I was following  this blog very interestingly but below two points stopped my journey ahead. Request you to help me on below issue.

    As you have mentioned above

    To Develop Android application using GWPA, we need to install Android SDK tools on Eclipse IDE and then install GWPA features.

    As soon as I installed Eclipse and trying to install Andriod SDK in preferences window it was asking for a Path (SDK Location) and was giving error “Could not find folder Tools inside ….” when I followed below path.

    C:\Downloads\eclipse-jee-juno-SR2-win32\eclipse\plugins\com.android.ide.eclipse.adt.package_22.0.1.v201305230001–685705\com\android\ide\eclipse\adt

    Then I searched Tools folder using window search and i found it under

    “C:\Program Files\Oracle\JavaFX 2.1 SDK” so I opted for it.. correct me if i am going wrong.

    Regards

    Devraj

    (0) 
    1. Chandrashekhar Mahajan Post author

      Hi Devraj,

      Q 1 – First I want to understand what is the basic diff with creating an andriod app in SAP SuP & GWPA.

      To anwer your question, we can create native android application using both SAP SUP or GWPA. again SUP can be used as an additional layer for device managment and user management.

      Using GWPA, we can create simple starter applications cosuming OData services. and I believe even with SUP there might be APIs avaialable by which we can create android app cosuming OData services. I hope this might answer your question to some extend.

      [P.S – with SUP and MBO, we can create offline scenario based android apps]

      Regarding Android SDK path under Windows –> Preferences, you need to select path of your Android SDK folder.This could be C:\android\sdk . please find the path where you stored your ADT SDK. [also refer http://developer.android.com/sdk/installing/installing-adt.html for more details]

      Regards,

      Chandra

      (0) 
      1. Devraj Singh

        Thanks Chandrashekhar.

        One more issue,

        While configuring SAP backend, I need to provide connection parameter as below.

        Server Host

        Port

        Client

        User name

        Password

        I have gone through this —-> http://scn.sap.com/docs/DOC-40986

        and tried

        Server Host (One by one) ====>

        erpgw.sapdevcenter.com & lvpal259.dmzpal.sap.corp

        Port  ====> 80

        User ID and password is provided by ====>  SAP DevCenter

        But still not able to establish connection. It will be great if you can suggest on the same.

        Regards

        Devraj

        (0) 
        1. Chandrashekhar Mahajan Post author

          Use below details,

          Server Host: sapes1.sapdevcenter.com

          Server Port: 443

          and  User ID and password is provided by ====>  SAP DevCenter

                  

          Regards,

          Chandra

          (0) 
          1. Devraj Singh

            Dear ChandraShekhar,

            I have downloaded SAP gateway demo linux server (both Fedora and Suse based) and trying to configure it.

            There are below issue with Fedora setup.

            After installing SAP gateway on fedora, it has created an icon on desktop and when I am starting SAPMC icon.

            it is asking for details like host name and port along with Optional details like Message server details. But in help document pdf it is clearly shown that there will be a direct NPL shortcut on logon Pad.

            Q 1 – May I know if I am doing any thing of wrong direction.

            Q 2 – What I need to provide details in for host name and message server.

            For Suse..

            It is providing me NPL shortcut in which there are 3 things

            1 – Database

            2 – DVEBM GS42 on NPLHOst

            3 – SCS00 on nplhost

            Every time when i am starting NPL, database is coming on Green but 2nd and 3rd options were always failing in due to problem in message server.

            Any idea what should I do to make any of them working so that I can move further.

            Reagrds

            Dev

            (0) 
    2. Midhun VP

      Devraj,

      Using SUP we can develop mainly two types of native mobile apps; Offline apps (MBO) and Online apps (Odata). The example given is using Odata consumption in mobile app using GWPA as a development tool. In the case of Odata+SUP, SUP acts as a online data proxy. It is the recommended approach from SAP. In this case in SUP there will not be any development (ex.MBO development) and SUP is needed here for security, push notifications, SSO etc.

      Hope that helps you.

      – Midhun VP

      (0) 
  3. Madhumitha S

    Hi Chandrashekar,

    From your blog ,I could not understand how the dynamic input from the mobile user is passed to the Odata service .

    I have seen many blogs where the developer reconstructs the Odata service url with the input and filter criteria.

    My question is how does the eclipse plug-in assists the developer to determine what is the input to be passed to the Odata service ?

    (0) 
  4. divyesh vasani

    Hi Chandrashekar,

    Nice blog.

    I tried to add connection to Netweaver gateway demo system in Eclipse.

    Parameters :

    No HTTPS connection

    Host name: sapes1.sapdevcenter.com

    Port:443.

    Note that I am able to connect to ES1 via SAPGui, so user name is correct one.

    I am trying hard, can you guide me pls?

    Divyesh    

    (0) 
    1. Aamod Dhople

      Divyesh,

      You need to select “Use HTTPS”. Also save your user credentials for connecting to Demo system. You will then be able to see the services.

      When you finish developing the application and try running it from eclipse as “Web App preview”, you will get a popup for connecting to the server and then you should be able to see the data.

      Hope this helps.

      Aamod

      (0) 
  5. Vijay Vegesana

    Hi Chandra,

    thanks for posting the document step by step.it is really good exposure.

    For me when i am trying to do ..i got struct while creating a new project and the path Starter Application Project is not available.

    Can you please help me?

    Regards,

    Vijay

    (0) 
  6. Vijay Vegesana

    Hi Chandra,

    Now i m able to do so, but still in manage connections, from where i need to find server host and server port in sap.

    Checked from SM51, SMMS,  transactions but still not able to get the exact one.

    Server host name i got from System->status. though port number will be always 80,  i just want to know from where i can see these server port details.please guide me

    Regards,

    Vijay

    (0) 
    1. Chandrashekhar Mahajan Post author

      Hi,

      you can get the host name from SAP logon pad. select the system and right click and then select properties. here application server name is nothing but the host name. Yes the port is generally 80.

      for the SAP Demo Gateway system the details are,

      Server Host: sapes1.sapdevcenter.com

      Server Port: 443

      and  User ID and password is provided by ====>  SAP DevCenter

      Regards,

      Chandra

      (0) 
  7. suman kumar chinnam

    Hi Chandra,

    Thanks for posting such a detailed Blog.

    I have exactly followed steps as you mentioned above and I was able to create project but ended up with errors coming like “R cannot be resolved to a variable”. I dont know how to correct this error.I have installed Android(4.2.2) from SDK manager even before GWA toolkit for Android. Can you help me to resolve this.

    Thanks,

    Suman

    (0) 
    1. Chandrashekhar Mahajan Post author

      Hi,

      I hope you have downloaded Eclipse IDE fot Java EE as mentioned below.

      Download and install the Eclipse IDE for Java EE Developers from Eclipse .

      Because even I had got similar kind of error but I resolved by installing Eclipse IDE as mentioned above and then following subsequent steps.

      Regards,

      Chandra

      (0) 
      1. Neftalí López

        Hi Suman.

        The trouble that you describe is related with the environment.

        The environment needed for this developments use standard libraries from Android and SAP owner’s, and both libraries have access to folder res/raw. If you don’t have correctly installed the SAP libraries, the sentences in the example that try to access resources in this folder can’t find the correct libraries and the java runtime try to use the standard libraries.

        Try again each step from the procedure, I am sure that you omit some step, or you don’t do it exactly that the procedure says.

        I hope this help you.

        Regards.

        (0) 
    2. Carlos Roggan

      Hi Suman,

      I’ve had such issue, same error message. I checked and indeed, the R class was missing.

      Reason: the “Android Build Tools” hadn’t been installed.

      Solution: start SDK Manager and expand category “Tools” and select “Android SDK Build-tools” and install.

      This can be seen in the screenshot above in this blog.

      Since it is located in a different category, it can be easily overseen.

      Hope this is helpful.

      Cheers,

      Carlos

      (0) 
  8. Seenu Katha

    Hi Chandrasekhar.

    Thank you so much for this blog. This helped me to achieve my first ever android app based on GW.

    I completed your steps and I was successful. Then I tried to see this app working with SUP 2.2 SP04.

    Then I uncommented the code from loginactivity.java,  supHelper.java and then I completed maintaing the SUP details in rmtsampleflightservice.properties file. I followed the steps from this link.

    https://help.hana.ondemand.com/gateway_gwpa/frameset.htm?3c3c5a4d9e834eaf927ca3c01807f9ef.html

    But I am getting syntax errors in supHelper.java and loginactivity.java.

    It is mainly because of SUP version 2,2 SP04. In this version, there is no sup-json.jar.

    So auto generated code from GWPA points to liteUserManager.class that is available from sup-json.jar, which is available only SUP 2.1.

    So do you have the sample code for supHelper.java that can work for SUP2.2? This must use ODPUserManager.class from SUPProxyClient-2.2.jar.

    Pls either point me to download sup-json.jar file or any sample code of supHelper.java for SUP 2.2.

    Thanks

    seenu

    (0) 
    1. Chandrashekhar Mahajan Post author

      Hi Seenu,

      I do not have much details on SUP related stuff….I did my android app testing on emulator.

      I am sorry but I do not have answer to your question related to SUP part.

      Regards,

      Chandra

      (0) 
  9. Syam Babu

    Hi Chandra,

    When i am installing the GWPAM components through below link  https://tools.hana.ondemand.com/juno

    Getting below error like “Cannot complete the install because one or more required items could not be found.”

    Cannot complete the install because one or more required items could not be found.

      Software being installed: Toolkit for Android (GWPA, Developer Edition) 1.1.1 (com.sap.odata.dt.cons.toolkit.android.feature.feature.group 1.1.1)

      Missing requirement: OData Model 1.1.1 (com.sap.odata.dt.framework.model 1.1.1) requires ‘bundle org.eclipse.emf.validation 1.4.0’ but it could not be found

      Cannot satisfy dependency:

        From: Framework Wizard Exploration Component 1.1.1 (com.sap.odata.dt.component.exploration 1.1.1)

        To: bundle com.sap.odata.dt.framework.model 0.0.0

      Cannot satisfy dependency:

        From: Toolkit for Android (GWPA, Developer Edition) 1.1.1 (com.sap.odata.dt.cons.toolkit.android.feature.feature.group 1.1.1)

        To: com.sap.odata.dt.cons.toolkit.android.templates [1.1.1]

      Cannot satisfy dependency:

        From: OData Android Consumption Toolkit Templates 1.1.1 (com.sap.odata.dt.cons.toolkit.android.templates 1.1.1)

        To: bundle com.sap.odata.dt.component.exploration 0.0.0

    Thanks,

    Syam

    (0) 
    1. Carlos Roggan

      Hi Syam, could you please check if you have marked the checkbox “contact all updatesites during install…” in the “Install” – wizard?

      The background is:

      you’re installing the feature “…dt.framework.model”.

      This feature has a dependency to EMF

      You can install EMF (and all other prerequisites) manually.

      Or you can let eclipse do it automatically (this is the typical choice)

      This will install the prerequisites under the hood, while installing GWPA.

      But only if all the software-sites that you have configured, contain the prerequisites.

      Cheers,

      Carlos

      (0) 
  10. Navaneeth Prodhutur

    Hi Chandrasekhar.

    Thank you so much for this blog.i have followed all the steps above but  i am getting an error like

    The project was not built due to “Could not write file: /Users/navneeth.kumar/Desktop/Sap WorkSpace/SapDemo/bin.”. Fix the problem, then try refreshing this project and building it since it may be inconsistent

    I Clean the build Then also i am getting the same problem

    Thanks in advance

    Regards

    Navaneeth Prodhutur

    (0) 
    1. Carlos Roggan

      Hi Navaneeth,

      I’ve had such error as well, sometimes in the past

      I think I did the following:

      – delete the bin folder from within command line.

        This would be in order to make sure that the folder gets re-generated and is really empty

      Furthermore, I would recommend to use a workspace that is located at a different location. E.g. C:\SapWorkSpace

      It is no problem to use even multiple workspaces. So just shutdown Eclipse and start it with a different workspace. This implies that you start with an empty workspace, since all settings and other created projects are stored in the other workspace. But if desired, you can switch to the previous workspace by using the Eclipse main menu, then File -> “Switch Workspace” -> select the desired workspace.

      Hope this helps;-)

      Cheers,

      Carlos

      (0) 
    1. Carlos Roggan

      Hi Navaneeth,

      Here are some details about defining and starting with a new Workspace:

      In your running Eclipse, tell Eclipse to ask you for the Workspace on every startup of Eclipse.

      Eclipse main menu -> Window -> Preferences -> General -> Startup and Shutdown

      Enable the checkbox “Prompt for workspace…”

      /wp-content/uploads/2014/01/pref_366697.jpg

      Then restart Eclipse.

      On startup, you’ll get this dialog:

      startup.JPG

      Here, you can enter a new, empty folder.

      That’s it.

      After startup, you’ll get a fresh, clean Eclipse.

      Then you can re-generate a Starter Application and the build error (which isn’t caused by the Starter Application wizard) shouldn’t occur again.

      This is the workaround to get around your problem.

      Prerequisite is of course that there are no restrictions on Operating System level, which would hinder Eclipse from writing files.

      Hope this helps.

      Cheers,

      Carlos

      (0) 
  11. Praveer Sen

    Hi Chandrashekhar,

    I have installed the all are the initial component in eclipse,

    1. Eclipse JUNO 4.2

    2. Android SDK

    3. SAP Netweare Gatway Plugins.

    But i am not getting the oData Development option to create a new mobile application.

    Please Help.

    Thanks & Regards.

    Praveer.

    (0) 
    1. Carlos Roggan

      Hi Praveer,

      1) humm – maybe you should check if the GWPA plugins really have been installed properly.

      There are several ways to check.

      E.g. check if the OData perspective is available in Eclipse.
      Go to Eclipse main menu -> Window -> Open Perspective -> other -> OData

      /wp-content/uploads/2014/01/praveen1_369273.jpg

      If the entry OData is there, then the wizard should also be there (if GWPA installation didn’t fail)

      /wp-content/uploads/2014/01/praveen2_369274.jpg

      If the entry is not in this dialog, you should check if the installation has really been succesfully done.

      You can as well check under the Installation Details at

      Eclipse main menu -> Help -> about Eclipse -> Installation Details button

      /wp-content/uploads/2014/01/praveen3_369290.jpg

      If you see ODataModeler and Tools Core for SAP, then you should maybe check to open the wizard via the Service Catalog View:

      Go to:

      main menu -> Window -> show view -> other -> SAP NW Gateway -> Service Catalog

      /wp-content/uploads/2014/01/praveen4_369291.jpg

      after opening the Service Catalog view, you can expand your connection (have you been able to create one?) and select a service and open the context menu on it.

      There, you have an entry to create a Starter Application Project:

      /wp-content/uploads/2014/01/praveen5_369303.jpg

      Hope this helps;-)

      Cheers,

      Carlos

      (0) 
        1. Carlos Roggan

          Hi Praveen,

          the Gateway Demo system exposes Gateway services (based on OData).
          Such service can be accessed via browser, e.g. you can open this URL in browser:

          https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZGWSAMPLE_SRV/?sap-ds-debug=true

          Within Eclipse, you can access such service programmatically

          The Starter Application Wizard generates code which accesses a service programmatiacally.

          You can enter the above mentioned URL directly in the wizard.

          In Eclipse, you have to :

          Click on File-menu, then New -> Project -> OData Development -> Starter App Project

          Enter some details, as described in this blog

          Click next

          select a template

          click next

          In the Field “Service URL”, you can paste the following URL:
          https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZGWSAMPLE_SRV/?sap-ds-debug=true

          Then press GO.

          -> In this moment, your’re accessing the Gateway-OData-Service from Eclipse.

          Does this work for you?

          This description is slightly different from the procedure described in Chandrashehas Blog, but the result is the same.

          Kind Regards,

          Carlos

          (0) 
            1. Carlos Roggan

              Hi Praveer,

              prx_GWConnection.JPG

              this is how the connection dialog looks like, this works for me.

              Of course, you have to enter your personal credentials.

              Since this is HTTPS connection, you have import the certificate into your java virtual machine (the java version that is used by your Eclipse.)

              If you haven’t the certificate imported, you get a “SSL handshake error” ( you might have to look into the Error Log in order to see the exact error text)

              Kind regards,

              Carlos

              (0) 
              1. Praveer Sen

                Hi Carlos,

                Can you tell me, how we can search the Port No.

                I have installed the SAP Netweaver 7.4 in my personal system and i wants to access the same odata service.

                Below is my system information,

                SID: PRD

                Port??

                System HostName: PRVSAP.

                Please help.

                Thanks & regards.

                Praveer.

                (0) 
  12. Ankur Jindal

    Hi Chandrashekhar,

    Thanks for this blog. Its so detailed that i m able to create and run sample flight app. I have a request regarding the app. Can you please explain:

    * How we can add label to flight list items? It is without any label and its difficult for user to understand the field.

    * If we want to add more activities after creating the app, how can we do that? Right now, we have created two activities in the app.

    Regards,

    Ankur Jindal

    (0) 
  13. Jitendra Kansal

    Hi Chandrashekhar Mahajan

    I need your help. I am just trying this app and got stuck in between. I have few queries,

    1. This app has to be develop in OData perspective in Eclipse. Right?
    2. I followed each steps creating project, select List/Details Application, selecting respective category from service catalog. Once i finish, i get a different project structure what you showed.

    e.g. I don’t find com.example.proxy under src folder. I dont find res folder as well. And jar files have different naming along with different version.

    Flight_OData_Android.PNG

    Besides, i am getting one error:

    Error.PNG

    Please share your understanding.

    Rgrds,

    Jitendra

    (0) 
    1. Hi Jitendra,

      1) Yes you are correct. It is developed using GWPA with OData Development.

      2) I opened my project and can see com.example.proxy under src folder as well as  res folder

      I guess there might be some issues with android SDK which might not able to generate required files.

      Meanwhile, please check your SDK version under Android toolkit as mentioned in below screenshot.

      http://scn.sap.com/servlet/JiveServlet/downloadImage/38-86931-229336/620-379/android_gw4.jpg

      Regards,

      Chandra

      (0) 
        1. Ankur Jindal

          Hi Jitendra,

          I faced the same problem once in the past when the res folder was not getting generated. I checked on various blogs and found that in the Android SDK Manager, Android SDK platform-tools and build-tools were not updated to the latest version. I updated that and the problem got resolved. Please check in your side if it is updated to latest version or not.

          Regards,

          Ankur Jindal

          (0) 
    2. Carlos Roggan

      Hi Jitendra,

      regarding the compile error, I had such issues from time to time.

      You can see that the code is trying to access a resource (xml file) which should be located in the raw folder.

      In the following line, the same is being done with the rmtsampleflightmetadata-resource succesfully.

      Now, in order to investigate further, please look into the raw-folder and check if the servicedocument file is there.

      1) If not, then you probably better repeat the generation (or try to manually download the file and copy into the folder…)

      2) If this file is there, then maybe only the import statement is missing? try to import it by pressing Ctrl + O in the Java editor in eclipse

      3) If it doesn’t help, you can check if the java-representation of the resource in the R class has been properly generated.

      If yes, then it can be accessed via import-statement.

      If no, better regenerate the project

      4) If you repeat the generation and the servicedocument xml file is still not copied to the folder, then the reason might be that it hasn’t been successfully downloaded to the cache.

      In this case, you have to do a refresh in the Service Catalog View:
      Open the Service Catalog View, select the connection and press the “Refresh” button.

      Hope that any of these hints helps to solve the prob;-)

      Cheers,

      Carlos

      (0) 
  14. Mariela Castro Kohler

    Hallo Chandrashekhar

    Thank you very much for this Information. I have worked with the Demo but finally I have a clear Picture how this works and I will try to apply it to our own ERP system.

    Best regards,
    Mariela

    (0) 
  15. José Jaimes

    Hi Mahajan:

    Could you give information about the GW instalation? I mean, if I decide to install the GW in my server, will it be necessary to transport it to each enviroment?

    Haw you information about it? thanks.

    (0) 
      1. José Jaimes

        Thanks for the information.

        Do you manage information about the License. I would like to know If I decide to donwload the Add-on from Market Place and I proceed to install it, which are the fees associated?

        (0) 
  16. Virinchy P

    Hi Chandrashekhar Mahajan

    Following the same process with GWPA plugin and  developed a  sample Odata application consuming  RMTSAMPLEFLIGHT service from SAP Gateway Demo System ,

    Application is deployed successfully to my Android (4.4.2) device, but fails in authenticating the user .

    Error Logs from  Log Cat :

    Tag – “Connectivity ” – “Delta handling is disabled. Please add Persistence & Cache libraries to enable it.”

    Is there any proxy or workaround to be done  to consume odata with GWPA?

    (0) 
    1. Carlos Roggan

      Hi Viru,

      The mentioned entry in the log shouldn’t be the reason for failing authentication.

      There are probably other errors in the log.

      Please check if it’s really the login which is failing.

      There might be a timeout as well.

      You can see the URL – that is actually invoked – in the LogCat. You can try invoking this URL in the browser and give the same credentials and check if it works.

      You can then invoke the same URL in the browser app of the Android device and check if it can be invoked.

      There might be as well problems if the device is connected to a corporate network and uses a proxy, etc

      Hope this helps a bit.

      Cheers,

      Carlos

      (0) 
      1. Virinchy P

        Hi Carlos Roggan

        Looking deep in the logs i found a simiar log pointing to timeout. I tried coming out of my corporate network and the log resembles the same. Though the same URL can be successfully reached in the system and device browser .

        Please check if i am missing something . Added below are the Error Log and Connection properties of the system in  Eclipse.

        ConnectionTimeOut.png

        DemoSystemProperties.png

        (0) 
  17. Bharti Malik

    Hi Chandrashekhar,

    I am following your blog and need your advice for the step where we run the app and login into the service. I am getting the same error as Virinchy P. The device always shows login failed with same error logs. I even tried with 2 different services. What could be the possible solution to it.

    Kindly guide.

    Regards,

    Bharti Malik

    (0) 
      1. Devraj Singh

        Hi Jitendra,

        Thanks for your prompt response!appreciate it!

        Now it leads more confusion on which eclipse version we should use!

        Previously I was using Juno Then I have referred a blog in which they were asking to setup Luna version & now in the guide you have shared is on Kepler.

        Request you guys to help me understanding which eclipse version we should use for SAP current app development strategy.

        Few more question on top of that.

        Which OS is best to setup system i.e. xp, win7 or Linux(any specific distribution). Kindly suggest on which I can also able to utilize SAP provided demo systems.

        Regards

        Devraj

        (0) 
  18. saigowtham thangavelu

    Hi,

                       Very Useful Blog,Thank you..  How can i Send data Android to SAP?I want to Pass Multiple Strings..Please Give me some Example Code.

                                           

    (0) 
  19. Teh Lynn

    Hi Chandrashekhar,


    I created a deep insert post method in my odata service. However during consuming the odata service in Eclipse to build android app, when executing the post method the xml tag <atom:link> and <m:inline> is not generated. I notice the navigation (which was configure in the netweaver gateway) is missing in the XML during the application execution. I’m using this deep insert for creating sales orders that would have multiple sales order items during creation.


    Currently I am able to consume the get and delete method without any problem. Do you have any guide or advice regarding deep insert that you can provide?


    I have created a post for it but pending on the moderator to moderate before it can be posted.

    Hope to hear from you soon. Thanks.

    Regards,

    SL

    (0) 
  20. Avinash Ayanala

    Hi,

    I have followed the above steps and created a project and found that properties file has not been created in the project as specified as in the above mentioned path res/raw.

    For this project i have used Android 6.0 version and after running the apk file it is asking for login but after some time it is getting disconnected. Could anyone please let me know the reason for it.

    If possible could anyone provide some sample properties file. I could check it for my project.

    Regards,

    Avinash

    (0) 
    1. Carlos Roggan

      Hi Avinash Ayanala,

      I’ve found the following content in one of my old projects. Not sure, it might be created only when the GWPA preferences are accessed?

      So I think you don’t need to worry about this missing file

      Regards,

      Carlos

      It looks like this:

      #Proxy for Android properties file

      #Enter the details for the SUP server and application, when working with the SUP server

      #Mon Oct 21 13:16:57 CEST 2013

      vaultPassword=<myVaultPassword>

      sap_client=100

      farmId=<myFarmId>

      supPort=<myPort>

      securityConfig=<mySecurityConfiguration>

      supHost=<myHost>

      base_url=http\://<myhost>\:12345/sap/opu/odata/iwbep/GWDEMO

      applicationId=<myApplicationId>

      (0) 
      1. Avinash Ayanala

        Hi Carlos,

        Thank you very much for your response.

        I have a doubt is it really mandatory for us to place the property file or is it not necessary.

        And i am getting able to login into the application and getting notification in it as “No Results Found” in the emulator.

        Is it due to the absence of property file.

        Regards,

        Avinash

        (0) 

Leave a Reply