Android :: Making Game's Logic Supporting Multiple Screens
Jul 25, 2010
I've read the article "Supporting Multiple Screen" on Android developers site. But that doesn't apply to game logic.Let me get straight to the point. My situation is as follows:
- I'm creating a game using LunarLander code as a base.
- In my game, there'll be an object flying up from the bottom of the screen. The object will fly in projectile motion.
- I set the starting velocity, gravity and angle so that the highest point(of projectile motion) is almost at the top of the screen.
- The screen tested is Motorola Milestone. (480x854 resolution) Meaning the object travels around 854 pixels vertically.
I'm thinking of adjusting starting velocity based on screensizes. But that sounds unreliable when we've so many devices/resolutions out there. How do you combat these kind of problem when making games?
View 3 Replies
Jun 11, 2010
In the Supporting Multiple Screens document in the Android Dev Guide, some example screen configurations are given. One of them states that the small-ldpi designation is given to QVGA (240x320) screens with a physical size of 2.6"-3.0". According to this DPI calculator, a 2.8" QVGA display equates to 143 dpi. However, further down the page the document explicitly states that all screens over 140 dpi are considered "medium" density.
So which is it, ldpi or mdpi? Is this a mistake? Does anyone know what the HTC Tattoo or similar device actually reports? I don't have access to any devices like this.
Also, with the recent publishing of this document, I'm glad to see we finally have an explicit statement of the exact DPI ranges of the three density categories. But why haven't we been given the same for the small, medium, and large screen size categories? I'd like to know the exact ranges for all these.
View 1 Replies
View Related
Jun 9, 2010
I have read the topic about supporting multiple screen size as well as different DPI. I am wondering which of the following way is better in supporting multiple screens:
1. Have different layout for different screen size (stretch the images)
2. Have different set of graphics for different screen (use the same layout)
3. Have different set of graphics and different set of layout for each of the screen
Which way is the easiest? And which way is the most optical way to design? Or is there another better way?
View 2 Replies
View Related
Aug 19, 2010
My application will have two layouts, one for large screens and one for normal. For testing I'm working with one phone (800x480 240dpi) and one tablet (1024x600 240dpi) but both are detected as large screen hdpi and long aspect ratio, so I'm not able to assign different layouts.
The only approach I think that can work is to create layout-large and layout-normal, get the resolution and programmatically set the layout folder. Is that possible?
View 6 Replies
View Related
Sep 2, 2010
I am very new to android,i developed an sample web application and hosted it apk build file in different android version and on different sized devices,here i am getting problem in my design of layout such as listview not being displayed properly bottom portion is not displayed well and the align is not so good.
View 3 Replies
View Related
Oct 18, 2010
I have developed an application which en-composes list views and posted that .apk file in my htc device, the design and alignment everything works fine,but the problem When i am testing in various devices such as Morotolo Droid,Nexus Devices the alignment of Listviews goes wrong, so i planned to use the Layout folder as layout-hdpi,layout-ldpi, and layout-mdpi, for that i changed my manifest file as
<supports-screens android:largeScreens="true"
android:normalScreens="true" android:smallScreens="true"
android:anyDensity="true" />
Is it right putting android:anyDensity="true",also i used dp instead of dip. I went through this url, but still am not able to get a clear idea in this
http://developer.android.com/guide/practices/screens_support.html. so friends pls tell me(help me) to get clear idea in this and tell what mistakes i have doing. This is my main page xml code frnds.
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost" android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background_retinav2">
<LinearLayout android:layout_gravity="center" android:foregroundGravity="bottom" android:background="@color/white" android:id="@+id/rl_1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal">
<ImageView android:paddingTop="3dp" android:id="@+id/starthideimage" android:layout_width="30dp" android:layout_height="35dp" android:src="@drawable/newback" />
<HorizontalScrollView android:paddingTop="8dp" android:id="@+id/gv"
android:layout_width="wrap_content" android:layout_marginTop="0dp"
android:layout_height="wrap_content" android:background="#ffffff"
android:scrollbars="none" android:layout_weight="1" android:foregroundGravity="bottom">
<LinearLayout android:id="@+id/san_tag" android:layout_width="wrap_content" android:layout_height="wrap_content">
</LinearLayout>
</HorizontalScrollView>
<ImageView android:paddingTop="3dp" android:id="@+id/Endhideimage" android:layout_width="30dp" android:layout_height="35dp" android:src="@drawable/newforward" />
</LinearLayout>
android:id="@android:id/tabs"
android:gravity="bottom"
android:layout_gravity="bottom"
android:listSelector="@color/gray"
android:layout_width="fill_parent"
android:layout_height="wrap_content" /> </TabHost>
View 1 Replies
View Related
Mar 7, 2010
I'd like to announce the release on the Android Market of our last creation: 1 Minute Game. The main concept is very simple. The computer shows puzzles based on numbers, shapes and colours: the player must solve them and touch the correct answer to go to the next round, trying to be as fast as possible. We implemented 3 different modes that must be unlocked by playing more and more. You can play games under the "Training" areas so to train yourself and challenge your friends locally (there are 6 slots to store the profiles of the players).
Online Challenge
But the core of 1 Minute Game is the online challenge, which allows the players (once per day) to play a special match and to send the result to an online leader board. Each score shows also the nationality selected by each player try to get your country at top of the ranking. The ranking is visible both through the application and visiting the web site of the game.
Free DLC
In order to make the game more appealing and let you enjoy it for more time, we are developing new games to be released for free in the next versions of the application. For example, this morning (it's a matter of minutes) we will release the version 1.1 which contains a brand new game in the training section: The intruder. In each round, all of the objects shown on the screen share the same characteristic (same shape, colour, number or animation) except for one: that's the Intruder!
New games of logic will be released once they are completed and fully tested through future news.
LITE version
There is also a LITE version in the Market: 1 Minute Game LITE (limited number of levels, no online challenge and 2 slots to store the users' profiles), so you can try it and see if it is worth to buy the Full one. This LITE version includes the additional training "The Intruder" as well.
DOWNLOAD
the game can be downloaded from the Android Market. Just search for its name or click on these links with the browser of your Android smartphone:
FULL version - market://search?q=pname:com.wepromite.oneminutegame
LITE version - market://search?q=pname:com.wepromite.oneminutegamelite
View 7 Replies
View Related
Aug 26, 2010
I know this is more of a general programming question, but my Android friends here have always been helpful. I am trying to make an image move from one part of the screen to a position the user touches, as a constant speed. I don't know the best way to go about doing this and the way I have been trying to get to work is taxing my brain too much.
I have been using geometry to calculate slope, then using Sin * movement speed to calculate the difference in X,Y coordinates.
This is the codecode...
The problem that I'm having is the image is veering way of course when traveling in Y heavy paths. When traveling horizontally it works almost perfect.
I know there is probably an easier way though I don't know how to use a lot of things (like OpenGLES) so if your advice is to use a different method please link a tutorial for that method if you know of one.
View 7 Replies
View Related
Aug 24, 2010
Now I have (1: the UI-loop, there my SurfaceView is placed), (2: a second thread, there the draw function from the UI-loop is called AND the update calculations from my Engine) and (3: the engine, there all the calculations stuff are).Now I wonder how the best and smoothest way to do the SurfaceView independent from the actual frame rate. How shall I do so it will compensate if there is a low frame rate?
View 2 Replies
View Related
Oct 30, 2009
I have had several emails from people with HTC Tattoo devices who say they cannot find my app in the Market.
After reading this page (http://d.android.com/guide/practices/ screens_support.html) I believe I have to add the <supports-screens> tag to my manifest file. However, when I try to do this I am confronted with "Error no resource identifier found for attriute support-screens in package 'android'" messages. What does one have to do to update their manifest to tell the market an app supports all screen sizes?
Furthermore, if I need to change the android:minSdkVersion from "3" to something higher or add the android:targetSdkVersion tag, will this prevent people with older versions of Android from using my application?
View 4 Replies
View Related
Apr 8, 2010
Surprisingly, I don't seem to have issues with the OpenGL side of things (which is very unusual), but my problems stem from getting a clear idea for app architecture and a few other problems. Right now, most tutorials on the net just describe the render portion. I know that when I create a GLSurfaceView and hook a Renderer into it, it uses it's own thread for rendering.
I want to do logic operations and other gameplay stuff (like moving characters and whatnot) in it's own thread as well. Can anyone explain a good approach to this? I'm guessing the two threads will have to be synchronized (do logic, render, repeat), and limited based on time so that it performs smoothly across different devices.
View 1 Replies
View Related
Apr 13, 2010
I've read the Android documentation:
http://developer.android.com/guide/practices/screens_support.html
but still have some questions. I'm trying to design a music application which basically has images of the instrument (ImageButton) that play a sound when clicked. However, I'm confused about how to have the ImageButtons scale to fit all the different screen sizes and how to position them.
Which layout is best used for needing to position ImageButtons in specific locations on the screen? (i.e. cymbals on a drum set) FrameLayout, RelativeLayout? If I only really care about medium and large screens, do I need to create different resources (images) for both as well as a different XML layout to position them? I'm trying to find the simplest way to do this without having to create a separate layout XML file for positioning/size and separate image resources for each screen.
View 1 Replies
View Related
Nov 2, 2010
when a "contact detail" screen is presented in the contacts application, how is each field aggregated from its underlying raw contacts
case 1: Overlapping fields
when the same field exists in two or more contacts. Say they have two different last names or emails in different accounts. Does the contacts app show both fields with an account indicator?
case 2: Non overlapping fileds
one rawcontact has email while the other one has phone number
Short of scouring the source code, I have exhausted searching everywhere else.
View 2 Replies
View Related
Jun 26, 2010
We write a game application where we load bitmaps continuously. I would like to capture the content as video. I know through DDMS, I can capture the screen shot, but how do I capture series of bitmaps loaded?
View 5 Replies
View Related
Jun 27, 2010
I'm making a simple 2d game for the android platform, which works perfectly from version 2.0 and above, but when testing it on a 1.6 device, it crashes immediately. On running the debugger, it seems that I'm getting a null pointer exception in the thread class. I was just wondering if anybody has any ideas as to where the problem might be.
Maybe there's some compatibility issues with this code that I'm not aware of--I'm very much a beginner when it comes to using threads.
View 3 Replies
View Related
Apr 1, 2012
i am trying to make a game for android but am finding it difficult. For my app i have made the menu screen, sound. But to make the actual game i am not sure where to start.I am not sure how to start making the game. I have seen some tutorials but they seem to be very confusing with all the coding.
I was wondering is there not some sort of graphical layout i can use to make the games a i did to create the buttons using the xml graphical layout in eclipse.It is for my final year project and i do not have much time left or i would have done it in flash.
View 1 Replies
View Related
Feb 17, 2010
I am creating a game using the irrlicht c++ 3D graphics engine port to android platform. The graphics engine is written in c++. I need to be able to load meshes and textures etc from c++ code. My current plan is to place all the game asset files in either the res/raw directory or the assets directory then on start-up copy these files to the sdcard so they are accessible from the irrlicht c++ code.Is this the best way to make the game media files accessible from c++?
View 2 Replies
View Related
Dec 3, 2009
I am getting my feet wet developing software for the Android. My test app will have multiple screens (each having their own layout file). The main screen will direct the user to view the other screens based on user input. I kinda see this as layers of cake. Bottom layer being main; then you add and remove layers as the user makes UI inputs. The crazy trouble is how to view a second layer. I have created a second class which has its own onCreate method, which has its on setContentView(R.layout.secondlayer).
This class extends Activity much like my primary class does. I have a click event on a button within the main layout. This button will instantiate the new second layer class which I have done. And that is where my story endsI don't know what to do from this point. This is surely a newbie question If someone has an example that would be extremely helpful teach me to fish and I will be on my way.
View 6 Replies
View Related
Oct 9, 2009
I am working on an application where I wish to have multiple screens (each of full display size) attached to each other horizontally, and switch between them by using the finger (swipe right / swipe left). The home screen does exactly what I want, but its implementation seems to be more complex than I thought. What would be your preferred way to achieve this functionality? Is there any Layout or View that I could reuse? More generally, it should work with the 1.5 SDK, so the gesture interface is not available.
View 3 Replies
View Related
Oct 29, 2010
Could it be possible to make each screen have a different wallpaper while scrolling? I mean, taking as an example a case with three screens, it will be necessary to set a x3 screen width wallpaper to fit 1/3 on each screen, or directly setting different images for each screen. so the scrolling make it visually a different wallpaper on each screen rather than sliding the wallpaper a 50% each side.
View 2 Replies
View Related
Aug 15, 2010
I am working on an Android project where a group of buttons needs to show on the bottom of every screen (activity) in the application. The group of buttons are basically a navigation bar. I want to know the best way to do this without creating new buttons for every activity. I have been around programming (C++/C#) for many years but am pretty new to Android and Java so if someone can point me in a general direction.
View 2 Replies
View Related
Nov 11, 2010
I am trying to develop an application for which I want multiple screen support. I have read the Android article on Best practices for Multiple Screen Support. As per the article we have to follow 3 important things
1. Mention support for different screen sizes(large, medium and small) and any density in AndroidManifest.xml.
2. Place images of 3 dpi's (120, 160, 240) in 3 folders res/ldpi, res/mdpi and res/hdpi.
3. In layout's the dimension should be mentioned in "dip" units. Then Android will take care of the scaling on its own.
I have implemented all these points in my project. The images are picked up correctly from the appropriate folders. But the arrangements of the controls in not same.
e.g. I ran the app on three emulators
1. Resolution 240*320 dpi 120.
2. Resolution 240*320 dpi 160.
3. Resolution 240*320 dpi 240.
(All the emulator have same resolution but different density.)
The problem is the position of the controls is not same on all the three emulator. As per my understanding if the android:layout_marginLeft and android:layout_marginTop are mentioned in "dip" then this problem should not occur. As the density of the emulator increases the controls get placed more towards the right. Is it absolutely necessary that I provide layouts for all combination's of screen dimension and density even if the layout is same for all the devices?
Images:
https://docs.google.com/leaf?id=0By3GYC3k5AMDNzUwNjkwMWEtOGQzZC00MjQ0LWE2OTgtYjFhYzZmM2ExOGVl&hl=en&authkey=CLOEsZsI
View 1 Replies
View Related
Aug 2, 2010
I've just started to learn Android development and ran into a problem.Controls in the game I'm making work on virtual device, but not on phone:I have an Xperia X10 Mini Pro.I'm making a basic Pong game to learn droid software development.The game works just fine on my Android virtual device, you can move the paddles up and down smoothly.On my phone I've figured that the onKeyDown event doesn't run until I release the button or after I've held down the button for a second or two, but then it only registers it as a brief press of the button, not like if I was holding it down.I believe that it's a feature of my phone to quickly access special characters, because some keys register different key codes when pressed quickly and when held down.The problems this results in is that I can not move the paddles, but I can do single press things, like pause the game
View 1 Replies
View Related
May 11, 2010
Is there a way to move multiple apps between screens?
View 2 Replies
View Related
Jun 12, 2014
I have the galaxy S5 running 4.2.2
I hate having the phone wake up in my pocket after unlocking with either fingerprint or pin.
The phone is set to lock after 5 minutes of inactivity - but if bumped in the pocket, the phone wakes up without the swipe lock screen.
Is it possible to use a combination of two lock screen types?
View 3 Replies
View Related
May 5, 2010
I have a written a game that works fine on the 'normal' 320x480 screen of my G1.
I tried it on a friends Xperia x10 and it leaves a large blank section on the right hand side of the screen. How do I fix this? I've read that I need to include an extra directory in res/drawable for different densities. How do I do this?
View 1 Replies
View Related
Jul 12, 2010
I am new to android. For getting more number of downloads. I will make application in Android 1.5 version. How can I support multiple screen resolution from android 1.5 version. Is there any problem develop application in Android 1.5 and release in market. Is it visible to higher version mobile market for downloading apk file.
View 5 Replies
View Related
Mar 31, 2010
I am looking for a tutorial that explains the logic for fast, robust location finding.Basically I am sick of Google Maps finding my location so incredibly fast and accurately while my own application struggles to get a location.I would be fine with pseudo code responses and I will explain what I am doing so maybe I can be shown what I am doing wrong.
1. Get the locationManager object.
2. Do a 'get best provider' call.
3. Get a list of all available providers.
4. lm.requestLocationUpdates(bestProvider, 0, 0, this); hit the location provider as much as I can to get my first signal
5. Send a delayed message.If a location cannot be found in 10 seconds, switch to a different provider and try again with lm.requestLocationUpdates(nextProvider, 0, 0, this);
6. Repeat step 5 until I have a location.
7. Once a location is found determine if it is the most accurate provider.If it is not try again with the most accurate provider on an 8 second delay.If it is the most accurate provider then set lm.requestLocationUpdates(currentProvider, 30000, 0, this); to conserve battery
8. Make sure to lm.removeUpdates(this); before changing the requestLocationUpdates
Now it occurs to me that it may be possible to iterate through my list of providers and do requestLocationUpdates for all providers at once.Is this a viable option or can you only listen to one provider at a time?I have seen that location from onLocationChanged has getProvider()to let you know who provided the location information so that I can know which provider is actually finding a signal and turn off the others.
View 5 Replies
View Related
Jun 19, 2009
I have a ListView. When I click a row Item (which are just TextView instances) I want them to remain hilighted (default orange color). The default behavior is that they flash orange.
Strangely, if I use the key pad (arrow up/down) to move between items, it has the exact behavior I want. Why is the logic different between using the keypad or with finger tapping?
View 7 Replies
View Related
May 1, 2010
I am calling a PreferenceActivity from another activity and then updating the application state (ie: changing the font size) on onActivityResult, based on the preference changes. I was thinking it would be better to put the state update logic in the PreferenceActivity. That way I don't have the duplicate the logic in each activity that calls the PreferenceActivity. What's the best or correct way to do this?
View 2 Replies
View Related