Android Question Database is not creating on mobile device.Is some setting/permission required.

Discussion in 'Android Questions' started by Juzer Hussain, Aug 13, 2015.

  1. Juzer Hussain

    Juzer Hussain Active Member Licensed User

    If File.Exists(File.DirInternal, "gulf.db") = False Then
    ProgressDialogShow("New User Found, Importing Data, Please Wait........")
    Sql2.Initialize(File.DirInternal, "gulf.db", True)
    'and create it
    CreateDataBase

    'and copy data from Server
    DownLoadData
    end if

    Pls guide me.
     
  2. edgar_ortiz

    edgar_ortiz Active Member Licensed User

    Hey Juzer,
    IF :
    If File.Exists(File.DirInternal, "gulf.db") = False

    That's mean that NOT exists "gulf.db" and you CAN'T "Sql2.Initialize(File.DirInternal, "gulf.db", True)" because "gulf.db" does not exists.

    I "figure" what you want to do... You can try:
    - Include in your project a "gulf.jpg"
    - If File.Exists(File.DirInternal, "gulf.db") = False THEN Copy "gulf.jpg" to "gulf.db"

    Regards,

    Edgar
     
  3. mangojack

    mangojack Well-Known Member Licensed User

    Code:
    Sql2.Initialize(File.DirInternal, "gulf.db"True)
    Does not the paramater "True" mean .. create database file if it does not exist .. ?

    Why .jpg .. ? Why not include gulf.db and then copy to Dir.Internal if not exists ..?
     
    Last edited: Aug 13, 2015
  4. Juzer Hussain

    Juzer Hussain Active Member Licensed User

    Hi edgar_ortiz and mango jack,

    Thanks for your replies.It seems like the db is getting created but the data is not downloading.Can you think of any reason.

    Juzer
     
  5. Juzer Hussain

    Juzer Hussain Active Member Licensed User

    It shows "New user found......" waits for few seconds but does not copy data from server.
    DB is empty.
    It is downloading data in emulator.Is there any consideration in mobile Device like permission to be set etc.

    Pls guide me.
     
  6. DonManfred

    DonManfred Expert Licensed User

    upload a small project which shows the problem. I´m sure the problem is in your code.
     
  7. Juzer Hussain

    Juzer Hussain Active Member Licensed User

    Its ok now. Actually HttpJob takes time finishing and while it is still running program execution moves to next statement.Later when HttpJob has finished code will execute again from next statement onwards.I removed functions which called HttpJob(DownLoadData) and put them sequentially in main function it solved the problem.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice