Unity3d project does not display images on samsung galaxy tablets - android

I have created a 2D game in Unity and have successfully created it PC build now I want to port it on Android devices. I have created the android build and It works on most of my android devices except on Samsung Galaxy tablets. On Samsung Galaxy tablet devices, it does not display the main menu backgrounds.
I have checked dimensions of the image these are 2048 X 2048.
In the inspector of unity the properties of image are asss follows:
type is sprite, max size is 1024 and compressed
On other android devices,(google nexus, micromax phones, bluestacks) it displays the images properly. Can anyone please guide me?

You also have to set you image as "Sprite" from Inspector.

Hi I found out what I was doing wrong.
the textures were not appropriate according to the resolution of the screen. After I created another set of textures and setting the compression and max size to 2048 X 2048 it started displaying.

Related

Android Studio Emulator Fonts Blurred

I have install flutter and android studio and setup as usual in new laptop running windows 11 pro. But when I start emulator its fonts are not clear, blurred. I tried switching emulated performance from hardware to software, but not works, is any one facing this issue.
My monitor display resolution 1366 * 768 Scale 100%
I used pixel emulator with 1080* 1920 resolution
and Pixel 3a with 1080*2220 resolution
same problem exist with both emulators.
Actually I don't think there would be a solution for that.
Because this problem is related to down scaling emulator window too much.
But you can do one of these:
1- create a new emulator and use a smaller screen size (around 720p). the downside is that you can not create emulator with Google play system images, as they need 1080p phone screen size. you can still use Google Apis images.
2- use a monitor with at least 1080p resolution.
3- use third party emulators like Memu. you can choose any screen resolution in these emulators, and they come with google play. also their performance is much better than Android studio native emulator.
4- use a physical Android phone.

How to control resolution screen size

I'm a new dev of android and I can't control the resolution of the size for screen phone.
I created 2 emulations phone: Pixel 2 1920x1080px 5inch and Nexus 4 1280x760px.
I also created the layout resource w480dp.
When I run test the layout, it only change on pixel 2, the Nexus 4 doesn't change. I also run test on real phone (Galaxy S3), the layout is not same with Pixel 2
So I would like to ask the helping how do I control the resolution screen size.
I've already read on Google help about small, large... but also can't control in this case.
you can use this library for setting same screen for different device.
SDP - a scalable size unit

layout is different in real device

I'm developing android app that have few activities. I have Samsung S6 device in my hand, so I created the same device in the android studio emulator to make it easy. But the problem is when I install the APK in my physical device it's not showing the layout as the emulator device. I used the same screen size ( 5.1 ) & the same resolution of 1440 pixels by 2560 pixels when creating the emulator device. can someone please help me ?
I also uploaded 2 screen shots to better understanding.
In Emulator
In Real Device

Why images can not be seen in TImage on some devices?

I use TImage (in Delphi XE5, FMX) in my app.but all of the components can be seen except TImage content on some devices.
I try to display any pictures in bitmap or jpeg formats. I set bitmap in MultiResBitmap property in DesignTime or load jpeg image in Runtime.
For example on Device : Samsung Galaxy S Dous2 Android 2.3.6 , HTC ONE M8 Android 4.4 , Huawei Tab 7 android 4.3 , Huawei P6 Android 4.2.2 TImage Content can not be seen and Show a black rectangle. on other devices TImage worked properly.
You should first make a multiresbitmap with the Editor
And then load the Multi-Resolution Bitmap

Android Game working differently in different Android Phone

i recently developed a game, for Android 2.3.3, and strangely im finding few weird behaviour in different phones,
for example
An explosion sprite(256x256 pixels) divided into 4x4=16 images, when displayed is being displayed as a 2x2 image in Samsung Galaxy Ace 2.3.3 and Samsung Galaxy Y, 2.3.5 ,
Also, the accelerometer works in a haphazard form in Sony Xperia 2.3.3 and Samsung Galaxy Ace.. either its too slow(and takes touch gestures after 3-4 second gap) and Android OS throws a Alert box saying, the app is not responding, else its too fast.
Strangely, The game works perfectly on a Samsung S2, just like it plays on the VirtualBox..
please help me, b'cos this is my college project, and I wont even be able to put this up in the market if such a queer problem exists!!
Thanks in Advance!!
I think I have the same experience with the graphics problem:
From your code, I'm guessing you may have pre-computed "width_explosion" and "height_explosion" from the image height/width you have seen in an image editor and using the same values on different devices.
The device you have listed have two different DPI values as Android knows: 240, or MDPI (Galaxy S2) and 120, or LDPI (Galaxy Ace and Galaxy Y). Note that Galaxy S2's DPI is exactly twice as Ace's and Y's.
Android makes it handy for app authors by assisting them in manipulating images. When images are read from resources through getDrawable and are ready for rendering on screen Android resizes the images with respect to 160DPI, so that they will have the same length measured with a ruler on screens with different pixel densities. For example, if an image with 128x128 pixels is 2cm long and 2cm wide on Galaxy S2, it should be 2cm long and 2cm wide on a Galaxy Ace. However, to cover the more pixels on a Galaxy S2, it's resized to 192 x 192 pixels when drawing on a Galaxy S2, because its DPI as the Android system knows it is 240, 1.5 times the DPI of an ADP1 (HTC Dream). Similarly, the image will be resized to 96 x 96 on a Galaxy Ace or Galaxy Y.
The source rectangle in canvas.drawImage, unfortunately, refers to the number of pixels in the resized bitmap. That means the same source rectangle used in your code sample covers 4 times as many pixels on a Galaxy Y as it does on a Galaxy S2. I guess you are describing in the question that "the same sprite file looks like it was divided in 2x2 on a low DPI device but it should be divided by 4x4".
The following example illustrates what happens when I'm trying to replicate your question with devices with different DPIs.
I cannot post images, so I have put the images here (it's my blog):
http://edgeofmap.com/blog/2013/05/android-bitmap-over-devices-of-different-dpis/
Not sure what to do about the graphics issue, but for the accelerometer each device acts differently. Use event.sensor.getMaximumRange() in your onSensorChanged() to get the maximum value and base your actions on that or a percentage of that.

Categories

Resources