Old date returned by getPackageInfo() on Wear OS 3? - wear-os

I have been using the following code to show when I created the package (Android Studio)
val pInfo: PackageInfo = this.getPackageManager().getPackageInfo(this.getPackageName(), 0)
val versionDate = pInfo.lastUpdateTime
val versionDateAsString = SimpleDateFormat("dd/MM/yy HH:mm:ss").format(versionDate)
Toast.makeText(this, "Package Created $versionDateAsString", Toast.LENGTH_LONG).show()
The above code snippet works perfectly for packages loaded onto my Ticwatch 3 (running Wear OS 2)
Unfortunately it does not work when the same package is loaded onto my Samsung Watch4 (Wear OS 3). Instead it shows the first time the package was loaded?
UPDATE 1:
It appears this is expected behaviour - The old date is returned when the code is run on an emulated Wear device.
Notes
Even cleaning and rebuilding the entire package still results in the emulator showing the time and date the package was first run on the emulator.
The emulator is set to API 30 and I admit I have not tested on an emulator running API 28 (I want the date to show on the Galaxy Watch4)
Frustrating!

Related

App's cache is unintentionally deleted in Oxygen OS 13

I'm developping in Flutter and i debug my app in my real device, an OnePlus 8T. After i update to Oxygen OS 13, the app's local cache is deleted unintentionally, what makes that I can´t record any long videos. The images and whatever stay in the cache, is deleted too.
I tried to execute the app in another device with Android 9,in emulator with Android 13,12,11 and 10.
In Realme GT with Android 13 too. And in all of these devices, this problem not occurr. All works correctly.
Before upgrading to Oxygen OS 13, i remind that the cache folder worked fine.
I tried to take pictures or record videos with any library which can do this.
Expected behavior
The pictures and the videos are saved in the local cache.
Actual behavior
The pictures are deleted and the video sometimes can´t be recorded.

Xcode 11 blank white screen on device

I have a problem with debugging any app using Xcode 11.3.1.
The app builds very quickly (about 3 seconds), but after that, the device displays a white blank screen for a minute or two. On the Report navigator tab, it says that the app is running and debug is already in process but there are no logs. It happens with any app, even a newly created one.
Tried reproducing it on iPhone XS and iPhone 11 pro with 13.3.1 iOS version (the latest one at the moment) - the result is the same.
After this pause, I can debug the app as nothing happened. This behavior happens only during the debug session (no matter using cable or WiFi). If an app was already installed and launched directly from the phone - everything is fine.

application-settings not working as expected

Wrote a small app and saved a string via application-settings module.
I can read the value fine within that same session.
If I close the app in the emulator and restart it in the emulator, I can read the value also.
But if I rebuild the project in the IDE (VS Code - pressing "refresh/reload" icon) - the app restarts and the stored value is no longer there.
Seriously?
Is application-settings stored data not persistent across sessions.
If you rebuild your application, it will delete the old application on your smartphones + all the datas that was stored in application settings.
If you don't want that the stored datas disappear meanwhile you are changing the code you should use the livesync options.
In order to do that, go with a terminal at the root of your app projet and type the following command :
tns livesync ios --watch
For IOS or
tns livesync android --watch
For Android
I hope this will help you

Android Studio: Android 5 lollipop can't install and launch App

I have 2 real android devices and I used them to test my android app (I am new at Android programing)
When I clicked "run" button, the dialog box showed me two of my devices:
Table 4.2.2 and Cellphone 5.0
After running, my tablet launched the app perfectly, but my phone (5.0) wouldn't launch, it even wouldn't install new app, I tried many time, and finally it run, but at the later time, I needed to remove previous app to run new app.
Please help me to resolve this problem.
Well, you have to remove the old version of your app all the time? If yes, you should use a keystore file for signing the app (and always the same). My device also refused to update an app because I didn't sign it with a keystore file. (I have one device with Android 5.1.1 and one with Android 4.2.2, had the same issue with the 5.1.1 one until I signed it)

App not being started on device

I'm trying to play with NativeScript to create any simple android app. I've done step 1 from NativeScript's 'Getting Started' (setting up my osx environment) and right now, i have a barebones NativeScript app created with tns create and android platform added to it.
When running tns run android everything goes well and the final message before device debug logs (i'm not an android/ios/mobile dev so i assume that it's just some kind of debug log of what's going on connected device) is:
BUILD SUCCESSFUL
Total time: 11 seconds
Project successfully built
Using /Volumes/HDD/Users/michal/Workspace/Sandbox/tns_hello_world/platforms/android/bin/tns_hello_worl d-debug.apk
Successfully deployed on device with identifier '00099fbd72369f'
However, there is nothing going on my device after that. No app is being launched, no error message. Just completely nothing.
My setup is:
OSX 10.9.5
Java 1.8.0_45
Samsung GT-I9100
Android 4.1.2
Have you any idea what am i possibly doing wrong? Thanks in advance.
Your android device is not supported by NativeScript. Use device with Android 4.2 (API level 17) or newer. You can also try it on emulator.
Jan 2019
I verified in Android 8.1, it works fine.
First look, it looks like not working.
However, after changing the text "Play with NativeScript!" to "Hello world" in home.component.html, I could see the text. The homepage message ideally should say this.

Resources