Results 1 to 4 of 4

Thread: how to know if app was re-installed on Android

  1. #1
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default how to know if app was re-installed on Android

    Hi all

    I need to know during application start-up if application was re-installed.
    Why? After each installation, during first start application needs to send and download some data from server, it saves this data in application directory, in some conf file. But when I simply re-install application from the same .pkg file all application data is preserved so during first start app doesn't know that it was re-installed.
    I was trying some tricks:
    1. Deploy empty conf file with application, so it overwrites old config, but no luck with that, it seems that read-only assets are only option if you need to ship file with application on Android.
    2. I was checking created() lastRead() and lastModified() dates on main lib file located in /lib directory of my application, but created() is always date when pkg was created, and lastRead() seems to be not updated by Android system during application start
    3. I was trying to modify some permissions on main lib file, like add some permissions, or change, and then when application was re-installed premissions should revert to default, but I was getting always false from QFile::setPermissions() on this main lib file, changing this file permissions is not allowed?

    I'm using Qt 4.8.2, anyone knows any other tricks? I know that I can clear application cache on Android, but I need this to happen without user intervention, automagically.

    best regards
    Marek

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to know if app was re-installed on Android

    Hi, without tricks:
    if your data does not exist, it was a first-time installation, otherwise your app has been re-installed.

    Ginsengelf

  3. #3
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to know if app was re-installed on Android

    HI,

    first off all, sorry for the delay.

    Maybe I wasn't accurate enough.
    It doesn't matter if data of my application exists or not.
    I need to connect to server during first-time installation as well as during re-installation, so checking if data exists is not an option.
    Any other ideas?

    Marek

  4. #4
    Join Date
    Sep 2013
    Posts
    1
    Qt products
    Qt/Embedded
    Platforms
    Android

    Default Re: how to know if app was re-installed on Android

    From my point of view :-

    1 - If the application is already installed in the device the application is open automatically.

    2 - Otherwise install the particular application.

Similar Threads

  1. Replies: 3
    Last Post: 22nd February 2013, 13:05
  2. QML/Android
    By Viper666 in forum Qt Quick
    Replies: 11
    Last Post: 18th January 2013, 15:13
  3. Android
    By Viper666 in forum Qt Programming
    Replies: 9
    Last Post: 3rd January 2013, 13:45
  4. Qt in Android Possible?
    By Prabha in forum Installation and Deployment
    Replies: 5
    Last Post: 11th May 2011, 08:11
  5. qt on android
    By carlovv81 in forum General Discussion
    Replies: 3
    Last Post: 1st February 2011, 12:42

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.