cancel
Showing results for 
Search instead for 
Did you mean: 

Could not register & sync the Native Application for Android with SUP 2.1.2

Former Member
0 Kudos

Hi,

My expectation is to build a Object API native application for Android with SAP integration.

I am having troubles during the registration of the Application and Synchronization with the new API that SUP provides from 2.1.2 namely app.registerApplication() and synchronize()

I tried getting the Sample code working for Android which is available from the tutorial, but still that also doesn't work.

Could anyone provide me the exact steps on how i should register the application with the Application ID and get the synchronization done successfully with the new API's provided by SUP.

Thanks in advance!!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I have the same problem, has anyone solved this problem ?

Thanks

Former Member
0 Kudos

I have managed to solve it, after doing a bit of research what I have found is Android uses a combination of both MBS and RBS, typically for application registration it uses MBS and for synchronization it uses RBS.

What exactly you have to do is, while registration set the connection profiles port number to 5001 and once the registration is successfull, you can change the sync profiles port number to 2480

Is that answers any ones problem here?

rakshit_doshi
Active Contributor
0 Kudos

Hi Srinivas,

It didnt answer actually.. I didnt get how u define two ports..Can you please post your code snippet for reference

Former Member
0 Kudos

Hi Rakshit,

Though I am bieng able to find some success by just directly connecting to SUP and by changing the ports at run time, (but not yet through a relay server I am yet facing the porblem ) typically what you have to do is, while doing a registration

 

ConnectionProperties connProps = app.getConnectionProperties();

//connProps, has a setters for setting the port number while doing registration it has to be 5001

then when are trying to do a synchronization 😆

ConnectionProfile cp = SUP101DB.getSynchronizationProfile();

again reset the all the setters available, and here set the port number to 2480 RBS

Is that answers your question upto an extent ?

Regards,

Srinivas Divakarla

rakshit_doshi
Active Contributor
0 Kudos

Hi Srinivas,

I got a little of it..Your whole code snippet would prove very helpful..

rakshit_doshi
Active Contributor
0 Kudos

Srinivas what does this error mean

Error: 558 Message: Error: 558 Message: 'Could not connect to server. Verify Relay Server URL Template'

Have you ever encountered such a message?

Former Member
0 Kudos
Hi Rakshit,
Open the file SUP101SampleActivity.java
check the 'initializeApplication'. Just above the line,
" ConnectionProperties connProps = app.getConnectionProperties();"
there are three lines as below:
                   SUP101DB.registerCallbackHandler(new CustomerDBCallback());
                   SUP101DB.setApplication(app);
                   SUP101DB.getSynchronizationProfile().setServerName(HOST);
Cut these three lines and paste it below these lines:
if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED)
                    {
                        app.registerApplication(TIMEOUT);
                    }
else
                    {
                        app.startConnection(TIMEOUT);
                      }
Also, in file SUP101DB.java, in the initialize method, please set the servername:
initProfile.setServerName("")
Once you have made these changes, we are basically are setting the connectionproperties first and later synchronizing.
Hope the above helps.
Regards,
Apeksha Desai
rakshit_doshi
Active Contributor
0 Kudos

Hi Apeksha,

Thanks for the help..I will try with this. One more thing to ask.. Have you ever worked with a sybase hosted relay server. Can you guide me through the connection steps if you have any..I tried to connect to the SUP Server using sybase hosted relay server but am not able to

Former Member
0 Kudos

Hi Rakshit,

I did get, and I solved that, later

Could you provide the stack trace?... of the exception, that will help a bit for me,.

Regards,

Srinivas Divakarla

rakshit_doshi
Active Contributor
0 Kudos

Hi Srinivas,

I was connecting using the sybase hosted relay server..Please see the error log and kindly help

04-28 14:50:17.407: E/AndroidRuntime(606): FATAL EXCEPTION: main

04-28 14:50:17.407: E/AndroidRuntime(606): com.sybase.mobile.ApplicationRuntimeException: Could not connect to server. Verify Relay Server URL Template

