Note: I have shared screen shots of these steps in a zip file at the bottom of this blog. File names of the screen shot are in parentheses in the discussion below
Step 1: Install Oracle Mobile Development Kit
Launch Oracle Installer and choose to install Mobile Development Kit. I believe Oracle does not support this installation on the same machine as the Mobile Server. I installed Oracle Mobile Development Kit on Windows XP in a VM using default options.
Step 2: Install Eclipse, Android SDK
Step 1: Install Oracle Mobile Development Kit
Launch Oracle Installer and choose to install Mobile Development Kit. I believe Oracle does not support this installation on the same machine as the Mobile Server. I installed Oracle Mobile Development Kit on Windows XP in a VM using default options.
Step 2: Install Eclipse, Android SDK
- Install Eclipse, Android SDK
- Use Android SDK Manager to install Android 2.3.3 (I recommend using this for now since it is widely used)
- Launch Eclipse
- Import simple_sync_android application (File-> Import)
- Choose the option Import Existing Projects into Workspace
- Ensure that MOBILE_SYNC_ANDROID_LIB is configured properly (Project Properties -> Java Build Path). In my case, I set it to C:/OraHome_1/Mobile/Sdk/android/lib/osync_android.jar
- Create an Android Virtual Device (Window->AVD Manager)
- Set default Build Target to Android 2.3.3 (Project Properties, choose Android and check the default target)
- Build and run the application in the Android Emulator (Run-> Run As)
- You should see the Mobile Sync application in your Android Emulator. If you get a ClassNotFoundException, or Force Close, see below
- If you were able to build the Mobile Sync application successfully and it shows up in the Emulator, then attach your Android device to the PC with USB port.
- Ensure that USB driver is installed
- Install the application onto device Run As-> with the device connected. You should see the Mobile Sync application on the device (Sync1.png)
Caution: Do not log in to Mobile Server as yet - Launch Mobile Sync application and configure the setting DATA_DIRECTORY. Click the Menu button to see options to Edit OSE.INI, View Error log etc.(Sync2.png)
- Edit the OSE.INI file. You should see no entries in OSE.INI as yet (Sync3.png)
Add an entry similar to: SQLITE.DATA_DIRECTORY=/sdcard/net.adkoli.dbtest
and click Save.
In the entry above, /sdcard is the directory for external storage (also called SD card). The rest of the entry "net.adkoli.dbtest" matches the name of my mobile application created in Titanium. More on this later.
- Now enter User credentials and Server URL. In my example, I had created a user AA (Sync4.png)
- Click Sync. After a few seconds, you should see message "Sync finished successfully" (Sync5.png)
Step 5: Sanity Check
- Use adb to check if the directory structures expected are created. You should see a directory with username appended to it. So, in my example, you would see a directory such as /sdcard/net.adkoli.dbtest/AA.
My Experience
I had a difficult time building the simple_sync_android project out of the box. I kept getting an application Force Close and ClassNotFoundException. I had to do the following to workaround this:
- In Eclipse, go to Project Properties
- Choose Java Build Path
- Click Order and Export tab
- Move "MOBILE_SYNC_ANDROID_LIB" entry Up until it is just below the /simple/sync_android/src entry
- Now rebuild and this worked for me
I also was not able to get Mobile Sync to Save the password when I chose the option to do so (checkbox Save Password). The password is somehow saved incorrectly and I kept getting "USER_INVALID" error (Sync7.png). I suspect that the Sync client is encrypting the password provided and then using the mangled version of the password without decrypting again.
Screen Shots
I have made available screenshots to help you follow this blog. Please download zip file and extract it. The names of the files referenced are in parentheses.
i would say you did a greate job thanks; but i would say about the order tab that the real reason was the checkbox :) on it was checked when ordering
ReplyDeleteMy apologies for the long delay. I have been traveling. I will provide these screen shots over the next day or two.
ReplyDeleteHi Double,
ReplyDeleteHave you developed any ADF mobile application using Sync feature.If yes Please tel me some quick steps or any sample with you please share me.
Regards
Siva
Looking for that too.
DeleteDid you found any proper documentation?
thx
Hi Siva ,
ReplyDeleteThis sync app works for Application which has publications and publications items created by Mobile Database workbench or by java code . From my understanding ADF and explained sync app works differently . More about ADF in http://docs.oracle.com/cd/E18941_01/tutorials/buildmobileappscontent/adfmobiletutorial_1.html
no zip file?
ReplyDeletehttps://dl.dropboxusercontent.com/u/1567581/Sync.zip
Not Found
The resource could not be found.
WSGI Server