Does DPI matter for desktop in LibGDX? - java

I am working with LibGDX at the moment.
I understand why DPI matters for android, but was wondering if it even mattered for desktop development.
My question is this, does DPI matter at all or affect games for desktop?
If so, is it in the same way that it does for android?
If not, how is it different?

It depends.
If you need to keep the same physical size across devices, then it matters. Eg. You need an image to be 1" on both phone and tablet.
If you need to keep the same proportions across devices and are only dealing with different aspect ratio's, then DPI will only be useful if you want to have a good idea on what a finger can achieve on a screen, which is usually 50 dp.

Related

How to make a app scale the look the same on all devices (android)

I'm working on a app but I have a problem were buttons and images stay the same size on all screen size but I need to make the change depending on the size of the screen?
you have to design different layouts for tablets but for rest of the devices this library may help for achieving what you want .
https://github.com/intuit/sdp

I think my Android Game Size will be too big? (Using LibGDX & Android Studio)

I'm a 17 year old trying to start developing some android games. I've used LibGDX once before and found it a pretty effective tool, so I'm using it again now.
The game I'm making is a choice based, interactive game where you make a choice and then the next scenario happens based on your choice, and it goes on and on until your character dies or you win. I'm expected to have around 200 scenarios by the time I'm done, and currently have around 160.
The problem I'm having is that each of these scenarios is basically a "card," with a picture, scenario description and 2 options below it. Each of these images is pretty big, and if I scale the card images down they start looking pixelated on the phone screen. I'm worried that in just images, my game will reach 100mb, and then with sound effects and everything else it might be like 200mb. This seems pretty inefficient and I don't want potential players to shy away from the game just because of it's size, if they don't have enough room on their phone...
Am I doing something wrong? I apologize for this inexperienced question, I'm really new to Android development.
That isn't too big for modern games but you will need to not include the assets in the apk and either download that when needed or use what Google already thought of for this problem.
https://developer.android.com/google/play/expansion-files.html
These are some steps that can help you reduce your apk size:
Use only specific drawable
Add only specific image size for each drawable directory for drawable-mdpi, drawable-xhdpi, drawable-xxhdpi, etc. You can try removing a drawable directory that could potentially unused by the user, like drawable-mdpi and drawable-xhdpi, and use only the hi-res one like drawable-xxhdpi. Or, you can try using only drawable directory for all the images, so your app will only use one image for all devices type.
Resize your images
Compress your images
If your images are PNG files, You can compress the images without a noticeable change using pngquant. In fact, it can reduce your images sizes significantly (often as much as 70%) and preserves full alpha transparency. Or you can try using pngcrush (I'm rarely using this)

Fixing Android apps size

Im just made my first little app on android.
I've been using the Android Studio for developing which is quite good but the problem is that the app I designed fits only a 5.5" display. On other devices its just very small or larger. I don't know how to make it autosize according to the size of the device.
Is there any way to fix it or is there any way to make different Apks for different mobiles (according to the display sizes)
PS: there isn't any picture in the app. Just writing and calculations. Kind of Calculator for beginners(ME). :)
If you dont have any images on your app, set your layouts and views width (when needed) to 'match_parent' instead of 'wrap_content' or a fixed size.
Set the parent layouts height to 'match_parent' and if you have a background that fits all the screen, set this too.
Check this for reference of LayoutParams values: http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html
If you want to add images Go to http://developer.android.com/guide/practices/screens_support.html and try to understand all the concepts of densities independence and supporting multiple devices.

Image Recognition BlackBerry?

I'm trying to develop a sort of AR for BlackBerry devices. Trying to achieve the best compatibility for old devices, if it's possible I would like to make it for BlackBerry OS 5 / 6.
Due to lack of hardware performance, I'm not trying to show a real-time solution on screen. Right now I just want to recognize some symbol that the camera see, at the moment the symbol is recognized I want to capture a photo of the current view.
After that, I want to crop part of the captured photo and compare it with a imagery and determine if it matches some image.
I'm quite advanced on researching the alternatives, for the image comparing step, I know there are two common techniques histogram and keypoints. I'm almost decided to use histogram method, but I'm worried about the colors captured by the camera could be a little different from which ones I got in the database (due to light sources, colors, etc.)
Any ideas of which is the best method to achieve what I'm trying to do?
Thanks!

Programming For Various Screen Sizes in Android

I'm using the Canvas and the SurfaceView. I've explicitly mentioned the coordinates for various objects and fonts on the screen. The app runs perfectly on Samsung Galaxy S Advance but the objects are out of scope on smaller screens such as that of Samsung Galaxy Fit or Pop. How do i make it compatible for all screen sizes and pixel densities.
Using dpis seems out of the question as I'm not using any xml layouts.
Thanks in advance.
I think you should get screen resolution at run time and set pixels according to that.
According to the developer guidelines it is discouraged to do so (work with explicit coordinates). Please refer to the android design guidelines for how to do it better. If you cannot avoid it, you'll need to take into account the screen size and density and compute your coordinates accordingly.

Categories

Resources