Connecting Your Own Device On Eclipse safely to run Application

╄→尐↘猪︶ㄣ 提交于 2019-12-11 14:44:20

问题


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>

回答1:


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).



来源:https://stackoverflow.com/questions/18306087/connecting-your-own-device-on-eclipse-safely-to-run-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!