Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,738,920 Members 42,812 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Emulator to Phone wth!

Tip us?
 
LuvinAndroid
Old
#1  
Member - OP
Thanks Meter 2
Posts: 42
Join Date: Oct 2010
Default [Q] Emulator to Phone wth!

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?
 
rastanthology
Old
#2  
Member
Thanks Meter 2
Posts: 72
Join Date: Oct 2010
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
Old
#3  
Member - OP
Thanks Meter 2
Posts: 42
Join Date: Oct 2010
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
Old
#4  
Member - OP
Thanks Meter 2
Posts: 42
Join Date: Oct 2010
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
Old
#5  
Member
Thanks Meter 2
Posts: 72
Join Date: Oct 2010
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
Old
(Last edited by LuvinAndroid; 8th December 2010 at 05:23 PM.)
#6  
Member - OP
Thanks Meter 2
Posts: 42
Join Date: Oct 2010
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"
androidrientation="horizontal"
android:background="@drawable/bg2"
>


<LinearLayout
android:layout_width="wrap_content" android:layout_height="wrap_content"
androidrientation="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>
 
nemoc 23
Old
#7  
nemoc 23's Avatar
Junior Member
Thanks Meter 0
Posts: 17
Join Date: May 2009
Location: Greece
you could debug your apps on the device using eclipse and see from the logcat where things go wrong

these may help
Code:
Select Code
http://forum.xda-developers.com/showthread.php?t=821022&highlight=debugging
http://dotnet.dzone.com/articles/android-and-windows-phone-7-%E2%80%93
 
LuvinAndroid
Old
#8  
Member - OP
Thanks Meter 2
Posts: 42
Join Date: Oct 2010
thank you I will look at those.

Is my layout XML file (look above) correctly structured, etc. ?
 
nemoc 23
Old
#9  
nemoc 23's Avatar
Junior Member
Thanks Meter 0
Posts: 17
Join Date: May 2009
Location: Greece
your xml is ok. i ran it on my phone and its loading just fine (it displays the same thing as the emulator)
 
LuvinAndroid
Old
#10  
Member - OP
Thanks Meter 2
Posts: 42
Join Date: Oct 2010
Quote:
Originally Posted by nemoc 23 View Post
your xml is ok. i ran it on my phone and its loading just fine (it displays the same thing as the emulator)
Thanks again for your help, I'm glad it's working...guess I am learning something

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...