[Q] Emulator to Phone wth!

Search This thread

LuvinAndroid

Member
Oct 26, 2010
42
2
So my game and all of it's several revisions have worked great in the Emulator, but for whatever reason, my games will not work on ANY Android Phone !!! I've tried 4 types.

All it does is show me my background and nothing in the foreground. No events, sounds, nothing.

So why does most of Googles stuff FAIL SO BAD!!! when people try to use it?

What do you guys use?

I am a graphics artist and I have 3 games ready that look killer, but cannot get them to a market or even a phone.

So do I leave android, or are there solutions for getting things from Eclipse/SDK-ADV to a running state on a freaking phone? :confused::mad::confused::mad:
 

rastanthology

Senior Member
Oct 18, 2010
73
2
mmm what are you using for the games: canvas, opengl es 1.0 JSR 239 or opengl es 2.0? which devices are you trying to run them into? are the device screen size in the same resolution that the emulator?

Though i really don't see this problem in opengl since the emulator does not have graphics acceleration... So you are using canvas, right? have you check that all your imports are compatible with the version of android of the phones you are testing them? remember that canvas is not accelerated on phones, whereas in the emulator it is, so maybe, if it is too graphic intensive, that might be part of your problem

I've never run into this problem, but I use mostly opengl frameworks, that btw are a pain in the ass to debug with the emulator but work great on the phones (5 vs 40-60 fps)...

For 2d I use andengine, its an opensource gl es 1.0 framework, compatible with devices from 1.6

For physics I use Box2d, that it is an opensource physics jni framework compatible from 2.* if i recall right.

For 3d i have not done anything yet. But you could try using opengl or there is a port of an opensource java 3d framework, can't recall its name, but it was something like jp**-ae i think, probably someone would say its name or you may find it using the search of the forum, cause i read that one in a post from here a few months ago...

I personally don't use canvas, since i find andengine much more usefull and faster for 2d...
 

LuvinAndroid

Member
Oct 26, 2010
42
2
I am loading all the graphics/buttons via the xml layout using LinearLayout.

I recently read that "fill_parent" is a bad idea in the layout.xml so I replaced those with "wrap_content"...still have yet to test on the phone.

I am basically just trying to the SkellyApp to even run on my phone, not even snake will go onto it.

I do not use canvas, gps, bluetooth or anything, just touch stuff and text.

I'm still left confused :(
 

LuvinAndroid

Member
Oct 26, 2010
42
2
Here are the Imports I am using;

import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import android.view.MotionEvent;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.view.View.OnTouchListener;
import java.util.Random;
 

rastanthology

Senior Member
Oct 18, 2010
73
2
you still missing something for us to see what the error is


the fill_parent / wrap_content are just properties, is not that its going to produce that error... it is recommended to use RelativeLayout, just for making it easier to port it to different screen sizes

if you don't want to mess much with the layout settings you could use droiddraw ;) (droiddraw.org)

other than that I don't know what you are doing wrong, have you try logcat to see if you spot an error somewhere? you will probably find your answer there...
 

LuvinAndroid

Member
Oct 26, 2010
42
2
I appreciate you sticking with me on this...here is my layout file...is there a problem with me using 2 Linears?

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:eek:rientation="horizontal"
android:background="@drawable/bg2"
>


<LinearLayout
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:eek:rientation="horizontal"

>

<!-- android:background="@drawable/blank"-->

<Button android:id="@+id/back" style="@style/ActionButton"
android:text="@string/back"
android:layout_width="45dip"
android:layout_height="45dip"
android:layout_alignParentLeft="true"
android:layout_marginLeft="44dip"
android:layout_marginTop="2dip"
android:layout_alignParentTop="true"
android:layout_centerInParent="true"
android:layout_gravity = "center"
android:background="@drawable/green"
/>

<Button android:id="@+id/clear" style="@style/ActionButton"
android:text="@string/clear"
android:layout_width="45dip"
android:layout_height="45dip"
android:layout_alignParentLeft="true"
android:layout_marginLeft="-12dip"
android:layout_marginTop="35dip"
android:layout_alignParentTop="true"
android:layout_centerInParent="true"
android:layout_gravity = "top"
android:background="@drawable/green"
/>




