I have a project in which it reads if it is the first time the application is started, I do it through sharedpreference:
Main:
//Primer inicio
boolean muestra = getValuePreferencePrimerInicio(getApplicationContext());
if (muestra) {
saveValuePreferencePrimerInicio(getApplicationContext(), false);
setPreferenceInt(getApplicationContext(),6,"puntos");
}
Method getValuePreferencePrimerInicio:
public boolean getValuePreferencePrimerInicio(Context context) {
SharedPreferences preferences = context.getSharedPreferences(PREFS_KEY, MODE_PRIVATE);
return preferences.getBoolean("primerInicio", true);
}
Method saveValuePreferencePrimerInicio:
public void saveValuePreferencePrimerInicio(Context context, Boolean mostrar) {
SharedPreferences settings = context.getSharedPreferences(PREFS_KEY, MODE_PRIVATE);
SharedPreferences.Editor editor;
editor = settings.edit();
editor.putBoolean("primerInicio", mostrar);
editor.commit();
}
I do it to be able to add "points" to the user for the first start, but it is as if it did not run and it does not, or as if there were data from having it installed before, I uninstall it and reinstalls it through the debug . It worked perfectly as it is, but at some point it stopped and in the run this appears:
07/16 09:34:01: Launching 'app' on HUAWEI MAR-LX3A.
Connected to process 11939 on device 'huawei-mar_lx3a-A4N4C19813000332'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.example.parlerfrench#10323#256
I/HwApiCacheMangerEx: apicache path=/storage/0403-0201 state=mounted key=com.example.parlerfrench#10323#256
I/le.parlerfrenc: QarthPatchMonintor::Init
QarthPatchMonintor::StartWatch
QarthPatchMonintor::WatchPackage: /data/hotpatch/fwkhotpatch/
QarthPatchMonintor::CheckAndWatchPatch: /data/hotpatch/fwkhotpatch/com.example.parlerfrench
I/le.parlerfrenc: QarthPatchMonintor::CheckAndWatchPatch: /data/hotpatch/fwkhotpatch/all
QarthPatchMonintor::Run
I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.example.parlerfrench#10323#0
apicache path=/storage/0403-0201 state=mounted key=com.example.parlerfrench#10323#0
I/le.parlerfrenc: QarthPatchMonintor::Reading
QarthPatchMonintor::CheckNotifyEvent
QarthPatchMonintor::CheckNotifyEvent before read
I/AwareBitmapCacher: init processName:com.example.parlerfrench pid=11939 uid=10323
E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@814a5db
E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@db58878
I/Process: Sending signal. PID: 11939 SIG: 9
$ adb shell am start -n "com.example.parlerfrench/com.example.parlerfrench.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 12010 on device 'huawei-mar_lx3a-A4N4C19813000332'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/le.parlerfrenc: QarthPatchMonintor::Init
QarthPatchMonintor::StartWatch
QarthPatchMonintor::WatchPackage: /data/hotpatch/fwkhotpatch/
QarthPatchMonintor::CheckAndWatchPatch: /data/hotpatch/fwkhotpatch/com.example.parlerfrench
QarthPatchMonintor::CheckAndWatchPatch: /data/hotpatch/fwkhotpatch/all
QarthPatchMonintor::Run
I/le.parlerfrenc: QarthPatchMonintor::Reading
QarthPatchMonintor::CheckNotifyEvent
QarthPatchMonintor::CheckNotifyEvent before read
I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.example.parlerfrench#10323#256
apicache path=/storage/0403-0201 state=mounted key=com.example.parlerfrench#10323#256
I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.example.parlerfrench#10323#0
apicache path=/storage/0403-0201 state=mounted key=com.example.parlerfrench#10323#0
I/AwareBitmapCacher: init processName:com.example.parlerfrench pid=12010 uid=10323
W/AwareLog: AwareAppScheduleManager: system version has changed
D/AwareAppScheduleManager: webViewOpt, system or app version update, clearData
D/HwFrameworkSecurityPartsFactory: HwFrameworkSecurityPartsFactory in.
I/HwFrameworkSecurityPartsFactory: add HwFrameworkSecurityPartsFactory to memory.
W/DynamiteModule: Local module descriptor class for com.google.android.gms.measurement.dynamite not found.
W/le.parlerfrenc: Unsupported class loader
V/ActivityThread: callActivityOnCreate
I/DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21800
Selected remote version of com.google.android.gms.ads.dynamite, version >= 21800
V/DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils
I/DynamiteModule: Considering local module com.google.android.gms.measurement.dynamite:0 and remote module com.google.android.gms.measurement.dynamite:15
Selected remote version of com.google.android.gms.measurement.dynamite, version >= 15
V/DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils
V/HwWidgetFactory: : successes to get AllImpl object and return....
I/DynamiteLoaderV2: [71] AdsFdrDynamite.integ
W/le.parlerfrenc: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/le.parlerfrenc: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
I/DynamiteLoaderV2: [71] Measurementdynamite
W/le.parlerfrenc: ClassLoaderContext type mismatch. expected=PCL, found=DLC (PCL[] | DLC[];PCL[/data/app/com.example.parlerfrench-EYMYgchiFQA_Dl4QJgOtwg==/base.apk*1978371040:/data/app/com.example.parlerfrench-EYMYgchiFQA_Dl4QJgOtwg==/base.apk!classes2.dex*3844201848])
Found duplicate classes, falling back to extracting from APK : /data/user_de/0/com.google.android.gms/app_chimera/m/000000cd/MeasurementDynamite.apk
NOTE: This wastes RAM and hurts startup performance.
Found duplicated class when checking oat files: 'Landroid/support/v4/media/MediaBrowserCompat$CustomActionResultReceiver;' in /data/user_de/0/com.google.android.gms/app_chimera/m/000000cd/MeasurementDynamite.apk and /data/app/com.example.parlerfrench-EYMYgchiFQA_Dl4QJgOtwg==/base.apk
I/OverScrollerOptimization: start init SmartSlideOverScroller and get the overscroller config
get the overscroller config
W/DynamiteModule: Local module descriptor class for com.google.android.gms.measurement.dynamite not found.
D/ActivityThread: add activity client record, r= ActivityRecord{e1aefd9 token=android.os.BinderProxy@db58878 {com.example.parlerfrench/com.example.parlerfrench.MainActivity}} token= android.os.BinderProxy@db58878
D/ConnectivityManager: requestNetwork and the calling app is: com.example.parlerfrench
I/FA-Ads: App measurement initialized, version: 29013
To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
D/HiTouch_PressGestureDetector: onAttached, package=com.example.parlerfrench, windowType=1, mHiTouchRestricted=false
I/FA-Ads: Tag Manager is not found and thus will not be used
D/NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: true
I/iGraphics: [0020080c] pn: com.example.parlerfrench, p: 12010
[0030080c] no spt app: com.example.parlerfrench
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
W/le.parlerfrenc: Accessing hidden field Landroid/view/View;->mAccessibilityDelegate:Landroid/view/View$AccessibilityDelegate; (greylist, reflection, allowed)
E/RecyclerView: No adapter attached; skipping layout
W/Gralloc3: mapper 3.x is not supported
E/: APS:IFLoad:importExternalFunctions, search function createNewHwApsUtils failed, dlsym err:undefined symbol: createNewHwApsUtils
D/: APS:importExternalFunctions OK
I/OpenGLRenderer: Davey! duration=707ms; Flags=1, IntendedVsync=9376348017918, Vsync=9376348017918, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=9376349180339, AnimationStart=9376349288151, PerformTraversalsStart=9376349291797, DrawStart=9376853891797, SyncQueued=9376878685026, SyncStart=9376879026172, IssueDrawCommandsStart=9376880606901, SwapBuffers=9377049970964, FrameCompleted=9377056244401, DequeueBufferDuration=146000, QueueBufferDuration=1573000,
I/Choreographer: Skipped 43 frames! The application may be doing too much work on its main thread.
I/HwViewRootImpl: removeInvalidNode jank list is null
I/OpenGLRenderer: Davey! duration=745ms; Flags=0, IntendedVsync=9376364645563, Vsync=9377081312201, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=9377094456380, AnimationStart=9377094582943, PerformTraversalsStart=9377095088151, DrawStart=9377100813151, SyncQueued=9377104319401, SyncStart=9377104572005, IssueDrawCommandsStart=9377104755860, SwapBuffers=9377108994401, FrameCompleted=9377110543880, DequeueBufferDuration=89000, QueueBufferDuration=792000,
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
W/System: A resource failed to call close.
W/libEGL: EGLNativeWindowType 0x767efbfa90 disconnect failed
D/AwareBitmapCacher: handleInit switch not opened pid=12010
W/ConnectionTracker: Exception thrown while unbinding
java.lang.IllegalArgumentException: Service not registered: lt@38fb84f
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1832)
at android.app.ContextImpl.unbindService(ContextImpl.java:1880)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:741)
at cg.b(:com.google.android.gms.dynamite_measurementdynamite@202414083@20.24.14 (120408-0):1)
at cg.a(:com.google.android.gms.dynamite_measurementdynamite@202414083@20.24.14 (120408-0):6)
at lu.A(:com.google.android.gms.dynamite_measurementdynamite@202414083@20.24.14 (120408-0):10)
at lf.a(:com.google.android.gms.dynamite_measurementdynamite@202414083@20.24.14 (120408-0):3)
at dz.run(:com.google.android.gms.dynamite_measurementdynamite@202414083@20.24.14 (120408-0):3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at ja.run(:com.google.android.gms.dynamite_measurementdynamite@202414083@20.24.14 (120408-0):6)