Skip to Content
UPDATE

I strongly recommend you to use the new version of the toolkit for Android in Gateway Productivity Accelerator (more info in this blog: http://scn.sap.com/community/netweaver-gateway/blog/2013/05/10/new-gateway-tool–sap-netweaver-gateway-productivity-accelerator).

The blog is still relevant, except that SAP NetWeaver Gateway plugin for Eclipse 2.5.2 is superseded by Gateway Productivity Accelerator 1.0.

It has never been easier to create mobile based applications connected to SAP systems. The SAP NetWeaver Gateway offers access to processes and data from a standard SAP Business Suite system (ERP, CRM …) via open protocols.

Together with the SAP NetWeaver Gateway plugin for Eclipse, anyone with a passion for Android development can immediately start using Gateway!

Starting with version 2.5.2 of the plugin, an Android Toolkit is available, enabling the native Android developer to easily develop applications that consume SAP NetWeaver Gateway services.

Today I will show you how easy it is to create an Android application that reads and displays data from SAP NetWeaver Gateway.

I assume you already have a running Eclipse IDE with the Android Developer Tools (ADT) plugin for Eclipse installed.

First thing you’ll need to do is to download and install the SAP NetWeaver Gateway plugin for Eclipse. Once installed, the second step will be to configure an NW Gateway system connection. I’ll be using the online NW Gateway demo system. To configure it, go to Eclipse Preferences and add a new connection under SAP NetWeaver Gateway > Connections.

One last thing before we can start, since the Android Toolkit is based on the SAP OData Mobile SDK, we need to download the SDK, and extract to a location on the file system. Then all we have to do is to set the path to where we have extracted the libraries, in Eclipse Preferences under SAP NetWeaver Gateway > Android Toolkit.

Now that we are done with the formalities, we can go ahead and use the plugin to create an Android app. Start by opening the New Project wizard and select Starter Application Project under the SAP NetWeaver Gateway node. Give your project a name, and select Android from the dropdown of available target platforms. Follow the wizard steps and select the List/Details Application template from the templates page of the wizard.

The service I will use in my application is the sample service that exposes data from the good old Flight sample application, and is available in SAP NetWeaver since many years. This is also the first example found under Sample Gateway Services in the NW Gateway demo system page on the SCN.

We have several ways to select the service to base our application on, but let’s try out the nice Catalog functionality to explore the Gateway service catalog. Clicking the Catalog button will open the service catalog. In case you skipped the connection configuration step, no worries, you can still do it without closing the wizard (simply click on the Configure… link and add the online demo system details).

Search for: *flight to display all services on this system that deal with flight data. The service I’m looking for is RMTSAMPLEFLIGHT_2.

We are almost done!

list details app.png

The final step of the List Template is to model the application pages (activities).

The modeling is quite intuitive: we start with a List activity that displays data from a selected collection of the service (Entity Set Navigation) in a list manner. Pick a few fields to appear on each entry in the list.

For example, I want to have a list of flight carriers as my first page. Then, on clicking a specific carrier I would like to list the carrier’s flights. So I add another page, and select its type to a List, and its Entity Set Navigation to CarrierFlights. I pick a couple of fields that describe a flight entry (for example, the flight number and date).

Last but not least I add a third page, this time of type Details to display detailed information on a specific flight, and add all fields.

Then, I click the Finish button of the wizard. A new Android project is generated containing a semantic proxy for the service I selected and application logic and resources according to my modeling. Also, the SAP OData Mobile SDK libraries are copied into the project under libs folder.

Now I can already run the application in an emulator or on a real Android device and check it out.

In runtime, you need to enter a username and a password for login. Just enter the same credentials you used to configure the Demo System.

Note that if working behind a proxy you might need to configure the proxy host and port in the application to avoid an Unknown Host Exception. For instructions on how to do that, refer to the troubleshooting guide – page 105 in the SAP NetWeaver Gateway plug-in for Eclipse guide.

I hope you find this blog helpful. Keep in mind that this is just a starting point for understanding how to consume Gateway services in an Android application. You can customize the generated project code manually like adding or removing pages, changing the layout and icons or add additional functionality.

Feel free to share in the comments section any customization and/or feedback you have.

Useful Links:

ADT Plugin

SAP NetWeaver Gateway plug-in for Eclipse

SAP OData Mobile SDK for Android

SAP OData Mobile SDK for Android documentation

SAP NetWeaver Gateway Demo System

To be updated on future #SAPGateway blogs and updates please follow us @shirilevil

To report this post you need to login first.

123 Comments

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

  1. Dany Shapiro

    Very impressive,

    It seems that creating a mobile based applications connected to SAP systems, is just a matter of running a wizard.

    Nice work.

    (0) 
  2. YUNUS KALDIRIM

    Hi Gal,

    I like your post. I’m trying to do steps. I didn’t connect netweaver gateway demo system with below details. I take an “network connection error” Are details ok?

    – Host: gw.esworkplace.sap.com

    – Port: 80

    – Client: default (800)

    • User: GW@ESW

    • Password: “ESW4GW”

    (0) 
    1. Gal Roter Post author

      Hi Yunus,

      I verified the details again and they seem correct. Maybe the user got temporarily locked. Please try again and let me know. If still getting the Network Connection Error, it might also be an issue with the proxy configuration in Eclipse (Eclipse Preferences > General > Network Connections)…

      (0) 
  3. Pravesh Deshbhratar

    hi Gal,

    I am facing one issues, when running the application in emulator, the error i am getting is “http error.” I am providing the scn loging userid/password .

    1. Am I providing the correct credentials

    Please help me to resolve the issue.

    Regards

    Pravesh

    (0) 
    1. Gal Roter Post author

      Hi Pravesh,

      Are you using a proxy? If so, you need to configure it in the application code.

      Please add the below two lines in SDMConnectivityHelper.java in the constructor:

      this.mPreferences.setStringPreference(ISDMPreferences.SDM_CONNECTIVITY_PROXY_HOST, “<your proxy host>”);

      this.mPreferences.setIntPreference(ISDMPreferences.SDM_CONNECTIVITY_PROXY_PORT, <proxy port>);

      Hope this will solve the issue.

      Regards,

      Gal

      (0) 
      1. Pravesh Deshbhratar

        Hi Gal,

        Thanks for your reply.

        Yes, I am using the proxy.

        I have already configured proxy setting , and I am able to browse the internet through emulator.

        Do I have to do some other configuration setting to run the application.

        Regards

        Pravesh

        (0) 
        1. Gal Roter Post author

          Hi Pravesh,

          Yes, when using a proxy you need to configure it in the application code (in the generated SDMConnectivityHelper class). The proxy configuration in the emulator itself is good for example for using the browser of the emulator but unfortunately not enough to run the application.

          Regards,

          Gal

          (0) 
          1. Pravesh Deshbhratar

            Hi Gal,

            I did the changes in SDMConnectivityHelper class : 

            this.mPreferences.setStringPreference(ISDMPreferences.SDM_CONNECTIVITY_PROXY_HOST, “<your proxy host>”); 

            this.mPreferences.setIntPreference(ISDMPreferences.SDM_CONNECTIVITY_PROXY_PORT, <proxy port>);

            But still I am having the same issue. LogCat I observed the warnning :

            07-24 12:22:59.214: W/xyAuthenticationHandler(278): Authentication scheme ntlm not supported

            Can you please help me on this .

            Regards

            Pravesh

            (0) 
            1. Gal Roter Post author

              Hi Pravesh,

              In order to isolate your problem, can you try running your application outside of your corporate network (with no proxy). When doing that, please clear the emulator app data or use a different emulator since the ISDMPreferences are being persisted.

              In case the application runs ok, I suggest you approach the IT in your organization because there seems to be a configuration issue of the proxy policy.

              Regards,

              Gal

              (0) 
  4. Midhun VP

    Hi Gal,

    This blog is really helpful.

    I have some quick questions on this.

    I developed android native app using SAP netweaver gateway around 6 months before, Now I am developing app with Sybase unwired platform as the middle ware since it started to support android. My question is what is the advantage/factor on developing app using SAP netweaver gateway when compared to SUP ?

    Regards

    Midhun

    (0) 
    1. Nir Channes

      Hi Midhun,

      Actually with the SAP NW GW plug-in you can enjoy both worlds. You can start your development only with Gateway in your landscpae, and then in the future add the SUP server to landscape for scalability considerations.

      When using our plug-in, the generated code comes with commented code that will help you with upgrading the application to utilize SUP server. Simply follow our documentation on the SUP upgrade story.

      Thanks,

      Nir

      (0) 
  5. Rahul Gupta

    Hi Gal,

    Thanks for the awesome post. I am having one query since I downloaded all the things which you mentioned and then I was trying to create a Starter Project Under SAP Netweaver Gateway. The problem which I am having is after giving the project name and the target as android and provided the application name I am not getting the Build Target meaning the name is displaying “Build Target” but there is nothing coming next to that.

    Neither any drop down or any input field.

    I downloaded the SAP OData Mobile SDK and set the path also which you mentioned. But still I am not getting.

    Can you please help me in this??

    Since I searched everywhere but did’nt found any solution.

    (0) 
    1. Gal Roter Post author

      Hi Rahul,

      I can think of two reasons that can cause the build targets to appear empty:

      The first, is that you need to have an Android SDK installed and configured in Eclipse Preferences > Android (i.e. be able to create Android projects regardless of the NW Gateway plugin). Note that SAP OData Mobile SDK currently supports Android API 8 – 13 (Android 2.2 – 3.2). The second, is in case you run your Eclipse on a Mac. In that case we have fixed a bug that will be part of the next realse of the plugin soon.

      Best regards,

      Gal

      (0) 
    2. Gal Roter Post author

      Hi Rahul,

      Another reason might be that the Android SDK is installed under Program Files folder, which we found to have some permission issue. In that case, you need to install the Android SDK on a different location (e.g. C:\Android\android-sdk) and change in Eclipse Android Preferences the SDK Location to the new one.

      Regards,

      Gal

      (0) 
  6. Takako Tashiro

    I’d like to try this article.

    I tried to install the SAP NetWeaver Gateway plugin for Eclipse.

    I tried to add the sybase mobile sdk 2.1.3, that is eclipse 3.7.0.v20110530-xxx

    Then, I got the error as follows,

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

    Software being installed: SAP NetWeaver Gateway – Android Toolkit 2.5.200.201206111810

    Any answer would be appreciates.

    Regard,

    (0) 
    1. Michal Keidar

      Hi Takako,

      Could you please elaborate on how you tried to install our plugin for Eclipse?

      It is unclear for example how you tried to add the Sybase mobile SDK libraries, if the Android Toolkit wasn’t installed.

      Also, please verify you check the “Contact all update sites during install to find required software” check box when installing via the “Install New Software” window in Eclipse.

      Thanks,

      Michal.

      (0) 
  7. Harit Bhasin

    Hi Gal,

    I think I have done and configured same as you have mentioned in the post. However, I have been facing in developing new android app. I am getting ‘A build target must be specified.’ error and the drop down box of build target is empty. Please do let me know what mistake I am doing. I am trying to do with SAP Netweaver gateway demo system only as of now.

    (0) 
    1. Michal Keidar

      Hi Harit,

      1. Do you have an Android SDK installed and configured in Eclipse Preferences > Android? (i.e. are you able to create Android projects regardless of the NW Gateway plugin?). Note that SAP OData Mobile SDK currently supports Android API 8 – 13 (Android 2.2 – 3.2).

      2. Do you run on Mac?

      3. Is your Android SDK folder located under Program Files folder?

      Thanks.

      (0) 
  8. Harit Bhasin

    Hi Michal/Gal,

    I have just checked Gal response for Rahul. I have cross checked everything.

    1) My android sdk is installed and configured in Eclipse. I have created small application mentioned on http://developer.android.com/training/basics/firstapp/creating-project.html.

    2) I am working on Windows 7.

    3) Android SDk folder is not in program files. it is saved in and same I have configured in Eclipse Preferences > Android

    C:\Users\*****\AppData\Local\Android\android-sdk

    Please do let me know if still any problem is there..

    Thanks..

    (0) 
    1. Michal Keidar

      Hi Harit,

      I’ve sent you an email with request for more details, maybe we could even have a sap-connect meeting.

      I’ll update here with our results 🙂

      Thanks,

      Michal.

      (0) 
    2. Michal Keidar

      Hi Harit,

      Could you please check again if your installed Android API level, in your Android SDK, is between 8 – 13 (Android 2.2 – 3.2)?

      We suspect you have only Android API 4.1 installed, which SUP doesn’t support, and therefore you don’t see it in the drop down menu.

      Please install also Android API 2.2 for example and let me know if that worked.

      Thanks,

      Michal.

      (0) 
  9. Harit Bhasin

    Hi Michal,

    As you suggested, I have downloaded other APIs and I am able to develop the application now. Thanks..
    Hi Gary,

    It was really nice and easy to create mobile application. great work.

    I tried this demo application on emulator. As I am very new in application development so could you guys please share some details or link how to install and use this in real Android mobile?

    Thanks.

    Harit Bhasin

    (0) 
    1. Michal Keidar

      Hi Harit,

      Glad to hear it worked 🙂

      If you want to run your app on a real Android device, follow the steps stated here.

      Basically you just need to configure your device to be “debugable”, and install its usb driver on your machine.

      Michal.

      (0) 
  10. Harit Bhasin

    Hi Gary/Michal,

    I regret to bother you again. I am trying to add a my Gateway connection under SAP NetWeaver Gateway > Connections and it is showing me ‘Network Connection error’.

    Could you please tell me why I am not able to connect my gateway system and how will I rectify it?

    Thanks

    Harit Bhasin

    (0) 
      1. Harit Bhasin

        HI Michal,

        In Preferences->SAP Netweaver Gateway->Connections

        I am trying to give host name and port to connect to my gateway server but all the time it is giving Network Connection error. I spoke to my admin team and they were not sure either why this error was coming even though we are putting correct details. I have asked them about proxy of our organization and they confirmed and we are not using any proxy to network as of now.
        Please suggest me if i need to put some other details or make any more configuration.

        Thanks

        Harit Bhasin

        (0) 
        1. Michal Keidar

          Hi Harit,

          A few things:

          1. You can check in Eclipse to see if a proxy is configured (via Window-> Preferences-> Network Connections), if you’re working from within SAP network then a proxy must be configured I think.

          2. Could the user be locked? Did you check it in the browser to see it works there?

          3. Perhaps you didn’t uncheck the “Use HTTPS” checkbox when adding the new Gateway connection?

          4. If non of the above worked, please send me the stack trace from the Error Log.

          Thanks,

          Michal.

          (0) 
  11. Nitin Kamble

    I got a problem, even after specifying the SAP OData Mobile SDK path Like this,  E:\XXX\AndroidSUPODataSDK_2.1.3\Android\libraries

    Build Target is Not Coming In SAP Netweaver Gateway Project Using Eclipse.

    What did I missed?

    (0) 
    1. Michal Keidar

      Hi Nitin,

      The build targets are not related to the path of SUP libraries, they are the API levels of your Android SDK.

      Could you please check if your installed Android API level, in your Android SDK, is between 8 – 13 (Android 2.2 – 3.2)?

      Any other version SUP doesn’t support, and therefore it is not shown in the drop down menu.

      If not, please install also Android API 2.2 for example and let me know if that worked.

      Thanks,

      Michal.

      (0) 
      1. Nitin Kamble

        Thanks Michal for your help. My Android API level in Android SDK is between 3 to 16, I am not sure which level SAP Netweaver Gateway Project selects by default. How would I change the level?

        (0) 
            1. Michal Keidar

              Ok.

              So couple of more questions:

              1. Are you running on Windows environment or Mac (unix)?

              2. Where is your eclipse located, (in what folder)?

              3. Where is your Android SDK located?

              4. Does your Java version suits your working environment? I mean, do you have Java 32bit or 64bit?

              Thanks.

              (0) 
              1. Nitin Kamble

                1. Its windows environment. More specific Windos XP SP 3

                2. Eclips located at D:\Nitin\eclipse\

                3. Android SDK located at D:\Vishal\Android\android-sdk\

                4. YES. We have developed couple of Non SAP Android application, mostly using Web Service.

                (0) 
                1. Nitin Kamble

                  Michal,

                  One more clue, we managed to get the dropdown on 1 machine out of 12. But I am still cluless about remaining 11 machines. Any luck?

                  Thanks much,

                  Nitin

                  (0) 
                        1. Nitin Kamble

                          I tried to start Eclipse using command prompt with JDK 1.8 and JDK 1.7 and tried to open wizard  as you suggested above. Log is below.

                          Is there any other way to see log?

                          ———————————————–

                          eclipse.buildId=I20110613-1736

                          java.version=1.8.0-ea

                          java.vendor=Oracle Corporation

                          BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_IN

                          Command-line arguments:  -os win32 -ws win32 -arch x86

                          !ENTRY org.eclipse.help.base 4 4 2012-09-11 22:57:42.768

                          !MESSAGE Help documentation could not be indexed completely.

                          !SUBENTRY 1 org.eclipse.help.base 4 4 2012-09-11 22:57:42.768

                          !MESSAGE Help document /com.sap.iw.gw.oc.eclipse.help/html/installationPHP.html cannot be opened.

                          !SUBENTRY 1 org.eclipse.help.base 4 4 2012-09-11 22:57:42.768

                          !MESSAGE Help document /com.sap.iw.gw.oc.eclipse.help/html/installationjava.html cannot be opened.

                          !ENTRY org.eclipse.ui 4 4 2012-09-11 23:00:13.462

                          !MESSAGE Invalid preference page path: XML Syntax

                          !SESSION 2012-09-11 23:00:18.851 ———————————————–

                          eclipse.buildId=I20110613-1736

                          java.version=1.7.0_07

                          java.vendor=Oracle Corporation

                          BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_IN

                          Command-line arguments:  -os win32 -ws win32 -arch x86 -console -consoleLog -debug

                          !ENTRY org.eclipse.ui 4 4 2012-09-11 23:02:36.136

                          !MESSAGE Invalid preference page path: XML Syntax

                          (0) 
  12. Nitin Kamble

    Dear Michal and Gal,

    There is good news from my side. After many try I managed to get Drop Down. Answer was in my reply to Michal on Sep 10, 2012 9:39 AM

    In 10th Sept 2012 reply I mistakenly gave paths to Michal from the only machine where it works, today I noticed that there is no spaces in the paths. (Michal, Sorry for this silly mistake)

    WORKAROUND:

    If you have installed Android SDK at “C:\Program Files\Android\android-sdk”, somehow space in path (in between PROGRAM and FILES) is the main reason for no show by drop down. I copied the Android SDK at “C:\android-sdk” and it is working like a charm.

    Also for safer side, I also copied Eclipse at “C:\eclipse”, I have no idea about the space in Eclipse path has any role in it.

    Hope this will help to others who are facing same problem.

    Cheers!

    Nitin

    (0) 
    1. Michal Keidar

      Hi Nitin,

      Yes, if the Android-SDK folder is located in Program Files then a problem in permissions will cause an empty drop-down menu.

      Glad to hear it worked out 🙂

      Michal.

      (0) 
  13. Gajanand Gupta

    Hi Gal,

    Its really nice post for android development i done all the steps and created a sample application successfully using the wizard but when i am running the same after entering username password it is giving me java.net.SocketTimeoutException can you help me how can i resolve this my API level is Android 2.2 API 8.

    Regards

    Gajanand

    (0) 
    1. Gal Roter Post author

      Hi Gajanand,

      Not sure what the problem is exactly as java.net.SocketTimeoutException can be caused by a few reasons. You may want to try to filter or use the top system query option in order to reduce the number of entries retrieved. I’ve seen cases where Android (at least in the
      default config) cannot deal with a very large number of records and throws this
      exception as a result.

      Another suggestion I have is to clear the AVD or create a new AVD instance and see if
      the problem persists there.

      Best regards,

      Gal

      (0) 
  14. Tareq Chy

    Hi Gal,

    That’s really very informative post. Just came to know plenty of things from your post. Very interesting. I am relatively a newbie to this world and learning how to create SAP magazine newsstands apps for iPad from a website called http://www.nichespin.com.

    Thanks.

    (0) 
  15. Rudra Varma

    Hi Gal,

    Very good post. I have created default andriod list app and tried to run on my HTC device. When i used salesorder service, It has given RFC call error stating that “syntax error in system’. So, I created another app using Z_Bank_Info service and tried to run once again, this time it is giving an error ” Client error: Country not defined”.

    Could you please suggest a service which will run smoothly?

    Many thanks in advance.

    (0) 
  16. Rudra Varma

    Hi Gal,

    I am trying to add filter to restrict the number of entires in the list.

    I am using OdataQuery.filter method to add filter like ‘Status eq ‘Order assigned’. It looks like this filter do not have any effect on the result displayed in the list.

    Please let me know if i am not doing in a right way

    (0) 
    1. Gal Roter Post author

      Hi Rudra,

      You need to enable the query option on the server side (Gateway) and test that it works from a web browser. Once the filter option is working, then you should use the filter method of the ODataQuery like you mention.

      Please let me know if it still doesn’t work

      Best Regards,

      Gal

      (0) 
  17. kartheek sarabu

    Hi frnds,

        

         I tried to execute Flight application in my eclipse with android plugin…

       

         At the final step of list template Finish button is disabled and the message I can see at the top is

    “Define the layout of Activities, and the sequence of navigation based on the properties of the selected SAP service”

         I took 2-3 activites and 3-4 names in each entity set navigation but then I cant let it done to finish.

    Many thanks in advance.

    (0) 
    1. Gal Roter Post author

      Do you see some message at the top of the wizard page? The page should display a message stating what is needed to complete it in order to press the finish button.

      (0) 
      1. kartheek sarabu

        At the top of the wizard page it displays a message like

        “Define the layout of Activities, and the sequence of navigation based on the properties of the selected SAP service”

        (0) 
      2. kartheek sarabu

        Hi Gal,

        I am getting below message so can you please advise what could be the problem or I am missing ..? Thanks for your time..

        At the top of the wizard page it displays a message like

        “Define the layout of Activities, and the sequence of navigation based on the properties of the selected SAP service” 

        (0) 
  18. Andre Oliveira

    Hi Gal,

    I followed all the steps. When I run the application, I got some errors:

    Project ‘Sap’ is missing required source folder: ‘gen’

    Project has no project.properties file! Edit the project properties to set one.

    Do you have any idea?

    tks in advance

    (0) 
  19. Priyanka Kumari

    Hi Gal,

    I followed all the steps. When I run the application, I got following error:

    12-19 18:06:38.014: E/dalvikvm(287): Could not find class ‘com.sap.mobile.lib.supportability.SDMLogger’, referenced from method com.test.RMTSAMPLEFLIGHT_2Application.onCreate

    12-19 18:06:38.034: E/AndroidRuntime(287): FATAL EXCEPTION: main

    12-19 18:06:38.034: E/AndroidRuntime(287): java.lang.NoClassDefFoundError: com.sap.mobile.lib.supportability.SDMLogger

    12-19 18:06:38.034: E/AndroidRuntime(287):           at com.test.RMTSAMPLEFLIGHT_2Application.onCreate(RMTSAMPLEFLIGHT_2Application.java:31)

    12-19 18:06:38.034: E/AndroidRuntime(287):           at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)

    12-19 18:06:38.034: E/AndroidRuntime(287):           at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4244)

    12-19 18:06:38.034: E/AndroidRuntime(287):           at android.app.ActivityThread.access$3000(ActivityThread.java:125)

    12-19 18:06:38.034: E/AndroidRuntime(287):           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)

    12-19 18:06:38.034: E/AndroidRuntime(287):           at android.os.Handler.dispatchMessage(Handler.java:99)

    12-19 18:06:38.034: E/AndroidRuntime(287):           at android.os.Looper.loop(Looper.java:123)

    12-19 18:06:38.034: E/AndroidRuntime(287):           at android.app.ActivityThread.main(ActivityThread.java:4627)

    12-19 18:06:38.034: E/AndroidRuntime(287):           at java.lang.reflect.Method.invokeNative(Native Method)

    12-19 18:06:38.034: E/AndroidRuntime(287):           at java.lang.reflect.Method.invoke(Method.java:521)

    12-19 18:06:38.034: E/AndroidRuntime(287):           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)

    12-19 18:06:38.034: E/AndroidRuntime(287):           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)

    12-19 18:06:38.034: E/AndroidRuntime(287):           at dalvik.system.NativeStart.main(Native Method)

    I tried with both eclipse 4.2.1 and eclipse helios 3.6.2 but it didnt work. I reinstalled ADT Plugin, Gateway Plugin but it didnt help.

    Also, project.properties file is not getting generated.

    Can you please let me know what could be the reason for above error?

    Regards

    Priyanka


    (0) 
    1. Gal Roter Post author

      Hi,

      Which version of the SAP OData Mobile SDK are you using?

      Also, which Android target are you using? and which ADT version?

      Thanks,

      Gal

      (0) 
        1. Rohith Deraje

          Hi Priyanka,

          The exception says noClassDefinition found for SDM logger. Please check if have added the SDMCommon library to the project buildpath.

          com.sap.mobile.lib.supportability.SDMLogger is part of SDMCommon library.

          Regards

          Rohith

          (0) 
          1. Priyanka Kumari

            Hi Rohith,

            SDMCommon library is added to the project but there is issue while loading that library.

            I created different application using other services of demo netweaver gateway server but i am facing same error.

            Regards

            Priyanka

            (0) 
            1. Rohith Deraje

              Hi Priyanka,

              The problem “noClasDefinition Found” you are facing is independent of the gateway. when are you getting this error? while building the project Or while making the request?

              Can you please share the complete stack trace? 

              Regards

              Rohith

              (0) 
        2. Gal Roter Post author

          Hi Priyanka,

          Did you manage to solve the noClassDefinition issue?

          Please do check if all required SDM libaries are added under libs folder and all libraries are marked for Order and export.

          Regards,

          Gal

          (0) 
          1. Priyanka Kumari

            Hi Gal  and Rohith,

            I have added all SDM libraries(SDMcache, SDMCommon, SDMConnectivity, SDMParser, SDMPersistence) under libraries tab and marked all libraries unde Order and export tab. But when i run the application ,i get the same error. There is problem while loading SDM libraries. 

            Please find below logcat->error trace:

            12-24 09:19:51.598: E/Zygote(33): setreuid() failed. errno: 2

            12-24 09:19:56.617: E/Zygote(33): setreuid() failed. errno: 17

            12-24 09:19:57.607: E/BatteryService(73): usbOnlinePath not found

            12-24 09:19:57.607: E/BatteryService(73): batteryVoltagePath not found

            12-24 09:19:57.607: E/BatteryService(73): batteryTemperaturePath not found

            12-24 09:19:57.627: E/SurfaceFlinger(73): Couldn’t open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake

            12-24 09:20:16.437: E/EventHub(73): could not get driver version for /dev/input/mouse0, Not a typewriter

            12-24 09:20:16.437: E/EventHub(73): could not get driver version for /dev/input/mice, Not a typewriter

            12-24 09:20:17.127: E/System(73): Failure starting core service

            12-24 09:20:17.127: E/System(73): java.lang.SecurityException

            12-24 09:20:17.127: E/System(73):  at android.os.BinderProxy.transact(Native Method)

            12-24 09:20:17.127: E/System(73):  at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)

            12-24 09:20:17.127: E/System(73):  at android.os.ServiceManager.addService(ServiceManager.java:72)

            12-24 09:20:17.127: E/System(73):  at com.android.server.ServerThread.run(SystemServer.java:184)

            12-24 09:20:17.711: E/SoundPool(73): error loading /system/media/audio/ui/Effect_Tick.ogg

            12-24 09:20:17.711: E/SoundPool(73): error loading /system/media/audio/ui/KeypressStandard.ogg

            12-24 09:20:17.717: E/SoundPool(73): error loading /system/media/audio/ui/KeypressSpacebar.ogg

            12-24 09:20:17.717: E/SoundPool(73): error loading /system/media/audio/ui/KeypressDelete.ogg

            12-24 09:20:17.717: E/SoundPool(73): error loading /system/media/audio/ui/KeypressReturn.ogg

            12-24 09:20:20.577: E/ThrottleService(73): Could not open GPS configuration file /etc/gps.conf

            12-24 09:20:20.637: E/ThrottleService(73): Error reading data file

            12-24 09:20:20.917: E/logwrapper(158): executing /system/bin/tc failed: No such file or directory

            12-24 09:20:20.947: E/logwrapper(162): executing /system/bin/tc failed: No such file or directory

            12-24 09:20:21.018: E/logwrapper(166): executing /system/bin/tc failed: No such file or directory

            12-24 09:20:21.187: E/logwrapper(168): executing /system/bin/tc failed: No such file or directory

            12-24 09:20:21.207: E/logwrapper(169): executing /system/bin/tc failed: No such file or directory

            12-24 09:20:21.219: E/logwrapper(170): executing /system/bin/tc failed: No such file or directory

            12-24 14:50:35.063: E/dalvikvm(260): Could not find class ‘com.sap.mobile.lib.supportability.SDMLogger’, referenced from method com.demo.DEMO_FLIGHTApplication.onCreate

            12-24 14:50:35.128: E/AndroidRuntime(260): FATAL EXCEPTION: main

            12-24 14:50:35.128: E/AndroidRuntime(260): java.lang.NoClassDefFoundError: com.sap.mobile.lib.supportability.SDMLogger

            12-24 14:50:35.128: E/AndroidRuntime(260):  at com.demo.DEMO_FLIGHTApplication.onCreate(DEMO_FLIGHTApplication.java:31)

            12-24 14:50:35.128: E/AndroidRuntime(260):  at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)

            12-24 14:50:35.128: E/AndroidRuntime(260):  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4244)

            12-24 14:50:35.128: E/AndroidRuntime(260):  at android.app.ActivityThread.access$3000(ActivityThread.java:125)

            12-24 14:50:35.128: E/AndroidRuntime(260):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)

            12-24 14:50:35.128: E/AndroidRuntime(260):  at android.os.Handler.dispatchMessage(Handler.java:99)

            12-24 14:50:35.128: E/AndroidRuntime(260):  at android.os.Looper.loop(Looper.java:123)

            12-24 14:50:35.128: E/AndroidRuntime(260):  at android.app.ActivityThread.main(ActivityThread.java:4627)

            12-24 14:50:35.128: E/AndroidRuntime(260):  at java.lang.reflect.Method.invokeNative(Native Method)

            12-24 14:50:35.128: E/AndroidRuntime(260):  at java.lang.reflect.Method.invoke(Method.java:521)

            12-24 14:50:35.128: E/AndroidRuntime(260):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)

            12-24 14:50:35.128: E/AndroidRuntime(260):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)

            12-24 14:50:35.128: E/AndroidRuntime(260):  at dalvik.system.NativeStart.main(Native Method)

            12-24 14:50:35.663: E/HierarchicalStateMachine(73): TetherMaster – unhandledMessage: msg.what=3

            12-24 14:50:35.683: E/HierarchicalStateMachine(73): TetherMaster – unhandledMessage: msg.what=3

            12-24 14:50:44.904: E/MetadataRetrieverClient(34): failed to extract an album art

            12-24 14:51:49.694: E/ThrottleService(73): Error reading data file

            Thanks

            Priyanka

            (0) 
            1. Rohith Deraje

              Hi Priyanka,

              Again the logs says no class defn found. I guess some issue with your development environment. Change the Android Target  to newer one and try building again.

              Regards

              Rohith

              (0) 
              1. Priyanka Kumari

                Hi Rohith,

                I removed and again added SDM libraries.I also marked those libraries in order and export tab. It worked now.

                Now on running the application on emulator i am getting “ java.net.sockettimeoutexception” error.

                Thanks & Regards

                Priyanka

                (0) 
                1. Rohith Deraje

                  Hi Priyanka,

                  Are you getting this error when you try to register? Or during request response?

                  Did you add internet permissions to android manifest file? If not please refer to my guide http://scn.sap.com/docs/DOC-23532. This should assist you until you successfully register your application with SCC. You can revert back for making request.

                  Regards

                  Rohith

                  (0) 
                  1. Priyanka Kumari

                    Hi Rohith,

                    I am getting this error after entering login details on first screen of application and clicking on login.  I am not using any proxy and am able to browse internet through emulator.

                    I am directly consuming NW gateway services application on android app. I am not using SUP server in between.

                    Regards

                    Priyanka

                    (0) 
                    1. Rohith Deraje

                      Hi Priyanka,

                      I have  never tried using SDM connectivity directly with gateway.  So I cannot suggest you here. However preffered way for developping online applications is using SUP-ODP.

                      Regards

                      Rohith

                      (0) 
                      1. Priyanka Kumari

                        Hi Rohith,

                        Why do we need SUP when we already have SDM libraries added into Android project? We have added SDM libraries and installed SAP NW Gateway plugin in the eclipse.

                        If anybody have solved this “java.net.sockettimeoutexception” error,please let me know.

                        Regards

                        Priyanka

                        (0) 
  20. msap sdn

    Hello,

      I’ve managed to do all the steps in Eclipse/Android project but when running the app and try to log on, I get an “Authentication error”.

      I’m using the same credentials as for the sap connection

       – User: GW@ESW

       – Password: ESW4GW

    Any ideas, should I logon with differenent credentials ?

    Thanks for your help.

    Regards

    (0) 
      1. msap sdn

        Hello,

          Thanks for your reply, it was probably something like that.

          I had this before, with soap app example, and this was solved by changing the java compiler to 1.6, did this also in this example and no connection error anymore.

        Now I get this error “error in making request java.net.sockettimeoutexception”.

        I get this in method “updateResultsInUi()” in “Page1ListActivity.java”.

        Regards

        (0) 
          1. msap sdn

            Hi,

              No, not yet.

              Do you have the same problem ?

              I noticed now that I didn’t follow all the steps in the example (wizard).

              Maybe that’s the problem …

            Regards

            (0) 
  21. Ankit Doshi

    Hi Gal,

    I am getting an error saying “Project has no project.properties file! Edit the project properties to set one” . I added project.properties file manually and setted the target manually and refreshed the project after which the error disappeared but now all the packages in the src folder appear in error. What could have gone wrong??

    Regards

    (0) 
    1. Gal Roter Post author

      Hi Ankit,

      I suspect this might be an issue with the ADT version.

      Which Android SDK version do you use? Note that default.properties has been renamed project.properties since r14.

      (0) 
  22. Ankit Doshi

    Hi Gal,

    I am using 2.2 for development..I also tried using 3.2 but no luck…I have up till 4.1 installed on my machine but this SAP plugin supports up till 3.2 only.

    All the errors that appear here look java related…ArrayList cannot be resolve to a type..etc.

    I am really keen on getting this app running  but I am perplexed about how to resolve this issue..thank you very much for your valuable guidance.

    (0) 
      1. Ankit Doshi

        Hi Gal,

        I re-installed all the required software(jdk,eclipse,android sdk,SAP SDK) and tried creating the app again, now when I give the project name and select Andorid from the dropdown menu for “Create a new project for” eclipses simply freezes and gives a message eclipse not responding after some time.

        I checked this thread http://scn.sap.com/message/13604503 but it does not help.

        (0) 
        1. Gal Roter Post author

          Hi Ankit,

          Which Eclipse version are you using?

          I’m not familiar with this issue. Are you able to provide maybe an error log?

          (0) 
  23. Vishesh Agrawal

    Hi Gal,

    Thanks a lot for this awesome blog..

    I was able to setup the eclipse and create the fligh example.

    But, When i tried to run the application in emulator it runs the login screen appears

    after that when i enter the login details (User name – GW@ESW & Password – ESW4GW) i get the error message:-

    Error in making request

    java.net.UnknownHostException:Unable to reslove host “GW.ESWORKPLACE.SAP.COM”

    No address associated with hostname

    any idea why i am getting this and how to reslove it…?

    Thanks,

    Vishesh.

    (0) 
    1. Gal Roter Post author

      Hi Vishesh,

      Usually this exception is associated with working with a proxy. You need to configure your proxy in the application code. Please see previous comments to this blog.

      Cheers

      (0) 
      1. Vishesh Agrawal

        Hi Gal,

        Thanks for you reply.

        I added the code which you have mentioned in the comments but, even after doing that i

        am adding another error now:-

        java.net.SocketTimeout

        can you help me with this.

        Thanks in advance,

        Vishesh.

        (0) 
        1. Michal Keidar

          Hi Vishesh,

          It could be because you request a large collection of data, try to add this line:

          query.top(5);

          in LoginActivity.java class, near the end of the class, when the query is being built.

          Thanks,

          Michal.

          (0) 
          1. Vishesh Agrawal

            Hi Michal,

            Thanks a ton..!!

            Yes i was requesting for too much data therefore timeout error was occuring.

            Finally i am successfuly able to run the application..

            Just one question..

            When i was requesting access for ES Workplace.

            I got the access for my user but in mail it was mentioned that demo system will not be

            available from march 2013 .. Are you people planning to close the demo system…?

            Thanks a lot .

            Thanks,

            Vishesh.

            (0) 
              1. Vishesh Agrawal

                Hi michal,

                Thanks a lot for info.. 🙂

                Out of my curiosity i was trying to run the application in a real device.. I went through the comment and followed the steps ( enabling debugging mode etc..)

                But, when trying to log in from the Log screen i get the same error:-

                UnKnown Host Exception:- Unable to resolve host “GW.ESWORKPLACE.SAP.COM”

                No address associated with hostname.

                Surprisingly the application is running correctly in the emulater.

                Any Clues..?

                Thanks and Ragards,

                Vishesh.

                (0) 
  24. Wiebe Elsinga

    Hi Everbody,

    So I want to start making an Android app, but after selecting “Starter Application Project” and choosing Android, the “Target Build” is empty. I have all Android API versions installed, and i’m running on a Mac.

    What am I doing wrong?.

    (0) 
  25. lutiaud sébastien

    Hi,

    When i run the application in an emulator and enter user and password, i’ve got that error :

    “Error in making request.

    java.net.SocketTimeoutException”.

    What can be the reason?

    Thank.

    (0) 
  26. msap sdn

    Hello,

      Also here,error message “

    “Error in making request.

    java.net.SocketTimeoutException”.

    Any idea’s ?

    Thanks

    (0) 
    1. Vishesh Agrawal

      Hi ,

      It may be because you requested a large number of data at one go try requesting for a      less number of rows in order to get the results.

      I think adding query.top(5); in loginactivity.java class

      just before calling the intent will do the work.

      Cheers,

      Vishesh

      (0) 
  27. Umapathy Gopal

    Hi,

       I am trying out this example in android. I have set up the android development environment (adt bundle given in android developer site). I have Android 2.2 sdk and android 4.2. The eclipse version is 4.2.1. I have built android projects for both 2.2 and 4.2 and it works fine. I have also downloaded the android ODATA mobile sdk, installed the ne NW gateway plugin and configured it successfully. Using the wizard I created the screens also for the flight successfully but when I finally clicked the finish button, it gave an error (Project has no project.properties file! Edit the project properties to set one). My android sdk path does not have any space between them.

    Then what can be the issue??. Kindly help me out. I am unable to resolve this issue.

    thanks and regards,

    umapathy.

    (0) 
  28. Nirav Shah

    Hi ,

    I have setup all for Android as suggested in this article.

    Even I am able to go through “Proxy Generation”, and this is working fine. But facing problem with “Starter Application Project” . While going through wizard, I am having error while pressing “Finish” button at last.

    Error :

    Template Generation Wizard Error

    Reason:

    Errors occurred during the build.

    Can anybody please help me.

    (0) 
    1. Michal Keidar

      Hi,

      Is there more information in the error log? like an exception perhaps?

      Are you using the tool from this blog, or using our new product, that Gal has mentioned in a comment above?

      Thanks,

      Michal.

      (0) 
  29. Daniel Myśliński

    Hi,

    I’m trying to create an application based on SAP Workflow. I was using tutorial from the link below.

    http://scn.sap.com/community/netweaver-gateway/blog/2013/06/12/how-to-create-sap-workflow-based-android-application-consuming-odata-workflow-service-with-help-of-gateway-productivity-accelerator-gwpa

    Everything was going smooth till I uploaded my app to emulator. when i try to logon logcat in eclipse returns the following error:

    01-08 13:56:52.539: E/Connectivity(758): Delta handling is disabled. Please add Persistence & Cache libraries to enable it.

    Both libraries are included in the project. Do you have any idea what could I do wrong?

    Best regards,

    Daniel Myslinski

    (0) 
  30. Vijay Chanchlani

    Hi Gal, Michal,

    Excellent write-up.

    We are creating a POC for one of our customers to Expose SAP Inbox and following your blogs I was able to do that…well almost.

    I have done all the configuration steps that you had mentioned in the Backend and I am able to access the WFSERVICE url on the browser by providing my credentials.

    Then I created an Android application like you mentioned(for 3.1 version) by consuming the URL

    in eclipse. Initially it gave me SSL issues, but then I uploaded the backend system certificate in JRE using keytool and was able to consume the service and create the project. So far, so good.

    Now when I try to run the application on Android virtual device, it says “login failed” for the same credentials that work on browser.

    In the logs, it again says some SSL certificate issue.

    Could you please help me on this as this looks like the last hurdle now.

    Regards,

    Vijay.

    (0) 
    1. Carlos Roggan

      Hi Vijay,

      have you tried adding your certificate to the app?

      Check the generated RequestHandler class.

      There’s a comment
      * ****** TODO: If using SSL add the server certificate to res/raw

      it says what you have to do:

      copy the certificate to the raw folder of the Android app

      then specify the name of the certificate in the code

      and uncomment the line.

      Kind Regards,

      Carlos

      (0) 
  31. Vijay Chanchlani

    Thanks Carlos for your response.

    Could you please provide me a bit more detail on this.

    This is the comment :

    * ****** TODO: If using SSL add the server certificate to res/raw folder and uncomment the line below

    * to pass the resource id.

    * ******

                 */

    //        certid = new int[]{R.raw.sslcert};

    //        this.proxyData = new ProxyData();

    // this.proxyData.setHost(“hostName”); 

    // this.proxyData.setPort(portNumber);

    // this.proxyData.setBypassProxy(“BypassProxy”);

    I am trying to consume the WFService hosted on ECC XCB system.

    As you told, I added the .cer XCB certificate to the res/raw folder.

    What should I be filling in rest of the commented code?

    Could you please provide some more help on this.

    Regards,

    Vijay.

    (0) 
    1. Carlos Roggan

      Hi Vijay,

      only the certid line is required to be adapted and uncommented:

      certid = new int[]{R.raw.yourxcbCertificate.cer};

      The other commented lines have to be adapted only if you use a proxy

      E.g. if your mobile phone uses comany network and needs to consume a service that is in the world wide web.

      So probably you can ignore the other commented lines.

      Kind Regards,

      Carlos

      (0) 
      1. Vijay Chanchlani

        Hi Carlos,

        I have inserted this line in the code.

        certid = new int[]{R.raw.xcb};


        Still, when the application launches on the AVD and I login using my system credentials, it says login has failed.


        Any other suggestions!

        Appreciate your help.

        Regards,

        Vijay.


        (0) 

Leave a Reply