Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to detect the first boot on an Android device

Community Beginner ,
Sep 18, 2017 Sep 18, 2017

I'm searching for how to find the first boot of the application.

At first I checked the existence of shared object like this below.

----------------------------------------------------------

var mySharedObj:SharedObject = SharedObject.getLocal("SO");

if(mySharedObj.data.AAA == undefined || mySharedObj.data.AAA == null){

trace("First Boot");

mySharedObj.data.AAA = "test";

}else{

trace("Not First Boot");

}

----------------------------------------------------------

This script worked within the debugging on the MS Windows.

But once I installed it to the Android device, there appears a problem.

In the very first installation, it detect the first boot.

After that, I uninstall the app, and re-install the app.(i.e.the second installation)

On the first boot of the second installation, it detect the existence of the shared object despite my expectation.

I think this is due to the cache on the Android device.

It seems difficult to clear cache at the point of installation / uninstallation.

So I'd just like to know the approach to detect the FIRST BOOT, even though it is the second installation.

Regards.   

1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation