SUP 2.1.2 Native Android Application Development… Things to note
I hope all you developers are getting your hand dirty with building native mobile apps on various platforms with SUP..
I started building my first native app on Android.
I would like to share my first experience of building Android Native App with SUP2.1.2 here in this blog post…
1. Background Sync:
We all are familiar using the mail application in our mobiles.. When we compose a new mail and clicks the send button, Sync will happen in the secondary thread and still we will be able to compose further new mails, check out our inbox, etc..
I thought of doing the same in my app in which when a user creates a PO, immediately I started the Sync in the secondary thread using Service API of Android.
But the problem here I faced is, I had to read the data from MBOs when the Sync happens at background, so that I would still be able to allow the user to use the app, which didn’t happen.
the problem is that when the Sync happens, actual tables that would have got created for our MBOs will be locked.. We won’t be able to read anything out of the MBOs when the Sync happens.. Sometimes you will be able to read the data but after couple of times, your DB will get corrupted and further Sync requests will get failed with error…
So Finally I changed the design in such a way that when the Sync starts, the progress bar will appear in the app and the users are not allowed to do any operations on the app until the Sync finishes.
I thought of sharing this because this will save some time for you developers when got into the same issue..
Thanks.. Will see you in the next post.