</LinearLayout>


<Button android:id="@+id/butone"
android:text="@string/butone"
android:layout_width="65dip"
android:layout_height="65dip"
android:layout_marginLeft="-349dip"
android:layout_marginTop="158dip"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_gravity = "bottom"
android:background="@drawable/glow1"
/>

<Button
android:id="@+id/b3i"
android:text="@string/b3i"
android:layout_width="120dip"
android:layout_height="120dip"
android:layout_marginLeft="-120dip"
android:layout_marginTop="95dip"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_gravity = "top"
android:background="@drawable/b3"
/>



<TextView android:id="@+id/text1"
android:layout_marginLeft="-89dip"
android:layout_marginTop="27dip"
android:layout_width="50dip"
android:layout_height="30dip"
android:textStyle="bold"
android:textColor="#B9B888"
android:freezesText="true"
/>

<TextView android:id="@+id/text2"
android:layout_marginLeft="12dip"
android:layout_marginTop="201dip"
android:layout_width="50dip"
android:layout_height="30dip"
android:textStyle="bold"
android:textColor="#B9B888"
android:freezesText="true"
/>
<TextView android:id="@+id/text3"
android:layout_marginLeft="-160dip"
android:layout_marginTop="201dip"
android:layout_width="50dip"
android:layout_height="30dip"
android:textStyle="bold"
android:textColor="#B9B888"
android:freezesText="true"
/>

<Button
android:id="@+id/exitbutton"
android:layout_width="35dip"
android:layout_height="35dip"
android:layout_marginLeft="222dip"
android:layout_marginTop="-37dip"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_gravity = "top"
android:background="@drawable/exit"
/>

</LinearLayout>
 
Last edited:

nemoc 23

Member
May 10, 2009
21
65
Cyprus
alterbytes.com
you could debug your apps on the device using eclipse and see from the logcat where things go wrong

these may help
Code:
http://xdaforums.com/showthread.php?t=821022&highlight=debugging
http://dotnet.dzone.com/articles/android-and-windows-phone-7-%E2%80%93
 

LuvinAndroid

Member
Oct 26, 2010
42
2
Oh boy...so I created more AVD's using the other size options like 400,432,800,854, and my XML Layout above puts my buttons in different screen locations depending on the AVD used, only the default and the 432 show it the way I need.

How does a person go about making sure their buttons are in the same spot every time for all resolutions using the XML Layout, or another version of mine in the post above?

Sorry to ask for another favor, but this seems too nebulas for me to grasp atm, so a push in the right direction would be great :eek:
 

Futur Innovations

Senior Member
Nov 18, 2010
563
39
futurinnovations.blogspot.com
What were the four devices you tried. Even simple applications can change depending on the devices oem. I have a HTC Droid Incredible and simple things like radio buttons look different than the emulator, so I would see if it is an HTC/Samsung/whatever problem rather than an android problem. I could be wrong, but I have noticed that simple things change, so why not more complex things?
 

Futur Innovations

Senior Member
Nov 18, 2010
563
39
futurinnovations.blogspot.com
Oh boy...so I created more AVD's using the other size options like 400,432,800,854, and my XML Layout above puts my buttons in different screen locations depending on the AVD used, only the default and the 432 show it the way I need.

How does a person go about making sure their buttons are in the same spot every time for all resolutions using the XML Layout, or another version of mine in the post above?

Sorry to ask for another favor, but this seems too nebulas for me to grasp atm, so a push in the right direction would be great :eek:

It seems that using linear layouts as a base caused the different resolutions to not be created the same. I use a single relative layout as the parent layout, and several views (text, image) and buttons and center everything. I would try surrounding the current xml in a single RelativeLayout, and if that doesn't work, then try breaking each LinearLayout up and converting them to RelativeLayouts (which may seem like a pain because you have to make every item's position relative to the items around it, so it can be tricky to position them exactly right). You could also use a combination of Relative and Linear Layouts to achieve the look and feel you desire for the overall layout. Hope this helps :)