1

I have an Android phone running version 2.2 of the android. The name of the phone is "Samsung Galaxy S fascinate". Its the Canadian version of the Galaxy S I think. Now, I have a lot of things saved on this phone especially on my SD card.

Recently I have been busy developing my game on Canvas, SurfaceView. You can see my XML code on the bottom. I have been testing my game on my Eclipse emulator, but now since my game has multi-touch, I want to test it on my own android device.

Also I have Samsung kies installed on my computer.

Now can you please, tell me a SAFE WAY to test my game on my phone without the possibility of my phone memory or anything else getting corrupt or something like that?

Please give me a detailed answer with step by step instructions, because I am just 15 years old (and if I break my phone, my parents will be really mad)

Please also tell me things that I would need to add to my XML file, to make it safe to run my game on my phone.

So guys just tell me a step by step way to help run my game code on my phone...my code is actually safe because it's just moving pictures in a loop in surfaceView. I just want to make sure that eclipse is safe for my device, and i want to make sure that running on my phone won't destroy my files, pictures and other memory stuff

Here is my manifest file.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.spaceshipgame.game"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="10" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".Splash"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
     <activity
        android:name=".MainGame"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.spaceshipgame.game.MAINGAME" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    </application>

</manifest>
Jk1
  • 11,233
  • 9
  • 54
  • 64
Zunair Syed
  • 172
  • 4
  • 13
  • 1
    What do you consider as safe? If you trust your own code and think your computer has no android-debug-bridge-specific viruses or similar stuff (not sure if that even exists), I don't see a reason not to use the debug mode. – dst Aug 19 '13 at 03:48
  • What is the "debug mode"? And my program is basically drawing stuff in surfaceView, and moving pictures....therefore, my code is probrably safe, but i don't want to ruin my phone by using eclipse on it, because i think that it might wreck the memory of my phone somehow... – Zunair Syed Aug 19 '13 at 06:21
  • IF i am wrong, please tell me... – Zunair Syed Aug 19 '13 at 06:22
  • The "debug mode" is starting your app from Eclipse using the Debug button (the "bug" button left to the run button in the Eclipse toolbar). This enables you to set breakpoints in the code, and when the execution hits that point in code, it is paused in the code, and you can single step one by one code line, and look at variable values etc. – awe Aug 19 '13 at 07:12

1 Answers1

2

It is perfectly safe to test the app (game) on your phone. Eclipse is not actually running on your device. What it does is it sends an install package to your phone that installs your app in much the same manner as if it was installed from anywhere else in normal way. What Eclipse does in addition is that it is sniffing on some log messages that is written by the apps. This is perfectly safe.

  1. Since you have already installed Samsung Kies on your computer, you will have the necessary drivers installed.

  2. All you need to do is to open your project in Eclipse, and then run as Android Application.

  3. Then you are prompted to run on a device, you select your phone from the list of running devices.

  4. When you click OK on this, your app will be sent to your phone as an .apk file, and then installed.

  5. After installing, it will run automatically. You will see some logging of this process in the Console window in Eclipse, and more detailed logging in the LogCat window. Then you will see your app start on the phone. LogCat in Eclipse will also display any logging you do from your app code.

Note 1:
Your app will just be reinstalled the next time you start from Eclipse. If it is running, it will first be closed automatically.

Note 2:
After installed from Eclipse, your app will remain on the phone as any other installed app, so you can run it normally when not connected to your computer.

If you want to uninstall it from your phone, you can do this from the Application Manager in Settings.

Answers to your comments:

  1. You don't have to enable "unknown sources" when installing/running from Eclipse, but you must do that if you want to send .apk in email and install it from there.

  2. You don't have to make the connection type charge only, just make sure you don't run Samsung Kies so that no syncronising is done.

  3. You do not need to set android:debuggable="true". Actually it is recommended that you don't. When you start from debug mode in Eclipse, it will automatically be "debuggable".

  4. You can choose to email the .apk and run it from there. In this case you must enable to install from "unknown sources". There are no security risks for this when installing your own app, but to be sure, you should turn off "unknown sources" again after you have installed it. This is to prevent any "accidents" by clicking on some link on web sites or emails not sent by you, that will install a potentially harmful app that is not verified by Google Play (which is the reason for this setting in the first place).

awe
  • 21,938
  • 6
  • 78
  • 91
  • nice answer, but i want to ask a couple of things....1) do you have to enable the "Unknown Sources" option under "Security" of your Android device? – Zunair Syed Aug 19 '13 at 07:34
  • 2) in this question, [link](http://stackoverflow.com/questions/5987316/eclipse-doesnt-find-my-device) rekaszeru says that you need to make your connection type charge only....is that nesscesary and if yes, where do you make it so it's charge only? – Zunair Syed Aug 19 '13 at 07:37
  • 3) do you need to add android:debuggable="true" to the XML file? it says in this question you do [link](http://stackoverflow.com/questions/5807503/is-there-a-way-to-test-android-applications-directly-on-phone-without-the-emula) – Zunair Syed Aug 19 '13 at 07:40
  • One Last thing, can you email the APK file to my email account and run it from there? is there a difference? is it just like as you would do it normally with eclipse? I don't really need log stuff and i don't even use them... – Zunair Syed Aug 19 '13 at 07:42
  • Ok thanks so much. But if i enable "unknown sources" and send my .apk in email and install it from there, would there be any safety issues or any possibility that my phone's memory could go corrupt or no? I just want to make sure, because my parents will kill me if i corrupt my phone – Zunair Syed Aug 19 '13 at 07:54
  • I have added all the answers to your comments into my answer, so it is easier to read. – awe Aug 19 '13 at 10:54
  • hi just one more speculation. My friend who's really smart at tech stuff, told me that if my app uses too much CPU usage, it could be harmful to my phone, is that true? i don't even know how to check cpu usage? thanks – Zunair Syed Aug 19 '13 at 18:16
  • and hey, if u have some extra time, and if you could really help me, can you skim through this code to see if there is something that will be bad for the phone...(its just moving pictures and some logic on surfaceView, but can you check please?) [link](http://stackoverflow.com/questions/18066928/android-how-to-eliminate-lag-and-improve-fps-in-android-canvas-surfaceview) – Zunair Syed Aug 19 '13 at 18:49