I have an application for tablet and mobile, and to recognize if it's tablet or mobile I set a boolean value in a specific value file (similar to this example: Determine if the device is a smartphone or tablet?). for some reason, the pixel 7 pro (with android 13) is not getting this value correctly and recognizes it as a tablet. It's important to note that the activities' layout files are taken correctly.
Does somebody know why this could be happening?
I am using DeviceProperties.isTablet(applicationContext) from com.google.android.gms.common.util.DeviceProperties and my Pixel 6 Pro is recognized as phone.
It should also work for Pixel 7 Pro.
Related
I am on Android Studio Chipmunk (2021.2.1 Patch 2) and using the Pixel 5 emulator.
I have an Android app that allows the user to enter the gallery and select photos - one or many. Using the Pixel 3 emulator everything works like it should. I can grab as many or as few images as I like. Just click to leave a blue check and when done, select done. Also worked fine on the Pixel 3 physical phone I had at the time.
With the Pixel 5 emulator it allows me to select 1 image only. Long click does nothing. Any tips or tricks to get the emulator to allow the user to select in excess of 1 image?
I'm on a MacBook
In lieu of finding a more recent pixel to use I created a new device in device manager that is a "phone" running on API 33. Multiple select worked just fine on this "custom" device. I was able to accomplish the testing of the code on a more recent version of the API, which was my goal. Not sure what is up with the Pixel 5 emulator but there is a workaround.
I want to add in my manifest android:largeheap="true" based on some devices. Mostly devices running probably os 5.1 and below.Because alot of my clients are using samsung s3 , chinese , indian , pakistani phones.And I am getting lots of crashes in my firebase console. However this issue is not faced on top notch devices like google pixel samsung s8 etc.
How can I detect which devices i run largeheap, and how i run it on those devices only? I do not want to run it on devices i dont need to.
Well, you can't set this flag depending on the device. That's the true. But you can set it depending on OS version, screen size and etc. Check this answer to see how it can be done.
Can we based on Android Studio Emulators for different display screens create the App? Can we trust Android Studio Emulators ?
I mean for example whatever that's displayed on the Nexus 7 Emulator, would be exactly the same as it is really displayed on the real Tablet itself.
Yes, we can.
I've compared lots of emulators vs real devices - they are almost identical
Android Emulators give you a basic idea of different layout. Padding and pixel adjustment may be different in real device due to difference between system screen resolution and real device screen resolution.
The Android Emulator is built hand-in-hand with the Android platform for the Android SDK. Moreover, the latest Android Emulator system images (API 24+) 100% pass the Android Compatibility Definition, so that you can have even more assurance that app behavior will be exactly the same between the Android Emulator and a physical Android device.
I want to design an android layout for nexus 5 mobile and need to give a fixed width/height. After searching with many websites I have used the layout folder named as "layout-normal-xxhdi". It works perfectly for nexus 5 but unfortunately it will affect other mobiles. Ex) I tried with moto e it also takes the layout file from "res/layout-normal-xxhdpi.xml" folder. Please someone give the exact layout folder name for nexus5.
My layout folders,
res/layout.xml
res/layout-normal-xxhdpi.xml
Note:
For other mobiles it will need to take the layout file from "res/layout.xml"
You cannot do this with folder name. But you could try to recognize the device model (here Nexus 5) in your Java code and use the appropriate layout. To do that, you could use Build.MODEL.
Testing in AS v1.5 using the default Nexus 5 emulator (selected replicate device during creation), you can almost specifically target Nexus 5's specs using the "sw384dp-xxhdpi" folder name.
I have an application that works fine in almost devices but the only device that fail is samsung gt s5303, I want to add a different value folder just for that device and add to it my dim file , I have tried to add values-sw320dp , but I found that it make other devices read from the same values folder
so how can I solve this problem please
This is the full specs. of the device
http://www.gsmarena.com/samsung_galaxy_y_plus_s5303-5357.php