4 Replies Latest reply: Jan 23, 2014 4:29 PM by Winnie.Hu-Oracle RSS

    Creating the Application User dynamically on the device


      Hi Oracle Team .


      As an issues raised in the


      Can we create a new user using Java API?


      Here is a business work flow for the next version of the App. It requires us to be able to create DMS users from the Mobile device side.


      1. A bunch of field volunteers will visit households and collect basic profiles of individuals that they meet (Name, Gender, Age, Photo, Contact Info).

      2. We want to set this up such that the field volunteers download an app from Google Play Store. When they install the app on their mobile device, it hits our DMS (target URL etc hidden in the App).

      3. We would like to Create a User on the DMS side to help establish a Session. The user will occasionally Sync data back to our database through DMS.


      I was able to create uses from the java code .



               boolean test=ResourceManager.createUser("Spurthi", "test",  "Spurthik", "U");




               System.out.println("tets= "+test);


      This java code creates the user if I run the code as Java App , My requirement is I should create users from an Android App and Give them access to the Applicaions.

      I am trying the same code on Android App with all libraries imported , The App Crashes every time when it reaches Function present in Oracle Supported jar files ( like ConsolidatorManager, ResourceManager) etc .


      My few quires which need clarity are :


      1. Is it possible to create users on Android Device and provide access to Applications ?

      2. Does all the jars are Android Compatible  ? ( Dalvik virtual machine)

      3. Any samples which can help us to refer ? 


      Thanks ,


        • 1. Re: Creating the Application User dynamically on the device

          Hi Spurthi,


          No, Mobile Server jar files, which include implementation for classes like ConsolidatorManager, ResourceManager, etc are not Android compatible. And, if you want to create mobile user id on Android device, you have to connect to Oracle Database, which means, the Oracle JDBC Driver has to run on Android device too, anyhow, as of now, Oracle doesn't have a Android compatible JDBC Driver either.


          Regarding your scenario, the realistic model of using DMS (Oracle Database Mobile Server) is that, the customer create a bunch of mobile user ids in repository in advance, the user ids can be created via two approaches:

          1) login mobile manager UI interface with administrator's priliges, and create user id manually;

          2) create a Java program calling Consolidator APIs (refer to Mobile Server's Development Guide) to create users per to provisioned user names, and the Java program can run on any platform where Oracle Java SDK is supported.


          Then assign the mobile user ids to the field workers, one id per worker. Then on the device, the worker downloads the Android application from App Store, the Android application embeds the Sync functions, the worker launches the data synchronization providing the mobile user id/password/mobile server url.


          Winnie Hu

          Oracle Database Mobile Server Development

          winnie.hu at oracle dot com

          • 2. Re: Creating the Application User dynamically on the device

            Hi Winnie ,


            Thanks for the reply ,


            I think you understood our exact requirements . So We will drop our Android User creation Idea .


            Both the approaches you mentioned wont help us , as per our requirement we just need one way sync ( device to server only ) . We thought user creation is one of the way which could help us .


            We are currently focusing on another method Creating Data Collection Queues for Uploading Client Collected Data

              Through the documents we understood this method will very well work for our requirements .


            The procedure we followed is : 


              Consolidator.PubItemProps cp = new Consolidator.PubItemProps();

                     try {

                         cp.owner = CONS_SCHEMA;

                         cp.store = "TBL_MEMBER_CONTACT";

                         cp.refresh_mode = "F";


                         cp.cbk_owner = "MOBILEADMIN";

                         cp.isLogBased = false;



                         cm.createPublicationItem("T_WEDENSDAY_CONATCT_TEST", cp);

                         cm.createDataCollectionQueue("T_WEDENSDAY_CONATCT_TEST", CONS_SCHEMA, "QUEUE_BASED_TABLE", null, null, false, true);


                     catch (Exception e) {




                     cm.addPublicationItem("T_WEDENSDAY", "T_WEDENSDAY_CONATCT_TEST", null, null, "S", null, null);



            We are stuck by method


            as the function is quite abstract and parameters are quite unclear .


            Please let us know this method works for our requirement . Do we have to write any script other than this ? Please clarify ,


            Thanks ,


            • 3. Re: Creating the Application User dynamically on the device

              Hi ,


              Here is another thread with same issues DataCollectionQueue



              Thanks ,


              • 4. Re: Creating the Application User dynamically on the device

                Hi Spurthi,


                I'd like to add a proposed solution regarding the topic of this thread, creating DMS user dynamically on the device.

                - One possible solution is to create Web service architecture, user accesses the web service via a browser on the device, the web service running in the back-end web server calls DMS jar files and create real DMS user in the repository.


                I'll reply your questions regarding DataCollectionQueue in this post DataCollectionQueue .