My app is generating this logcat message almost every second:
SurfaceTextureClient [STC::queueBuffer] (this:0x5e774a58) fps:2.00, dur:1496.57, max:499.96, min:498.21
and it's just a hello world with a custom logo in the actionbar and saves things in SharedPreferences. My activity layout is a LinearLayout with two edittexts and one button. No strange things.
This is the only style I use:
<style name="MyTheme" parent="#android:style/Theme.Holo.Light.DarkActionBar"></style>
I've searched in google but I have found nothing.
When I touch the button this appears:
Provider/Settings invalidate [system]: current 1 != cached 0
Provider/Settings from db cache, name = sound_effects_enabled , value = 0
It's annoying.
EDIT
Maybe is my smarphone. I've installed the same app in a tablet and the messages don't appear. Maybe I have touch something in settings? It's very strange. (My phone is a Jiayu 3gs with Android 4.2.1, but until today nothing wrong had happened).
Ok, the message appears in the general log so it's not associated with my app.
I'm starting to think that I have a virus. I have a lot of messages of this kind without doing anything in the phone:
ADB_SERVICES create_local_service_socket() name=shell:ls -l /
ADB_SERVICES adb: unable to open /proc/14420/oom_adj
ADB_SERVICES adb fdevent_process list (31) (20) (77)
ADB_SERVICES closing because is_eof=1 r=1 s->fde.force_eof=0
SurfaceFlinger [SurfaceFlinger] fps:2.002652,dur:1498.01,max:499.41,min:499.22
UsbDeviceManager onReceive - BATTERY_CHANGED - mPlugType: 2, mSettingUsbCharging: false, mConnected: true, mSettingUsbBicr: false
And I have a lot of files in my / with date creation of 1970-01-01 01:00. Files like init, init.modem.rc, init.rc, init.usb.rc, ..., emmc#android, ..
Maybe I'm just paranoid.
Furthermore I can't access to all options in "Developer options settings". This is all I can see:
Different phones have different kind and amount of log messages. Not much you can do about it, besides filtering the output based on the tag you use.
Related
For a couple days I tied to implement the splash screen on Android Xamarin Forms Application, I tied many approaches but all failed in the same way,
The application before adding the splash screen is working fine,
After adding the splash screen i get this error message
3>------ Deploy started: Project: NoorAlEman.Android, Configuration: Debug Any CPU ------
3>Error: Cancelled
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
sometime the application run without showing the splash screen for one time only if i delete "bin" and "obj" folder and rebuild the solution and most of other time it keeps showing the same error message.
I am sure about adding all files using visual studio 2019 interface, also all files have
Build Action: AndroidResource
Copy to output directory: Do not copy "Also i tried to make it as copy always"
Custom tools: I tried to leave it empty and other times i set to "MSBuild:UpdateGeneratedFiles"
Other thing i done is to set the MainLauncher to false in the manactivity.cs and setting it to true in the splashsctivity.cs
I tried these tutorials and all ended up showing the same error
(1) https://learn.microsoft.com/en-us/xamarin/android/user-interface/splash-screen
(2) https://progrunning.net/best-way-to-create-a-splash-screen-in-xamarin-forms-android-project/
(3) http://ebubekirsezer.com/en/xamarin-forms-splash-screen/?unapproved=11607&moderation-hash=67d1307ecdd13ca8e5b0acceae43d22d#comment-11607
Please do you have any suggestion that might resolve this issue.
Thank you in advance
M. Mazin
What I did was to create a new activity, say SplashActivity with the following attributes [Activity(MainLauncher = true, Theme = "#style/MainTheme.Splash", NoHistory = true)], where the Theme would be an image, or whatever you want your splashscreen to be. Then inside you just start the main activity of your application, something like this:
protected override void OnResume()
{
base.OnResume();
StartActivity(new Intent(Application.Context, typeof(MainActivity)));
}
Don't forget to remove the MainLauncher attribute from the MainActivity.
Hope it helps!
For me the only solution was:
-rebuilding the project
-closing and reopening VS
-disconnecting and reconnecting my mobile device
I don't know where this error comes from, and it's a real pain, but this way you can at least keep testing your app until there comes an update which fixes it.
I develop an Android app. If I call
float.Parse("51.552058")
in Editor or App on my Mac Book (Language Setting English), it works fine. After publishing to Android (Language Setting German) the result of the Parse operation is not "51.552058" anymore but "5,155211E+09". I understand that this might be related to the device's language but I still don't really understand what is happening and why.
I also tried following with no success:
float.Parse("51.552058", System.Globalization.NumberStyles.Any)
float.Parse("51.552058", System.Globalization.NumberStyles.AllowDecimalPoint)
Did anyone stumble over this before?
float.Parse is culture dependent.
See e.g. from NumberFormatInfo
// '1,034,562.91' --> 1034562.91 (en-US)
// '1,034,562.91': FormatException (fr-FR)
// '1,034,562.91' --> 1034562.91 (Invariant)
Reason here is that in EU cultures the , is usually the decimal separator while the . is used as the group separator. So from the example above the correct format for fr-FR would be 1.034.562,91
You probably rather want to use CultureInfo.InvariantCulture like
float.Parse("51.552058", CultureInfo.InvariantCulture);
or directly NumberFormatInfo.InvariantInfo
float.Parse("51.552058", NumberFormatInfo.InvariantInfo);
which simply has defined
NumberDecimalSeparator .
NumberGroupSeparator ,
Good morning. I need to test my application in Chrome OS, but without the "touch screen"
I used this guide to run a emulation of Chrome OS:
https://www.groovypost.com/howto/chrome-os-android-studio/
Ok, I succeeded to run it, I activated the debugging mode and I activated the adb debugging....finally everything is working and I can run my application on it.
The problem is, I want to test it without touchscreen.
I found the hw.screen property inside
~/.android/avd/<machine-name>.avd/hardware-qemu.ini
that was set to hw.screen = multi-touch.
WOW, exactly what I want, let's change it to no-touch.
Inside ~/Android/Sdk/emulator/lib/hardware-properties.ini you can see
# Touch screen type
name = hw.screen
type = string
enum = touch, multi-touch, no-touch
default = multi-touch
abstract = Touch screen type
description = Defines type of the screen.
so, no-touch is a valid option.
The problem is, even if I change it, every time I restart the emulator, it is set back to multi-touch.
I also tried to change the option directly in ~/Android/Sdk/emulator/lib/hardware-properties.ini, that should contain the default option, but no luck...
Someone can tell me who is overwriting this property each time I start the emulation?
How can I remove the touch screen in the emulation?
Launch the emulator from the command line and use the flag -screen no-touch. This is because the emulator overrides the config in the .ini file. That gives no touch screen but the mouse wasn't usable, at least on Windows.
See the docs for more details
When creating an avd, starting it for the first time and then trying to close the emulator, the user will be prompted with a dialog reading:
Do you want to save the current state for the next quick boot?
Note: Saving the snapshot may take longer because free RAM is low.
I would like to save this parameter, before starting the emulated device, within its config.ini file.
However I'm not clear on which option it is.
Things I tried:
Adding these lines to the config.ini
fastboot.chosenSnapshotFile=
fastboot.forceChosenSnapshotBoot=no
fastboot.forceColdBoot=no
fastboot.forceFastBoot=yes
Creating an additional file within the config.ini directory of the avd called quickbootChoice.ini that simply reads:
saveOnExit = true
Non of which helped, on every first shutdown of the emulated device this dialog pops up...
Thanks in advance
According to https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/android/android-emu/android/skin/qt/tool-window.cpp the popup does not appear if the method returns based on this:
if (saveOnExitChoice == SaveSnapshotOnExit::Always &&
(fc::isEnabled(fc::QuickbootFileBacked) ||
(!savesWereSlow && !hasLowRam))) {
return true;
}
Setting QuickbootFileBacked = on in .android/advancedFeatures.ini fixed it for me. See https://androidstudio.googleblog.com/2018/08/android-emulator-28.html.
You can configure this setting in Android Studio, see this answer for instructions: Android emulator - Don't save state by default
If you are starting the emulator from the command line. Then provide the -no-snapshot-save parameter, to prevent it from saving.
emulator #Nexus_5X_API_23 -no-snapshot-save
reference: https://developer.android.com/studio/run/emulator-commandline
I'm using Cordova 3.6.4 in Visual Studio 2013 Community Update 4 to build an apps with a "chat" functionality, the main reason that I use this technology is because I want to, hopefully, write once and can use it in all platforms such as Android phones, iPhones, all mobile phone browsers, all desktop browsers.
In order to let the users inputting the "message" to be sent, I create a [div] which is contenteditable="true" at the bottom left of the html, at the right hand side of this [div], I have two [image buttons], one is the [happy face] button, the other is the [send button]. (You know, just like Whatsapp, Line and WeChat!)
At any time the user can click the [happy face] button to select one of the many "face image" to insert into the cursor at the [div], then I'll add the html codes into the [div], e.g. div.innerHTML += '< img src="1.jpg">'
So, the innerHTML of this [div] can contain characters AND images, e.g.
12< img src="1.jpg" />34< img src="2.jpg" />
Of course, the actual display is:
12[1st Picture]34[2nd Picture]
If the cursor is at the end of this [div], and I clicked the [BACKSPACE], I expect the [2nd Picture] will be removed, if I clicked the [BACKSPACE] again, I expect the letter [4] will be removed from the [div], this is work at ALMOST every platform I mentioned including all mobile browsers in android and iphone/ipad, all desktop browsers. But it does not work when I build an Android app and run it in any Android phone.
Running it as a WebView in android phone, when I click the the [BACKSPACE], the letter [4] is removed instead of the [2nd Picture], when I click the [BACKSPACE] again, the letter[3] is removed. I can NEVER remove the 2 images no matter which IME I'm using.
To work around, I tried to add a keyup/keydown/keypress listener to the [BACKSPACE] but it never fires.
At last, to work around this [BUG], I need to add a third [X] image button and use JavaScript string.replace to remove the < img> tag when users click this [X] button, but it looks very stupid to the users!
It makes me crazy that ALL IMEs do not remove the image for me by pressing the [BACKSPACE], and if the key events are not fired, I cannot remove the images myself!
I tried ALMOST, I think, ALL the suggestions provided by stackoverflow but they don't work at all, either not applicable to CORDOVA, or with compilation error such as [command failed with exit code 8] in Visual Studio.
What should I do?