04-28 14:50:17.407: E/AndroidRuntime(606):     at com.sybase.mobile.Application.registerApplication(Application.java:379)

04-28 14:50:17.407: E/AndroidRuntime(606):     at com.prisminfoglobal.vistaland.MainActivity.initializeApplication(MainActivity.java:125)

04-28 14:50:17.407: E/AndroidRuntime(606):     at com.prisminfoglobal.vistaland.MainActivity.access$2(MainActivity.java:87)

04-28 14:50:17.407: E/AndroidRuntime(606):     at com.prisminfoglobal.vistaland.MainActivity$1.onClick(MainActivity.java:69)

04-28 14:50:17.407: E/AndroidRuntime(606):     at android.view.View.performClick(View.java:3511)

04-28 14:50:17.407: E/AndroidRuntime(606):     at android.view.View$PerformClick.run(View.java:14105)

04-28 14:50:17.407: E/AndroidRuntime(606):     at android.os.Handler.handleCallback(Handler.java:605)

04-28 14:50:17.407: E/AndroidRuntime(606):     at android.os.Handler.dispatchMessage(Handler.java:92)

04-28 14:50:17.407: E/AndroidRuntime(606):     at android.os.Looper.loop(Looper.java:137)

04-28 14:50:17.407: E/AndroidRuntime(606):     at android.app.ActivityThread.main(ActivityThread.java:4424)

04-28 14:50:17.407: E/AndroidRuntime(606):     at java.lang.reflect.Method.invokeNative(Native Method)

04-28 14:50:17.407: E/AndroidRuntime(606):     at java.lang.reflect.Method.invoke(Method.java:511)

04-28 14:50:17.407: E/AndroidRuntime(606):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)

04-28 14:50:17.407: E/AndroidRuntime(606):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)

04-28 14:50:17.407: E/AndroidRuntime(606):     at dalvik.system.NativeStart.main(Native Method)

Former Member
0 Kudos

Looking at the stack trace, what I can see is your application is failing during the registration, as you have mentioned that you are using sybase hosted relay server, your farmID has to be MBS

Former Member
0 Kudos

Hi Rakshit,

Could you create a new discussion for this

Regards,

Srinivas Divakarla

rakshit_doshi
Active Contributor
0 Kudos

Hi Srinivas..Find the thread..Also paste your code snippet on how did you register your application and how did you solve the Connection to the Server Failed problem

http://scn.sap.com/thread/3168464

rakshit_doshi
Active Contributor
0 Kudos

Yes My device is not getting registered and using the Sybase hosted Relay Server i have created a MBS Farm. The problem i face is sometimes it connects perfectly fine(Mostly during the first launch of the App) On consecutive attempts it shows this error. Kindly help with the solution you worked out

Former Member
0 Kudos

Hi Srinivas,

I am having issues only with the synchronize part.The connection is working fine.My application goes online but during the synchronize call it always gives an exception.I dont use a relay server just the intranet. I am not sure what is the reason behind this.Can you let me know why the synchronize might fail.

SUP101 is working well.The problem is I am unable do the same for SAP BAPI bound MBOS.

Thanks

rakshit_doshi
Active Contributor
0 Kudos

Hi Vighneswaran,

Can you please post what error you are receiving to make it easier for us to debug and let you know wats wrong.

Former Member
0 Kudos

Hi Vighneswaran,

Please post a new question, in order to avoid confusion

Srinivas Divakarla

Former Member
0 Kudos

Hi,

Even i am also gettting same problem for native Android app with SUP 2.1.1, but in my case device is registering and getting error in synchronize().

could anyone help me to get synchronization successfully.

Thanks

Former Member
0 Kudos

I have followed the same steps as mentioned in the Developer Guide, but i am unable to register the user. I am stuck at the very first step.

Could you plz share the code snippet with which it was possible to register?

Also,can you let me know how to pass the User Id created in SCC?

Thanks!!