ant scripts to build apk file and load it in a emulator?

by jrichards1...@googlemail.com » Mon, 19 Jul 2010 16:52:20 GMT


Sponsored Links
 i.

i am trying to create a build.xml script that cleans, builds and
creates a apk file of a Junit android test project that i have
created.

the steps i want to achieve in my build file is this:

[list=]clean[/list]
[list=]build[/list]
[list=]create apk file[/list]
[list=]Sign apk file[/list]
[list=]launch emulator[/list]
[list=]install apk file[/list]
[list=]run instrumentalTest[/list]
[list=]Save the tests into an HTML Junit Report[/list]

Anyone know how to achieve this? so far my build file looks like this:

[code]<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply

create one in the same
directory with the processing instruction <?

eclipse.ant.import?>
as the first entry and export the buildfile again.

-->
<project basedir="." default="build" name="Unity Agent SDK Test">
<property environment="env" />
<property name="junit.output.dir" value="junit" />
<property name="debuglevel" value="source,lines,vars" />
<property name="target" value="1.6" />
<property name="source" value="1.6" />
<property file="build.properties" />
<path id="android1.6.userclasspath">
<pathelement location="lib/android.jar" />
</path>
<path id="Junit.userclasspath">
<pathelement location="lib/junit-4.8.2" />
<pathelement location="lib/
org.hamcrest.core_1.1.0.v20090501071000.jar" />
</path>
<path id="Unity Agent SDK Test.classpath">
<pathelement location="bin" />
<pathelement location="lib/fb_connect-android-api.jar" />
<pathelement location="lib/signpost-commonshttp4-1.2.jar" />
<pathelement location="lib/signpost-core-1.2.jar" />
<pathelement location="lib/UnityAgentSDK.jar" />
<path refid="android1.6.userclasspath" />
<path refid="Junit.userclasspath" />
</path>

<path id="android.antlibs">
<pathelement path="${android-sdk-path}/tools/lib/anttasks.jar"
/>
<pathelement path="${android-sdk-path}/tools/lib/sdklib.jar" />
<pathelement
path="${android-sdk-path}/tools/lib/androidprefs.jar" /
<pathelement
path="${android-sdk-path}/tools/lib/apkbuilder.jar" />
<pathelement path="${android-sdk-path}/tools/lib/jarutils.jar"
/>
</path>

<path id="run.Unity Agent SDK Test (1).classpath">
<path refid="Unity Agent SDK Test.classpath" />
</path>
<path id="run.Unity Agent SDK Test (1).bootclasspath" />
<target name="init



Other Threads

1. cara ganti ringtone u/ SMS di Magic

Rekans, ada bbrp pertanyaan nih :
1.gimana ya caranya ganti ringtone yg buat sms di HTC Magic??udah coba move
atopun copy dari SD ke folder yg di media |      notification, ttp aja ga
bisa.
2. kenapa browser bawaan ga bisa dipake?pdhl connect i-net sudah bisa
3. kenapa alarm ga bisa kluar suaranya??
 Maklum nih...baru 2 malem pake Magic,hehee...
Tq

-- 
Regards,
Eko's

--~--~---------~--~----~------------~-------~--~----~
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group, please visit the following page:
 

2. How to add a view to application layout programmatically

Hi,


I want to add an ImageView to my layout when a button has been
pressed. Sadly, I cannot get a handle to the main application's
linearlayout, I always get a null pointer error when trying to
retrieve the layout using findViewByID.

Here's the code that ought to display the image when button b has been
pressed, but I think I have missed something obious:

package com.foo.bar;

import android.app.*;
import android.os.Bundle;
import android.view.*;
import android.view.ViewGroup.LayoutParams;
import android.widget.*;
import android.content.*;
import android.util.Log;


public class AndroidTest extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

     // assign flag.png to the button, loading correct flag image for
current locale
        Button b;
        b = (Button)findViewById
(R.id.flag_button) ;//.setBackgroundDrawable(this.getResources
().getDrawable(R.drawable.developers));

        // build dialog box to display when user clicks the flag
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setMessage(R.string.dialog_text)
            .setCancelable(false)
            .setTitle(R.string.dialog_title)
            .setPositiveButton("Done", new
DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                dialog.dismiss();
                }
            });
        final AlertDialog alert = builder.create();

        // set click listener on the flag to show the dialog box
        b.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                // alert.show();
                ImageView image;
                image = new ImageView(v.getContext());
                image.setImageDrawable(v.getResources().getDrawable
(R.drawable.developers));


                LinearLayout main = (LinearLayout)
AndroidTest.this.findViewById(R.layout.main);
                // some debug code
                if (main == null)
                {
                        Log.v("abc", "Main is null");
                        }
                else
                {
                main.addView(image, 200, 200);
                }
            }
            });

    }
}

--~--~---------~--~----~------------~-------~--~----~

3. Any way to update the Framework changes in build without rebuilding all ?

4. using servlet in mobile with Android platform

5. resource with name from numbers

6. Android Software Engineer - 15.000 PLN / m-c

7. profiles manager