Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (492)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [Solved] Supporting multiple devices.  (Read 7089 times)
0 Members and 1 Guest are viewing this topic.
Offline Zeta

Junior Member


Medals: 1
Exp: 1 year



« Posted 2013-11-29 20:00:30 »

How can i make my app support multiple devices?
Im making the app without engines like libgdx so i can understand android development better(i guess).


I've made different resolution images for hdpi,mdpi and ldpi.
What dp width and height should i use in my xml code so it support most of the devices and does not look stretched?
Should i make different layouts for different devices or something?

Here is my xml code for the splash image:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/backgroundId"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/black"
    android:gravity="center"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/splashId"
        android:layout_width="match_parent"
        android:layout_height="240dp"
        android:background="@drawable/splash"
        android:contentDescription="@string/splash"
        android:orientation="vertical" >
    </ImageView>

</RelativeLayout>


Thank you.

A clever person solves a problem. A wise person avoids it. -Albert Einstein
https://trello.com/zaniarm/recommend
Offline vbrain
« Reply #1 - Posted 2013-11-30 05:45:00 »

Most of the people on this forum don't know anything about android layouts. You'll have better luck asking elsewhere.
Offline opiop65

JGO Kernel


Medals: 154
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #2 - Posted 2013-11-30 10:40:10 »

Most of the people on this forum don't know anything about android layouts. You'll have better luck asking elsewhere.
Why do you say that? I've dabbled in Android development a little, maybe some people on here have too.

@OP I'm pretty sure unless you created the picture for phones, but used it for a tablet, you wouldn't really see a difference. When I was learning Android development, no one ever told me to make multiple backgrounds.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Zeta

Junior Member


Medals: 1
Exp: 1 year



« Reply #3 - Posted 2013-11-30 12:26:53 »

I've solved the problem.

I had to make folders layout-small, layout-large etc. and make own layouts for them.

also i had to add "supports-screens" in manifest:
1  
2  
3  
4  
5  
<supports-screens
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:xlargeScreens="true" />


Now im experiencing problems with animation.
Maybe i should just use engine to make games for android, but i dont think i will learn much if i do so.

A clever person solves a problem. A wise person avoids it. -Albert Einstein
https://trello.com/zaniarm/recommend
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #4 - Posted 2013-11-30 17:44:05 »

I don't really think that's the correct solution. I've only recently started dabbling in pure android code, but if it's the same app why do you need different layouts? Should be the same layout, scaled differently. Also, do you want the game size to be scaled up to maximum (aka take the lesser screen dimension and scale the x/y to that), or just not changed at all?
Offline Zeta

Junior Member


Medals: 1
Exp: 1 year



« Reply #5 - Posted 2013-11-30 21:27:06 »

I read somewhere that when you make a folder named for example layout-large.
Then it recognizes if the app is played on hdpi devices and it runs the layout in the layout-large folder.

I really dont know if this is the best solution but good enough for me since im not doing fancy stuff with my app.

Here is a good link: http://developer.android.com/guide/practices/screens_support.html

A clever person solves a problem. A wise person avoids it. -Albert Einstein
https://trello.com/zaniarm/recommend
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Nickropheliac (16 views)
2014-08-31 22:59:12

TehJavaDev (24 views)
2014-08-28 18:26:30

CopyableCougar4 (33 views)
2014-08-22 19:31:30

atombrot (42 views)
2014-08-19 09:29:53

Tekkerue (41 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (26 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (73 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!