Skip to main content
長崎ちゃんぽん
Participating Frequently
September 19, 2017
Question

How to detect the first boot on an Android device

  • September 19, 2017
  • 0 replies
  • 1247 views

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.   

This topic has been closed for replies.