This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Android and the fly likes Need suggestion for mobile app architecture Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Need suggestion for mobile app architecture" Watch "Need suggestion for mobile app architecture" New topic
Author

Need suggestion for mobile app architecture

lavnish lalchandani
Ranch Hand

Joined: Feb 28, 2007
Posts: 79
Hi

I have never written a mobile app , planning to write one now. Need advice on architecture of same.

Let me first brief on the functionality :

  • Its a kind of "General Knowledge Ques & Ans" application.
  • There will be different categories & in each category there will be different questions.
  • User can scroll through all questions in a category (using Next or Back button) ,
  • For each question there is a "show answer" button , after user has thought of answer can check the same using the button.


  • something like https://play.google.com/store/apps/details?id=com.programmerworld.HRInterviewQuestionsLite&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5wcm9ncmFtbWVyd29ybGQuSFJJbnRlcnZpZXdRdWVzdGlvbnNMaXRlIl0.

    Other features
  • should work on all platforms (androids , ios , windows mobile , etc ) hence planning to use phonegap
  • The list of Q&A should be up-datable , like i can give updates having totally new Q&A , or better ans to old questions , or new categories etc
  • The Q&A should be non copyable , like if someone installs the app on his mobile , he should not be able to copy the Q&A list
  • The Q&A list should be stored securely on the mobile
  • allow users to bookmark some ques and later go through only the bookmarked lists
  • should allow users to browse through Q&A in offline mode


  • Planning to use PhoneGap for it. What i am not sure is how to "best" store the Q&A Data securely and efficiently so that my app is not very heavy also ???

    I am aware of two options

    1) Android SQLLite .. if i use this i am sure its secure , and easily updatable BUT i am not sure what to do for iOS and other operating system ? is there a cross platform SQL engine ? wont this be heavy ? i mean every user who wants to use my app would need to install this as well

    2) cant i store the Q&A as encrypted xml files ?? this way it should be easily updatable and what algo should i use for encryption ? will it be safe enough ?? any cross platform library implementing encryption algorithm ?

    3) any other suggestions by experts out there ??

    lavnish.blogspot.com
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 42371
        
      64
    #1) SQLLite is build into Android, so the user does not have to install anything, and it also won't add to the app size. Other mobile OSes likely have similar functionality, but you'd need to check the PhoneGap/Cordova docs to see how well those are supported in a cross-platform manner.

    #2) Sure it's possible. AES is a standard encryption algorithm, but I'd expect this to be an area not well abstracted away by PhoneGap. Personally, I think it'd be rather more work to implement than a DB -based approach, though, especially for updating.

    So my advice would be: start by checking out what PhoneGap supports on all the platforms you care about, and then weigh the advantages and drawbacks of the approaches that are possible through it.


    Ping & DNS - my free Android networking tools app
    chetan dhumane
    Ranch Hand

    Joined: Jan 07, 2009
    Posts: 629

    Refer this page : http://stackoverflow.com/questions/6523670/looking-for-cross-platform-mobile-database-options


    http://www.androcid.com/
    lavnish lalchandani
    Ranch Hand

    Joined: Feb 28, 2007
    Posts: 79
    Thanks for the reply chetan & Ulf
    @ Ulf
    so what you are saying if i buy a new Android / iOS phone then it has SQLLite installed on it be default ? to extend this further if i want to use DB for this task then its just a matter of making a new Schema in existing DB server on the mobile ??

    can you point me to more docs , i want to check on different devices ( even ones less memory like 2GB) do they have SQL lite or not
    Steve Luke
    Bartender

    Joined: Jan 28, 2003
    Posts: 4181
        
      21

    lavnish lalchandani wrote:Thanks for the reply chetan & Ulf
    @ Ulf
    so what you are saying if i buy a new Android / iOS phone then it has SQLLite installed on it be default ? to extend this further if i want to use DB for this task then its just a matter of making a new Schema in existing DB server on the mobile ??

    can you point me to more docs , i want to check on different devices ( even ones less memory like 2GB) do they have SQL lite or not

    For Android: yes, SQLLite comes with the OS. See This part of the Reference docs and this part of the API.

    You will have to check PhoneGap docs to see if they support it though.


    Steve
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 42371
        
      64
    All Android versions have SQLLite built in: http://developer.android.com/guide/topics/data/data-storage.html#db. And if I search for "database in ios", the first result I get is https://developer.apple.com/technologies/ios/data-management.html. So it would seem that iOS is covered as well. I'll leave it to you to do similar searches for other mobile platforms.
    lavnish lalchandani
    Ranch Hand

    Joined: Feb 28, 2007
    Posts: 79
    thanks for the help guys
    found these links
  • http://en.wikipedia.org/wiki/SQLite#Operating_systems
  • http://en.wikipedia.org/wiki/Mobile_database ( clearly says Many applications require the ability to download information from an information repository and operate on this information even when out of range or disconnected. )
  • https://gist.github.com/edwardtoday/2204864
  • https://github.com/davibe/Phonegap-SQLitePlugin


  • I guess this is the better approach will try some POC
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Need suggestion for mobile app architecture