on 07-10-2012 5:48 PM
Hi,
I developed one android app using sup 2.1.3 . I tried to do an operation from the device by making the device offline.
Then I got an error on mobilink. I heard like operations can be done even the app is offline and once the app comes online
it will be synced.
Following is the operation code :
header = new Header();
header.approveOperation(ponumber,relCode);
header.submitPending();
ApprovalDB.synchronize();
header.save();
Is it possible to do operation or we need to check whether internet is available before operation to restrict it ?
Regards,
Midhun
Yes.. You can do the operation as well offline.. But
ApprovalDB.synchronize(); requires the device to be online..
That means, ApprovalDB.synchronize(); it actually connects to the network and synchronizes with the CDB..
So you should do the following code when the device is offline..
header = new Header();
header.approveOperation(ponumber,relCode);
header.submitPending();
header.save();
The following code can only be executed when the device is online..
ApprovalDB.synchronize();
Please add reward points if helpful..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. Ideal Way:
you can use Broadcast Receivers for this purpose...
So whenever the device is connected to the network, you can start the sync by calling synchronize() method...
2. Otherway around:
You can provide the explicit button in the UI which will trigger the sync.. Here when the user taps on the button, you can check the network and start the sync according to the availability of the network..
Hi Raja,
I did the following code and I tried without internet connection but after taking a long time for the process it shown the following message
com.ianywhere.ultrlitejni12.implementation.jniexception:Ultralitej Error"mobillink communicationerror code:63
Can solve this please.
Regards
Midhun
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.