cancel
Showing results for 
Search instead for 
Did you mean: 

Android registering app issue

rhightower13
Participant
0 Kudos

I have a native Android app.  The app registered with server successfully.  The status of the Application Connection in the SCC is online and shows the correct application.  So far so good but I have two issues:

1) The app attempts to register every time it runs.  It eventually connects successfully but this code:

if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED) {

    Log.d(TAG, "registering app");

    app.registerApplication();

                              } else {

    Log.d(TAG, "connecting app");

    app.startConnection();

                              }

never goes to the else.

2) The second issue is that the code MyAppDB.synchronize(); causes the error "Application settings are not available."  That would suggest it isn't connected but, as I said, it appears to be online in the SCC.

Any help would be appreciated.

Rlss

Accepted Solutions (1)

Accepted Solutions (1)

midhun_vp
Active Contributor
0 Kudos

1. Yes each time it will check whether the app is registered or not. If is not registered it will register the app else it will connect the app. If you are testing the app in the simulator the id of the device changes each time when you re install and test the app, in that case the control never go to else loop. Test in a real device then you will get the expected result.

Code is here:


if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED) {







app.registerApplication(600);





} else {






app.startConnection(600);





}

2. Before calling synchronize() you need to set some mandatory fields of SynchronizationProfile. Are you setting that? If not download the sample project from the below provided link and try. it will work.

Download sample android project from here

- Midhun VP

Answers (2)

Answers (2)

rhightower13
Participant
0 Kudos

I'm afraid this one will remain a mystery.  I'm using a device so the simulator wasn't the problem.  I deleted the application connection and created a new one and now it's working.

Thanks for the replies. I never knew that about simulators.

Ross

DoanManhQuynh
Active Contributor
0 Kudos

I think you should check the code if you unregisterApplication somewhere....it may be the reason .

DoanManhQuynh
Active Contributor
0 Kudos

1. Did you test with your simulator or real device? If u use simulator I think u have to save simulator state then next time go to clause if...els, it goes to else ( you can see in SCC each time u run it will register a difference application ID)

2. This error because of we were setting wrong application info. I think this error could be solve when u finish error 1.

rhightower13
Participant
0 Kudos

I spoke too soon.  The errors occur when I create an application connection.  The status is online but the error "Application settings are not available." occurs when I try to sync.

The app works if I create a user login under security->admin.

Ross

midhun_vp
Active Contributor
0 Kudos

Can you create issue in detail please.

Are you getting an issue when you are trying to sync with manually created user in SCC?

And you are able to sync when you are registering with admin as the user. Is it?

The sync using the user "admin" is meant for test environment. in the production environment LDAP is must. In the case of LDAP the issue that I mentioned will be solved.

-Midhun VP