TWRP 2.8.3.0 Available for Supported Devices

The TeamWin Recovery Project (or TWRP, for short) has quickly become one of the most popular … more

Easily Generate and Export Material Design Palletes

For many people, it can be pretty difficult to create a palette of complementary colors. … more

Android One Expanding to Bangladesh, Nepal, and Sri Lanka

At Google I/O 2013, Google proudly announced that the Android operating system was … more

Android 5.0.2 Fixes 2012 Nexus 7! Sony’s Making a Google Glass Competitor? – XDA TV

Android 5.0.2 Lollipop is available for the … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] Emulator to Phone wth!

OP LuvinAndroid

3rd December 2010, 05:16 PM   |  #1  
OP Member
Thanks Meter: 2
 
42 posts
Join Date:Joined: Oct 2010
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?
3rd December 2010, 06:25 PM   |  #2  
Member
Thanks Meter: 2
 
72 posts
Join Date:Joined: 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...
3rd December 2010, 08:21 PM   |  #3  
OP Member
Thanks Meter: 2
 
42 posts
Join Date:Joined: 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
3rd December 2010, 09:29 PM   |  #4  
OP Member
Thanks Meter: 2
 
42 posts
Join Date:Joined: 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;
3rd December 2010, 11:03 PM   |  #5  
Member
Thanks Meter: 2
 
72 posts
Join Date:Joined: 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...
4th December 2010, 12:23 AM   |  #6  
OP Member
Thanks Meter: 2
 
42 posts
Join Date:Joined: 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>
Last edited by LuvinAndroid; 8th December 2010 at 06:23 PM.
4th December 2010, 01:44 AM   |  #7  
nemoc 23's Avatar
Junior Member
Flag Cyprus
Thanks Meter: 31
 
20 posts
Join Date:Joined: May 2009
More
you could debug your apps on the device using eclipse and see from the logcat where things go wrong

these may help
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
4th December 2010, 09:20 PM   |  #8  
OP Member
Thanks Meter: 2
 
42 posts
Join Date:Joined: Oct 2010
thank you I will look at those.

Is my layout XML file (look above) correctly structured, etc. ?
5th December 2010, 01:33 AM   |  #9  
nemoc 23's Avatar
Junior Member
Flag Cyprus
Thanks Meter: 31
 
20 posts
Join Date:Joined: May 2009
More
your xml is ok. i ran it on my phone and its loading just fine (it displays the same thing as the emulator)
5th December 2010, 01:50 AM   |  #10  
OP Member
Thanks Meter: 2
 
42 posts
Join Date:Joined: Oct 2010
Quote:
Originally Posted by nemoc 23

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

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes