FORUMS

Beats Music No Longer Accepting New Accounts

Whenever Apple launches a new product or service, it definitely manages to grab the … more

Do You Do Self-Repairs on Your Devices?

As smartphone designs become more and more complex, self-repairs on devices are also becoming … more

Sony Z4 Slips Out of Top 5 Smartphones in Japan

In a bid to streamline its flagship series which had been losing credibility over the … more

Sprint’s New Unlimited Plan with Ridiculous Capped Speeds

The carrier game in the United States is perpetually rushing forward at … more

[Q] Emulator to Phone wth!

42 posts
Thanks Meter: 2
 
By LuvinAndroid, Member on 3rd December 2010, 04:16 PM
Post Reply Subscribe to Thread Email Thread
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, 05:25 PM |#2  
Member
Thanks Meter: 2
 
More
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, 07:21 PM |#3  
OP Member
Thanks Meter: 2
 
More
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, 08:29 PM |#4  
OP Member
Thanks Meter: 2
 
More
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, 10:03 PM |#5  
Member
Thanks Meter: 2
 
More
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...
3rd December 2010, 11:23 PM |#6  
OP Member
Thanks Meter: 2
 
More
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 05:23 PM.
4th December 2010, 12:44 AM |#7  
nemoc 23's Avatar
Junior Member
Flag Cyprus
Thanks Meter: 55
 
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, 08:20 PM |#8  
OP Member
Thanks Meter: 2
 
More
thank you I will look at those.

Is my layout XML file (look above) correctly structured, etc. ?
5th December 2010, 12:33 AM |#9  
nemoc 23's Avatar
Junior Member
Flag Cyprus
Thanks Meter: 55
 
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, 12:50 AM |#10  
OP Member
Thanks Meter: 2
 
More
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