Planet Android

February 09, 2010

Again and again, she’s right.


Comments are useless, the picture talks by itself.

Ref : http://www.tapntap.com/

Do not know if this will be under Open Source licence. However, what I know is that Android is under APL 2.0. (Well, if remember well).
So, we are at least in the halfway.

BR
Frederic ;)

by Frederic Hornain at February 09, 2010 12:30 AM

She ’s right !


Dear *,

Two days ago, my wife asked me the following question :

As Android is based on Linux, does it exist a mean to run – natively – apk – Android Application – on Fedora without using the Android SDK Emulator ?

I admit I did not know at that time the answer neither the interest.

Well after all, apk is made with java and java applications can be ran on Fedora….
However it can not and it is sad.

Nevertheless our friends of Ubuntu had the idea : “Android Execution Environment” .
And I believe now it is a really really good one however it is not available yet. :(

Coincidence or not, my wife asked me that question without knowing Apple was going to announce their I-Pad from Apple which is more and less the same idea.

Now, I see the interest and it is HUGE !
For my part, I am convinced this is one of the ways to go.

BR
Frederic ;)

Ref : http://groups.google.com/group/android-developers/browse_thread/thread/647b80f8b43c1dda

by Frederic Hornain at February 09, 2010 12:30 AM

Android and Fedora….



Dear *,

As my wife is currently working on a development of an Android Application, so she charged me to install the SDK on a Fedora.
Unfortunately, no RPM was available for that. :(

So I tried to create one from the source however it was no so simple than that. :(
Firstly the SDK source code was not easy to find due to the fact that it is included in the entire Android platform project instead of to be on separate repository.
FYI, the source code is available Source.android.com.
Then I followed the procedure to get the code – http://source.android.com/download – but I was a little bit lost to retrieve what I was looking for.
I tried to make the package but I gave up after four hours by lack of time and principally cause I had to respond quickly to my wife request.

So, I installed it with the tgz and the standard procedure provided by our friends of Google in order to respond to her request quickly. – Well, I do not like install things like that -
Nonetheless, I will retry to create one. I will keep you in touch.

Ref : http://groups.google.com/group/android-developers/browse_thread/thread/fbb8f417687779bf

BR
Frederic ;)

http://groups.google.com/group/android-developers/browse_thread/thread/647b80f8b43c1dda

by Frederic Hornain at February 09, 2010 12:30 AM

February 08, 2010

MEANWHILE, IN AMERICA: Motorola DROID getting update to Android 2.1 “this week”

While European owners of the Euro-spec DROID (AKA MILESTONE) go completely insane over the lack of the Android 2.0.1 camera-fixing, bug-squashing release across most of the continent, the US branch of Motorola has thrown a bit of salt across the Atlantic and started rubbing it in – they’re “rolling out” Android 2.1 for the DROID from this week.

Here’s what Motorola US has just said, via the medium of a Facebook statement:

“Hi all– we know you are frustrated with the lack of details regarding Android software upgrades and we sincerely apologize for not being able to share info sooner. We’re happy to relay the 2.1 upgrade to DROID will start to roll out this week, and we will have more information to share on other device upgrades later this week as well. Thanks for your patience and continued support”

motorola droid android 21

We’re starting to get a bit bored of these endless firmware update stories, to be honest. Perhaps we should review more farting sound boards instead?

by EURODROID 00001 at February 08, 2010 11:53 PM

Writing Your Own AutoCompleteTextView


Hey everyone,

Haven’t posted in a while but thought I’d write an example about AutoCompleteTextViews and how to implement a custom one. Much of the code is very similar in nature to that of the custom CursorAdapter which I talked about in this post:

http://thinkandroid.wordpress.com/2010/01/11/custom-cursoradapters/

However, the main difference in this example is the fact that we are going to implement the Filterable class as this is what’s going to dictate what suggestions show up during the autocomplete process. As for the layout of each entry, I implemented this instance using JAVA (hence doing it programmatically) so this example does as an example of how you can write layouts using JAVA in lieu of XML. And so, the code snippet for the adapter itself is below:

public class ContactsAutoCompleteCursorAdapter extends CursorAdapter implements Filterable {

    private TextView mName, mNumber;

    public AutoCompleteCursorAdapter(Context context, Cursor c) {
        super(context, c);
        mContent = context.getContentResolver();
    }

    @Override
    public View newView(Context context, Cursor cursor, ViewGroup parent) {
        final LinearLayout ret = new LinearLayout(context);
        final LayoutInflater inflater = LayoutInflater.from(context);
        mName = (TextView) inflater.inflate(android.R.layout.simple_dropdown_item_1line, parent, false);
        mNumber = (TextView) inflater.inflate(android.R.layout.simple_dropdown_item_1line, parent, false);
        ret.setOrientation(LinearLayout.VERTICAL);

        LinearLayout horizontal = new LinearLayout(context);
        horizontal.setOrientation(LinearLayout.HORIZONTAL);

        // you can even add images to each entry of your autocomplete fields
        // this example does it programmatically using JAVA, but the XML analog is very similar
        ImageView icon = new ImageView(context);

        int nameIdx = cursor.getColumnIndexOrThrow(People.NAME);
        int numberIdx = cursor.getColumnIndex(People.NUMBER);

        String name = cursor.getString(nameIdx);
        String number = cursor.getString(numberIdx);

        mName.setText(name);
        mNumber.setText(number);

        // setting the type specifics using JAVA
        mNumber.setTextSize(16);
        mNumber.setTextColor(Color.GRAY);

        /**
         * Always add an icon, even if it is null. Keep the layout children
         * indices consistent.
         */
        Drawable image_icon  = null;
        if (carrier != CarrierInfo.NOT_CACHED && carrier != CarrierInfo.ERROR && carrier != CarrierInfo.NETWORK_ERROR) {
            image_icon = context.getResources().getDrawable(R.drawable.icon);
        }

        icon.setImageDrawable(image_icon);
        icon.setPadding(0, -2, 2, 6);

        // an example of how you can arrange your layouts programmatically
        // place the number and icon next to each other
        horizontal
                .addView(mNumber, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        horizontal.addView(icon, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

        ret.addView(mName, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        ret.addView(horizontal, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        return ret;
    }

    @Override
    public void bindView(View view, Context context, Cursor cursor) {
        int nameIdx = cursor.getColumnIndexOrThrow(People.NAME);
        int numberIdx = cursor.getColumnIndex(People.NUMBER);

        String name = cursor.getString(nameIdx);
        String number = cursor.getString(numberIdx););

        /**
         * Always add an icon, even if it is null. Keep the layout children
         * indices consistent.
         */
        Drawable image_icon  = null;
        if (carrier != CarrierInfo.NOT_CACHED && carrier != CarrierInfo.ERROR && carrier != CarrierInfo.NETWORK_ERROR) {
            image_icon = context.getResources().getDrawable(R.drawable.icon);
        }

        // notice views have already been inflated and layout has already been set so all you need to do is set the data
        ((TextView) ((LinearLayout) view).getChildAt(0)).setText(name);
        LinearLayout horizontal = (LinearLayout) ((LinearLayout) view).getChildAt(1);
        ((TextView) horizontal.getChildAt(0)).setText(number);
        ((ImageView) horizontal.getChildAt(1)).setImageDrawable(image_icon);
    }

    @Override
    public String convertToString(Cursor cursor) {
        // this method dictates what is shown when the user clicks each entry in your autocomplete list
        // in my case i want the number data to be shown
        int numCol = cursor.getColumnIndexOrThrow(People.NUMBER);
        String number = cursor.getString(numCol);
        return number;
    }

    @Override
    public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
        // this is how you query for suggestions
        // notice it is just a StringBuilder building the WHERE clause of a cursor which is the used to query for results
        if (getFilterQueryProvider() != null) { return getFilterQueryProvider().runQuery(constraint); }

        StringBuilder buffer = null;
        String[] args = null;
        if (constraint != null) {
            buffer = new StringBuilder();
            buffer.append(People.NAME + " IS NOT NULL AND " + People.NUMBER_KEY + " IS NOT NULL AND ");
            buffer.append("UPPER(");
            buffer.append(People.NAME);
            buffer.append(") GLOB ?");
            args = new String[] { constraint.toString().toUpperCase() + "*" };
        }

        return mContent.query(People.CONTENT_URI, Constants.PEOPLE_PROJECTION, buffer == null ? null : buffer
                .toString(), args, People.DEFAULT_SORT_ORDER);
    }

    private ContentResolver mContent;

}

And that’s it! So just a brief explanation (in addition to comments I put into the code at each section). Basically it works the same way as a custom CursorAdapter, but instead we implement the Filterable class as this will dynamically query our database for suggestions based off of what the user has typed into the AutoCompleteTextView. Then, we have a method called convertToString and that determines what field of the cursor gets converted to be displayed in your AutoCompleteTextView. I’m not sure what it defaults to typically, but at least in our example we want to specific between whether or not we want the contact’s name to be displayed or the contact’s phone number. When I wrote this AutoCompleteTextView, I wanted to query for the person’s contacts and allow them to quickly call that contact, and so it made more sense to display the phone number as opposed to the name.

With this you have a lot of control over not only what suggestions are displayed, but also what gets converted and how all of your information gets displayed.

So the one question remains – how does one implement this. So here’s a little code snippet on how to implement this example:

public class A extends Activity {

     @Override
     public void onCreate (Bundle savedInstanceState) {
            setContentView(R.layout.main);

            // R.id.auto_contact_edit is just an AutoCompleteTextView defined in the XML layout R.layout.main
            AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.auto_contact_edit);
           Cursor c = getContentResolver()
                .query(People.CONTENT_URI, Constants.PEOPLE_PROJECTION,
                        People.NAME + " IS NOT NULL AND " + People.NUMBER_KEY + " IS NOT NULL", null,
                        People.DEFAULT_SORT_ORDER);
           ContactsAutoCompleteCursorAdapter adapter = new ContactsAutoCompleteCursorAdapter(this, c);
           textView.setAdapter(adapter);
           // you can also prompt the user with a hint
           textView.setHint("type name");

           // rest of your code
     }
}

Pretty simple.

Hope this was helpful. Happy coding.

- jwei

by jwei512 at February 08, 2010 11:15 PM

Open Home v4 Now On The Market

After quite the stint of no updates, Better Android has finally released a rather large update of their Open Home app. Actually it was two updates, First v4.0 then another quick update a couple of days later to v4.3. Here are all the specs of the update directly from their site:

We are pleased to announce that Open Home (full version) is not now at its 4th major version v4.x . Here is a list of note-worthy changes/enhancements/features/bug fixes:

- Allow users to set the default fonts to any home screen widgets. Please note that only default fonts are changed because some widgets have custom fonts and we don’t want to give override them. (menu/more/font & color/Widget font)

- Performance enhancements from android 2.1, now home screen scrolling is much smoother, force close issues are gone for Motorola Droid and HTC Nexus One

- More home screen animations and effects, including an experimental 3D cube transition effect  (menu/more/Open home setting/3D cube)

- Live Wallpaper is now supported on Nexus One

- Home Chooser’s default setting check box now works as it should  (menu/more/home chooser)

It seems as though the 3D cube effect is still quite popular and unlike GDE's cube effect, this one is transparent meaning it doesn't matter what background you use. GDE's cube effect used the wallpaper wrapped around the cube so unless you had a wallpaper that matched at both ends it kinda looked bad.

After the initial update to Open Home, v4.3 was released a couple of days later with this added to it:

Yes, we released an update today again!

It has the same screen indicators as you would find in Android 2.1’s default Home screen. Long pressing the indicators will also give you a screen switcher just like in Android 2.1. We also added a fancier animation to home switcher to make it look even cooler. Enjoy!

I really like the 2.1 screen indicators that they added.

Overall this is a great update to Open Home with the transparent cube and screen indicators being two features I like the most. I really can't find anything wrong with Open Home after using it for some time now and the update only makes things better. Between the update and the overall app I give this a 5/5 stars rating. If you haven't updated your Open Home yet, you need to do so.

by ExtremeT (702records@gmail.com) at February 08, 2010 06:30 PM

Mobile World Congress Schedule 2010

Annual since 1987, Mobile world congress is the world’s largest exhibition for the mobile industry and with 47,000 in attendance last year, it’s safe to say that it’s worth mobile companies showing face. Since there is so much happening that week it makes sense to plan well ahead of schedule. Everyone has been sharing lists of events and excited talk but no maps. So I thought it might be worth me throwing in my plans in the hope that someone may benefit from my timings, maps and event lists. These timings are in no way guaranteed as a good judge of how you should spend your time but could help make sure you’ve not missed anything really beneficial. Most of my time is going to be spent in App planet but I really want to try and get around as many exhibition stands as I can in my rare few minutes in between. Feel free to say hello to me if you are in attendance. You can catch me on MotoDev’s panel of Android developers on Monday at 11:30am Hall 7.

WIP have very kindly developed an MWC attendance survival guide which I very much recommend if not just for the Exhibition floor plan.

Mobile World Congress 2010 address
Event Details – http://www.mobileworldcongress.com

View Larger Map

Monday

09:00 – MotoDev – Breakfast at Motodev in AppPlanet – Hall 7
11:30 – MotoDev – Android Developer Panel – Hall 7
11:30 – MotoDev – Maximise your Android Market Opportunity – App Planet – Hall 7
12:15 – MotoDev – Lunch with the experts – App Planet – Hall 7
14:00 – Mobile premier awards – Palau De La Música 4 08003 Barcelona, Spain 932 957 200
21:00> – Mobile premier awards dinner – Bel-Luna Jazz Club & Restaurant

MotoDev

More MotoDev event details…
Not much has been mentioned in the Android pres about the motodev sessions but I for one am interested in the opinions of anyone developing plugins for my IDE. They have a bunch of sessions planned at MWC a few of which I’ll be attending.

Mobile Premier awards

View event details
To get to the mobile premier awards take the Espanya tube to Urquinaona then walk straight down the road: Carrer de les Jon que res

View Larger Map

Mobile premier awards dinner

RSVP for the dinner here
A swanky affair after the award ceremony which promises to be both an interesting and beautiful meal.

View Larger Map

Tuesday

08:30 – Opportunities with on-device payments and preloaded content – Tanla MWC Seminar
08:00 – UKTI – Challenges in Japan – Location Sala D
11:30 – UKTI – Turkish / UK Partnering Event – UKTI stand?
17:00 – Scottish Development International – Whisky Reception – Stand, 1E66
18:00 – GoMo – Incognito BAR, calle Fusina 6, 08003 Barcelona, Spain
18:00 – Androiders Dinner at MWC

The Tuesday looks like it will be quite businessy until the evening where a bunch of Androiders will be getting together informally to chat and get dinner. So there is no official page or anything like that, just turn up or message someone who you know will be there(I’m @kevinmcdonagh) and we’ll be glad to have you in acquaintance. The plan is to prey on the hospitality of GoMo and turn up for their free bar and food. This plan should work win/win since a bunch of Android experts will be going to meet with mobile businessy people.

GoMo
Event details – http://www.facebook.com/#!/event.php?eid=180379714149&ref=ts
Here are some directions to get from Mobile World Congress to the GoMo event. I’ll be taking the Espanya Tube to Jamuel:

View Larger Map

Wednesday

08:30 - UKTI – UK / US Panel discussion – UKTI?
09:00 - Android dev lab (Games Dev) – Hall7 App world, MWC
12:30 - Sony Ericsson talk – App world Hall 7
14:00 - Tech crunch Mobile 2010
18:00> - Android cocktails – B Hotel in Gran Vía 389-391, Barcelona (next to MWC congress grounds)
18:30> - Swedish beers – Dostrece, carme 40, 08001, barcelona, Spain , 933017306
19:00> - Carnival of nations party – 7 Sins Bar, Muntaner 7, Barcelona, Spain

There is so much happening on the Wednesday sacrifices will have to be made. I’m really excited to get close to the participants of the Android developer session and get some basic questions out the way from the best in class. I do not currently plan to attend the Tech crunch event as I will instead be using the time to take part in Sony Ericsson’s training sessions. I’m also really looking forward to meeting the Barcelona user group at the Android Cocktails, I’ll have to split my time between this and Swedish beers which will inevitably be more businessy but essential.

Android Cocktails
Event detailshttp://eventuo.com/event/HN9foG5u6NI
An informal get together with the Barcelona Androids located beside MWC in the Nuñez i Navarro B Hotel

View Larger Map

Swedish Beers
Event Detailshttp://swedishbeers.blogspot.com/
A small scale yet still international event for businesses interested in mobile.
To Swedish Beers from the Android Cocktails event take the Espanya metro to Liceu:

View Larger Map

WIP Carnival of Nations party
Event Detailshttp://wipjam.com/party-carnival-of-nations/
In the unlikely event that I’ll have time to get to the Carnival of Nations event it is only 10mins walking distance away: Walking round the corner 10min away:


View Larger Map

Thursday

08:00 - GetJar Demo – App Planet Auditorium, Hall 7, FIRA, Barcelona, Spain
9ish -  WIP Jam – App Planet Auditorium, Hall 7, FIRA, Barcelona, Spain
11:45 – Join people Luncheoning form WIP – Hall 7
15:30 – More WIP Networking type interaction – Hall 7
18:00> Londroid – London Android Meetup

I’m obviously going to give the London Android Meeting a miss this time and instead I’ll be trying to make new WIP friends. Thankfully I can spend the whole day in the same place so no need for running to different locations.

Share this post: Print email Digg del.icio.us Reddit Twitter Google Bookmarks Facebook HackerNews Technorati PDF

by admin at February 08, 2010 06:30 PM

Motorola + Megan Fox = Super Bowl Win

Motorola revealed what their bubble bath inspired Super Bowl Commercial was all about: Megan Fox… and Android. The commercial reveals a daytime bathing Fox talking about her new Motorola Devour with MotoBlur, as she snaps a picture and wonders what would happen should she post it… The gay couple slap fighting is priceless. Tweet This! Share this [...]

by Nate at February 08, 2010 05:15 PM

HTC Leak of the Day: New spy shots of the HTC Legend

All-powerful blog Engadget has been sent a couple of spy shots of what is or will soon become the HTC Legend, the latest Android-powered smartphone to leak via HTC’s non-disclosure agreement-disregarding hardware testers.

It’s what you’d expect from an HTC-badged Android phone, except it features a very nice metallic surround and back, giving the Legend a little more star power than the rather generic-looking HTC Incredible we saw leak just yesterday.

htc legend 1 htc legend 2

More vague speculation about specs can be found over at Engadget – but apart from the fact that it clearly runs HTC Sense and has an optical trackball, no one knows anything else. Expect to see it officially announced next week, at MWC 2010.

by EURODROID 00001 at February 08, 2010 04:50 PM

Unlocked Nexus One coming to Play.com – with £599 price tag

We’re not entirely sure what’s going on here, but it would appear that online retailer Play.com is about to take delivery of a whole pile of Nexus Ones for direct sale in the UK, unlocked and SIM-free for connection to the network of your choice.

In a new listing on the extremely popular discount online store, Play is claiming it’ll be stocking the Nexus One from February 16 or, to put that in layman’s terms, next Tuesday. Here’s the all-important visual proof:

play nexus one unlocked

That £599 price tag is quite insanely inflated over what you’d pay importing one direct from Google (about £430), even taking into account import duties and delivery fees for shipping the Nexus to the UK. They won’t do much business if that price doesn’t drop pretty sharpish – it’s even more expensive than the X10.

With thanks to Pocket Lint.

by EURODROID 00001 at February 08, 2010 04:27 PM

Motorola MILESTONE hate campaign hits Amazon!

They’ve only gone and done it. The weekend’s call to arms for Motorola MILESTONE users to declare CYBERWAR on Motorola has got underway, with the Android phone’s Amazon listing today seeing the first effects of the war – a one-star review criticising Motorola’s lack of an Android 2.0.1 bug-fixing release in most of Europe.

Although the comment-leaver isn’t actually from Europe – he’s based in South Africa. Probably just the sort of chap who enjoys a good fight. A bit like us.

motorola milestone amazon war

Will these comments be allowed to stand? We hope so. While it’s a little unfair of Motorola users to expect the company to issue firmware updates over-the-air to all separate European territories immediately, there’s no denying Motorola’s been a bit tactless in its handling of the affair – which would be understandable, were the Euro-spec MILESTONE not crippled by the bizarre time-based camera glitch which renders the phone’s camera virtually useless.

by EURODROID 00001 at February 08, 2010 12:53 PM

Lexicon Pro

Lexicon Pro, a dictionary/thesaurus app with translations to more than 40 languages!! Features bookmarking, sharing, spelling correction, audio pronunciation (even in other languages) and more!

Price: Free, UK£1.20

AndroidTapp.com Android App Review:

Pros & Cons

Pros

  • Quick dictionary with thesaurus
  • Can translate definitions into many languages
  • Audio Pronunciation
  • Voice recognition search

Features:

Lexicon Pro Android App is an awesome dictionary/thesaurus tool. Not only can you search definitions but it goes farther by offering voice search, audio pronunciation, bookmarking, share with friends via other apps, and definitions can be translated in more than 40 languages.

Lexicon Bookmarks Lexicon Definitions and Thesaurus Lexicon Translate Options Lexicon Definition Translation in French Lexicon Search Word Lexicon Sharing Options

Usefulness:

Lexicon Pro Android App can be useful to writers, students, bloggers, even anyone playing word games, etc.

Ease of Use:

The app is straight forward… search and define. If  word has multiple definitions, swipe to see more. If a word contains similar words, the will appear in a list below the definition.

Interface:

The user interface is simple and easy to use.

AndroidTapp.com Rating

AndroidTapp.com Rating!AndroidTapp.com Rating!AndroidTapp.com Rating!AndroidTapp.com Rating!AndroidTapp.com Rating! (4.1 out of 5)

Should you Download Lexicon Pro? Yes! Cool Dictionary/Thesaurus App!

by Antonio Wells at February 08, 2010 12:00 PM

MathWizard

The MathWizard brings joy to learning math facts by providing fun, silly, audio feedback to questions answered. Sharpen your child’s Addition, Subtraction, Multiplication, and Division skills with flash card questions. View statistics to monitor progress. Multi-user support. See if you can find the hidden Easter eggs!

Price: Free, $1.49

AndroidTapp.com Android App Review:

Features:

Math Wizard Android App is great for children learning rudimentary math. Use it like flash cards to randomly quiz youths or set the bar higher and combine with speed to give your adult brain some exercise and keep you sharp. Features addition, subtraction, multiplication and division in flash card format. Also records the time in which the question was answered; see a report of the progress.

MathWizard Start Screen MathWizard Question MathWizard Answer MathWizard Test Grade and Speed MathWizard Stats MathWizard Division Math Question MathWizard Multiplication Math Question MathWizard Subtraction Math Question MathWizard Preferences Menu

Usefulness & Frequently Used:

Great for young children learning math.

AndroidTapp.com Rating

AndroidTapp.com Rating!AndroidTapp.com Rating!AndroidTapp.com Rating!AndroidTapp.com Rating!AndroidTapp.com Rating! (4.0 out of 5)

Should you Download MathWizard? Yes! Great App for Learning Children!

by Antonio Wells at February 08, 2010 11:55 AM

February 07, 2010

Beware! The Droids are coming...

fallout bobblehead

fallout supermutant

At last I found a companion for my Fallout3 BobbleHead that sits on my desk. He is so lonely, being alone all the time. He was very happy as my kids started to play with him but after a while it did hurt him.

Now he will get some friends. I hope that he won't have any problem with the fact that the friends will be non-biological. In any case they are more friendly then super mutants

One of the signs that shows that a brand is well established is when the community starts to create fan art around the brand. Is seems that Android has matured so far. New York based artist Andrew Bell has designed several neat Android figures as a secret project.

android_figures_3

Since February 1. the project is not secret anymore. Production of the first series will start in a few days. Head over to Dyzplastic to claim your figure or rather box of figures. The figures will come in 12 different flavours in blind boxes, that means, you will not know which figure you get. To bring in even more excitement, there will be some very rare figures that collectors will WANT to have.

android box image

The figures can rotate their head and arms and seem to be very friendly. There is no information on prices and availability yet. If any new information comes, I'll keep you posted. 

android box image

I could imagine to put some identification tags in/on the figures to provide additional fun. For example you could track your collection with your Android device, or you could let the figure sneak into your phone as a background image. Anyways that is a great idea, BobbleHead will be so happy...

by gergely at February 07, 2010 07:45 PM

ANT Build file


I have a refactoring of AndCooper ANY build for Android applications:

<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
Feb 2, 2010 12:22:12 PM
AndroidAppANTBuild
Build file to build Android Applications
fredgrott
====================================================================== -->
<project name="AndroidAppANTBuild" default="help" basedir=".">
<description>
Build file to build Android Applications, not the apps test build
</description>
<property environment="env"/>
<tstamp/>
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK and the framework.aidl file and
the platform version tools folder and the sdk tols folder. It should
*NOT* be checked in in Version
Control Systems.
sdk-location
sdk-tools-location
sdk-platform-location
sdk-platform-tools-location
sdk-aidl-location
tested.project.dir
-->
<property file="local.properties" />
<!-- The build.properties file can be created by you and is never touched
by the 'android' tool. This is the place to change some of the default property values
used by the Ant rules.
Here are some properties you may want to change/update:
application.package
the name of your application package as defined in the manifest. Used by the
'uninstall' rule.
source.dir
the name of the source directory. Default is 'src'.
out.dir
the name of the output directory. Default is 'bin'.
Properties related to the SDK location or the project target should be updated
using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your application and
should be checked in in Version Control Systems.
-->
<property file="build.properties" />
<!-- The default.properties file is created and updated by the 'android' tool, as well
as ADT.
This file is an integral part of the build system for your application and
should be checked in in Version Control Systems. -->
<property file="default.properties" />
<!-- Custom Android task to deal with the project target, and import the proper rules.
This requires ant 1.6.0 or above. -->
<path id="android.antlibs">
<pathelement path="${sdk-tools-location}/lib/anttasks.jar" />
<pathelement path="${sdk-tools-location}/lib/sdklib.jar" />
<pathelement path="${sdk-tools-location}/lib/androidprefs.jar" />
<pathelement path="${sdk-tools-location}/lib/apkbuilder.jar" />
<pathelement path="${sdk-tools-location}/lib/jarutils.jar" />
</path>
<taskdef name="setup"
classname="com.android.ant.SetupTask"
classpathref="android.antlibs" />
<!-- Execute the Android Setup task that will setup some properties specific to the target,
and import the build rules files.
The rules file is imported from
<SDK>/platforms/<target_platform>/templates/android_rules.xml
To customize some build steps for your project:
- copy the content of the main node <project> from android_rules.xml
- paste it in this build.xml below the <setup /> task.
- disable the import by changing the setup task below to <setup import="false" />
This will ensure that the properties are setup correctly but that your customized
build steps are used.
-->
<setup import="false" />
<!-- Custom tasks -->
<taskdef name="aaptexec"
classname="com.android.ant.AaptExecLoopTask"
classpathref="android.antlibs" />
<taskdef name="apkbuilder"
classname="com.android.ant.ApkBuilderTask"
classpathref="android.antlibs" />
<taskdef name="xpath"
classname="com.android.ant.XPathTask"
classpathref="android.antlibs" />
<!-- Tells adb which device to target. You can change this from the command line
by invoking "ant -Dadb.device.arg=-d" for device "ant -Dadb.device.arg=-e" for
the emulator. -->
<property name="adb.device.arg" value="" />
<property name="android.tools.dir" location="${sdk-tools-location}" />
<property name="tested.project.absolute.dir" location="${tested.project.dir}" />
<property name="instrumentation.dir" value="instrumented" />
<property name="instrumentation.absolute.dir" location="${instrumentation.dir}" />
<property name="test.runner" value="android.test.InstrumentationTestRunner" />
<property name="android.aidl" value="${sdk-aidl-location}"/>
<!-- TODO: make it more configurable in the next CL's - now it is default for auto-generated
project -->
<property name="emma.dump.file"
value="/data/data/${tested.manifest.package}/files/coverage.ec" />
<!-- Name of the application package extracted from manifest file -->
<xpath input="AndroidManifest.xml" expression="/manifest/@package"
output="manifest.package" />
<xpath input="${tested.project.absolute.dir}/AndroidManifest.xml"
expression="/manifest/@package" output="tested.manifest.package" />
<!-- Input directories -->
<property name="source.dir" value="${source-folder}" />
<property name="source.absolute.dir" location="${source.dir}" />
<property name="gen.dir" value="gen" />
<property name="gen.absolute.dir" location="${gen.dir}" />
<property name="resource.dir" value="res" />
<property name="resource.absolute.dir" location="${resource.dir}" />
<property name="asset.dir" value="assets" />
<property name="asset.absolute.dir" location="${asset.dir}" />
<!-- Directory for the third party java libraries -->
<property name="external.libs.dir" value="libs" />
<property name="external.libs.absolute.dir" location="${external.libs.dir}" />
<!-- Directory for the native libraries -->
<property name="native.libs.dir" value="libs" />
<property name="native.libs.absolute.dir" location="${native.libs.dir}" />
<!-- Output directories -->
<property name="out.dir" value="${out-folder}" />
<property name="out.absolute.dir" location="${out.dir}" />
<property name="out.classes.dir" value="${out.absolute.dir}/classes" />
<property name="out.classes.absolute.dir" location="${out.classes.dir}" />
<!-- Intermediate files -->
<property name="dex.file.name" value="classes.dex" />
<property name="intermediate.dex.file" location="${out.absolute.dir}/${dex.file.name}" />
<!-- The final package file to generate -->
<property name="out.debug.unaligned.package"
location="${out.absolute.dir}/${ant.project.name}-debug-unaligned.apk" />
<property name="out.debug.package"
location="${out.absolute.dir}/${ant.project.name}-debug.apk" />
<property name="out.unsigned.package"
location="${out.absolute.dir}/${ant.project.name}-unsigned.apk" />
<property name="out.unaligned.package"
location="${out.absolute.dir}/${ant.project.name}-unaligned.apk" />
<property name="out.release.package"
location="${out.absolute.dir}/${ant.project.name}-release.apk" />
<!-- Verbosity -->
<property name="verbose" value="false" />
<!-- This is needed by emma as it uses multilevel verbosity instead of simple 'true' or 'false'
The property 'verbosity' is not user configurable and depends exclusively on 'verbose'
value.-->
<condition property="verbosity" value="verbose" else="quiet">
<istrue value="${verbose}" />
</condition>
<!-- This is needed to switch verbosity of zipalign and aapt. Depends exclusively on 'verbose'
-->
<condition property="v.option" value="-v" else="">
<istrue value="${verbose}" />
</condition>
<!-- This is needed to switch verbosity of dx. Depends exclusively on 'verbose' -->
<condition property="verbose.option" value="--verbose" else="">
<istrue value="${verbose}" />
</condition>
<!-- Tools -->
<condition property="exe" value=".exe" else=""><os family="windows" /></condition>
<property name="adb" location="${android.tools.dir}/adb${exe}" />
<property name="zipalign" location="${android.tools.dir}/zipalign${exe}" />
<!-- Emma configuration -->
<property name="emma.dir" value="${sdk-tools-location}/lib" />
<path id="emma.lib">
<pathelement location="${emma.dir}/emma.jar" />
<pathelement location="${emma.dir}/emma_ant.jar" />
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
<!-- End of emma configuration -->
<!-- Configurable macro, which allows to pass as parameters output directory,
output dex filename and external libraries to dex (optional) -->
<macrodef name="dex-helper">
<element name="external-libs" optional="yes" />
<element name="extra-parameters" optional="yes" />
<sequential>
<echo>Converting compiled files and external libraries into ${intermediate.dex.file}...
</echo>
<apply executable="${dx}" failonerror="true" parallel="true">
<arg value="--dex" />
<arg value="--output=${intermediate.dex.file}" />
<extra-parameters />
<arg line="${verbose.option}" />
<arg path="${out.classes.absolute.dir}" />
<fileset dir="${external.libs.absolute.dir}" includes="*.jar" />
<external-libs />
</apply>
</sequential>
</macrodef>
<!-- This is macro that enable passing variable list of external jar files to ApkBuilder
Example of use:
<package-helper>
<extra-jars>
<jarfolder path="my_jars" />
<jarfile path="foo/bar.jar" />
<jarfolder path="your_jars" />
</extra-jars>
</package-helper> -->
<macrodef name="package-helper">
<attribute name="sign.package" />
<element name="extra-jars" optional="yes" />
<sequential>
<apkbuilder
outfolder="${out.absolute.dir}"
basename="${ant.project.name}"
signed="@{sign.package}"
verbose="${verbose}">
<file path="${intermediate.dex.file}" />
<sourcefolder path="${source.absolute.dir}" />
<nativefolder path="${native.libs.absolute.dir}" />
<jarfolder path="${external.libs.absolute.dir}" />
<extra-jars/>
</apkbuilder>
</sequential>
</macrodef>
<!-- This is macro which zipaligns in.package and outputs it to out.package. Used by targets
debug, -debug-with-emma and release.-->
<macrodef name="zipalign-helper">
<attribute name="in.package" />
<attribute name="out.package" />
<sequential>
<echo>Running zip align on final apk...</echo>
<exec executable="${zipalign}" failonerror="true">
<arg line="${v.option}" />
<arg value="-f" />
<arg value="4" />
<arg path="@{in.package}" />
<arg path="@{out.package}" />
</exec>
</sequential>
</macrodef>
<!-- This is macro used only for sharing code among two targets, -install and
-install-with-emma which do exactly the same but differ in dependencies -->
<macrodef name="install-helper">
<sequential>
<echo>Installing ${out.debug.package} onto default emulator or device...</echo>
<exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}" />
<arg value="install" />
<arg value="-r" />
<arg path="${out.debug.package}" />
</exec>
</sequential>
</macrodef>
<macrodef name="run-tests-helper">
<attribute name="emma.enabled" default="false" />
<element name="extra-instrument-args" optional="yes" />
<sequential>
<echo>Running tests ...</echo>
<exec executable="${adb}" failonerror="true">
<arg value="shell" />
<arg value="am" />
<arg value="instrument" />
<arg value="-w" />
<arg value="-e" />
<arg value="coverage" />
<arg value="@{emma.enabled}" />
<extra-instrument-args />
<arg value="${manifest.package}/${test.runner}" />
</exec>
</sequential>
</macrodef>
<!-- - - - - - - - - - - - - - - - - - -
target: -dirs
Creates the output directories if they
don't exist yet.
- - - - - - - - - - - - - - - - - - -->
<target name="-dirs">
<echo>Creating output directories if needed...</echo>
<mkdir dir="${resource.absolute.dir}" />
<mkdir dir="${external.libs.absolute.dir}" />
<mkdir dir="${gen.absolute.dir}" />
<mkdir dir="${out.absolute.dir}" />
<mkdir dir="${out.classes.absolute.dir}" />
</target>
<!-- - - - - - - - - - - - - - - - - - -
target: -resource-src
Generates the R.java file for this
project's resources.
- - - - - - - - - - - - - - - - - - -->
<target name="-resource-src" depends="-dirs">
<echo>Generating R.java / Manifest.java from the resources...</echo>
<exec executable="${aapt}" failonerror="true">
<arg value="package" />
<arg line="${v.option}" />
<arg value="-m" />
<arg value="-J" />
<arg path="${gen.absolute.dir}" />
<arg value="-M" />
<arg path="AndroidManifest.xml" />
<arg value="-S" />
<arg path="${resource.absolute.dir}" />
<arg value="-I" />
<arg path="${android.jar}" />
</exec>
</target>
<!-- - - - - - - - - - - - - - - - -
target: -aidl
Generates java classes from .aidl files.
- - - - - - - - - - - - - - - - -->
<target name="-aidl" depends="-dirs">
<echo>Compiling aidl files into Java classes...</echo>
<apply executable="${aidl}" failonerror="true">
<arg value="-p${android.aidl}" />
<arg value="-I${source.absolute.dir}" />
<arg value="-o${gen.absolute.dir}" />
<fileset dir="${source.absolute.dir}">
<include name="**/*.aidl" />
</fileset>
</apply>
</target>
<!-- - - - - - - - - - - - - - - - - - - - - -
target: compile
Compiles this project's .java files
into .class files.
- - - - - - - - - - - - - - - - - - - - - -->
<target name="compile" depends="-resource-src, -aidl"
description="Compiles project's .java files into .class files">
<!-- If android rules are used for a test project, its classpath should include
tested project's location -->
<condition property="extensible.classpath"
value="${tested.project.absolute.dir}/bin/classes" else=".">
<isset property="tested.project.absolute.dir" />
</condition>
<javac encoding="ascii" target="1.5" debug="true" extdirs=""
destdir="${out.classes.absolute.dir}"
bootclasspathref="android.target.classpath"
verbose="${verbose}" classpath="${extensible.classpath}">
<src path="${source.absolute.dir}" />
<src path="${gen.absolute.dir}" />
<classpath>
<fileset dir="${external.libs.absolute.dir}" includes="*.jar" />
</classpath>
</javac>
</target>
<!-- - - - - - - - - - - - - - - - - - - - - -
target: -dex
Converts this project's .class files
into .dex files
- - - - - - - - - - - - - - - - - - - - - -->
<target name="-dex" depends="compile">
<dex-helper />
</target>
<!-- - - - - - - - - - - - - - - - - - - - - -
target: -package-resources
Puts the project's resources into the
output package file This actually can
create multiple resource package in case
Some custom apk with specific configuration have been
declared in default.properties.
- - - - - - - - - - - - - - - - - - - - - -->
<target name="-package-resources">
<echo>Packaging resources</echo>
<aaptexec executable="${aapt}"
command="package"
manifest="AndroidManifest.xml"
resources="${resource.absolute.dir}"
assets="${asset.absolute.dir}"
androidjar="${android.jar}"
outfolder="${out.absolute.dir}"
basename="${ant.project.name}" />
</target>
<!-- - - - - - - - - - - - - - - - - - - - -
target: -package-debug-sign
Packages the application and sign
it with a debug key.
- - - - - - - - - - - - - - - - - - - - -->
<target name="-package-debug-sign" depends="-dex, -package-resources">
<package-helper sign.package="true" />
</target>
<!-- - - - - - - - - - - - - - - - - - - -
target: -package-no-sign
Packages the application without
signing it.
- - - - - - - - - - - - - - - - - - - -->
<target name="-package-no-sign" depends="-dex, -package-resources">
<package-helper sign.package="false" />
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - -
target: -compile-if-tested-if-test
- - - - - - - - - - - - - - - - - - - - - - -->
<target name="-compile-tested-if-test" if="tested.project.dir" unless="do.not.compile.again">
<subant target="compile">
<fileset dir="${tested.project.absolute.dir}" includes="build.xml" />
</subant>
</target>
<!-- ========================================
target: debug
Builds debug output package, provided
all the necessary files are already dexed
======================================== -->
<target name="debug" depends="-compile-tested-if-test, -package-debug-sign"
description="Builds the application and signs it with a debug key.">
<zipalign-helper in.package="${out.debug.unaligned.package}"
out.package="${out.debug.package}" />
<echo>Debug Package: ${out.debug.package}</echo>
</target>
<!-- - - - - - - - - - - - - - - - - - -
target: -release-check
- - - - - - - - - - - - - - - - - - -->
<target name="-release-check">
<condition property="release.sign">
<and>
<isset property="key.store" />
<isset property="key.alias" />
</and>
</condition>
</target>
<!-- - - - - - - - - - - - - - - - - - -
target: -release-nosign
- - - - - - - - - - - - - - - - - - -->
<target name="-release-nosign" depends="-release-check" unless="release.sign">
<echo>No key.store and key.alias properties found in build.properties.</echo>
<echo>Please sign ${out.unsigned.package} manually</echo>
<echo>and run zipalign from the Android SDK tools.</echo>
</target>
<!-- ======================================
target: release
====================================== -->
<target name="release" depends="-package-no-sign, -release-nosign" if="release.sign"
description="Builds the application. The generated apk file must be signed before
it is published.">
<!-- Gets passwords -->
<input
message="Please enter keystore password (store:${key.store}):"
addproperty="key.store.password" />
<input
message="Please enter password for alias '${key.alias}':"
addproperty="key.alias.password" />
<!-- Signs the APK -->
<echo>Signing final apk...</echo>
<signjar
jar="${out.unsigned.package}"
signedjar="${out.unaligned.package}"
keystore="${key.store}"
storepass="${key.store.password}"
alias="${key.alias}"
keypass="${key.alias.password}"
verbose="${verbose}" />
<!-- Zip aligns the APK -->
<zipalign-helper in.package="${out.unaligned.package}"
out.package="${out.release.package}" />
<echo>Release Package: ${out.release.package}</echo>
</target>
<!-- ===========================
target: install
=========================== -->
<target name="install" depends="debug"
description="Installs/reinstalls the debug package onto a running
emulator or device. If the application was previously installed,
the signatures must match." >
<install-helper />
</target>
<!-- - - - - - - - - - - - - - - - - - - - - -
target: -uninstall-check
- - - - - - - - - - - - - - - - - - - - - -->
<target name="-uninstall-check">
<condition property="uninstall.run">
<isset property="manifest.package" />
</condition>
</target>
<!-- - - - - - - - - - - - - - - - - - - - - -
target: -uninstall-error
- - - - - - - - - - - - - - - - - - - - - -->
<target name="-uninstall-error" depends="-uninstall-check" unless="uninstall.run">
<echo>Unable to run 'ant uninstall', manifest.package property is not defined.
</echo>
</target>
<!-- ====================================
target: unistall
Uninstalls the package from the
default emulator/device
==================================== -->
<target name="uninstall" depends="-uninstall-error" if="uninstall.run"
description="Uninstalls the application from a running emulator or device.">
<echo>Uninstalling ${manifest.package} from the default emulator or device...</echo>
<exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}" />
<arg value="uninstall" />
<arg value="${manifest.package}" />
</exec>
</target>
<!-- ====================================
target: clean
==================================== -->
<target name="clean" description="Removes output files created by other targets.">
<delete dir="${out.absolute.dir}" verbose="${verbose}" />
<delete dir="${gen.absolute.dir}" verbose="${verbose}" />
</target>
<!-- Targets for code-coverage measurement purposes, invoked from external file -->
<!-- - - - - - - - - - - - - - - - - -
target: -emma-instrument
Emma-instruments tested project
classes (compiles the tested
project if necessary)
and writes instrumented classes
to ${instrumentation.absolute.dir}/classes
- - - - - - - - - - - - - - - - - -->
<target name="-emma-instrument" depends="compile">
<echo>Instrumenting classes from ${out.absolute.dir}/classes...</echo>
<!-- It only instruments class files, not any external libs -->
<emma enabled="true">
<instr verbosity="${verbosity}"
mode="overwrite"
instrpath="${out.absolute.dir}/classes"
outdir="${out.absolute.dir}/classes">
</instr>
<!-- TODO: exclusion filters on R*.class and allowing custom exclusion from
user defined file -->
</emma>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: -dex-instrumented
- - - - - - - - - - - - - - - - - -->
<target name="-dex-instrumented" depends="-emma-instrument">
<dex-helper>
<extra-parameters>
<arg value="--no-locals" />
</extra-parameters>
<external-libs>
<fileset file="${emma.dir}/emma_device.jar" />
</external-libs>
</dex-helper>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: -package-with-emma
Invoked from external files for
code coverage purposes
- - - - - - - - - - - - - - - - - -->
<target name="-package-with-emma" depends="-dex-instrumented, -package-resources">
<package-helper sign.package="true">
<extra-jars>
<!-- Injected from external file -->
<jarfile path="${emma.dir}/emma_device.jar" />
</extra-jars>
</package-helper>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: -debug-with-emma
- - - - - - - - - - - - - - - - - -->
<target name="-debug-with-emma" depends="-package-with-emma">
<zipalign-helper in.package="${out.debug.unaligned.package}"
out.package="${out.debug.package}" />
</target>
<!-- ======================================
target: -install-with-emma
====================================== -->
<target name="-install-with-emma" depends="-debug-with-emma">
<install-helper />
</target>
<!-- End of targets for code-coverage measurement purposes -->
<!-- ======================================
target: help
====================================== -->
<target name="help">
<!-- displays starts at col 13
|13                                                              80| -->
<echo>Android Ant Build. Available targets:</echo>
<echo>   help:      Displays this help.</echo>
<echo>   clean:     Removes output files created by other targets.</echo>
<echo>   compile:   Compiles project's .java files into .class files.</echo>
<echo>   debug:     Builds the application and signs it with a debug key.</echo>
<echo>   release:   Builds the application. The generated apk file must be</echo>
<echo>              signed before it is published.</echo>
<echo>   install:   Installs/reinstalls the debug package onto a running</echo>
<echo>              emulator or device.</echo>
<echo>              If the application was previously installed, the</echo>
<echo>              signatures must match.</echo>
<echo>   uninstall: Uninstalls the application from a running emulator or</echo>
<echo>              device.</echo>
<echo>   run-tests: Runs EMMA tests</echo>
<echo>   coverage:  Runs coverage report</echo>
</target>
<!-- - - - - - - - - - - - - - - - - - - - -
target: -set-coverage-classpath
Invoking this target sets the value of
extensible.classpath, which is being added to javac
classpath in target 'compile' (android_rules.xml)
- - - - - - - - - - - - - - - - - - - - -->
<target name="-set-coverage-classpath">
<property name="extensible.classpath"
location="${instrumentation.absolute.dir}/classes" />
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - -
target: -install-tested-project
Ensures that tested project is installed on
the device before we run the tests.
Used for ordinary tests, without coverage measurement
- - - - - - - - - - - - - - - - - - - - - - - -->
<target name="-install-tested-project">
<property name="do.not.compile.again" value="true" />
<subant target="install">
<fileset dir="${tested.project.absolute.dir}" includes="build.xml" />
</subant>
</target>
<!-- ====================================
target: run-tests
==================================== -->
<target name="run-tests" depends="-install-tested-project, install"
description="Runs tests from the package defined in test.package property">
<run-tests-helper />
</target>
<!-- - - - - - - - - - - - - - - - -
target: -install-instrumented
- - - - - - - - - - - - - - - - -->
<target name="-install-instrumented">
<property name="do.not.compile.again" value="true" />
<subant target="-install-with-emma">
<property name="out.absolute.dir" value="${instrumentation.absolute.dir}" />
<fileset dir="${tested.project.absolute.dir}" includes="build.xml" />
</subant>
</target>
<!-- ===============================================
target: coverage
=============================================== -->
<target name="coverage" depends="-set-coverage-classpath, -install-instrumented, install"
description="Runs the tests against the instrumented code and generates
code coverage report">
<run-tests-helper emma.enabled="true">
<extra-instrument-args>
<arg value="-e" />
<arg value="coverageFile" />
<arg value="${emma.dump.file}" />
</extra-instrument-args>
</run-tests-helper>
<echo>Downloading coverage file into project directory...</echo>
<exec executable="${adb}" failonerror="true">
<arg value="pull" />
<arg value="${emma.dump.file}" />
<arg value="coverage.ec" />
</exec>
<echo>Extracting coverage report...</echo>
<emma>
<report sourcepath="${tested.project.absolute.dir}/${source.dir}"
verbosity="${verbosity}">
<!-- TODO: report.dir or something like should be introduced if necessary -->
<infileset dir=".">
<include name="coverage.ec" />
<include name="coverage.em" />
</infileset>
<!-- TODO: reports in other, indicated by user formats -->
<html outfile="coverage.html" />
</report>
</emma>
<echo>Cleaning up temporary files...</echo>
<delete dir="${instrumentation.absolute.dir}" />
<delete file="coverage.ec" />
<delete file="coverage.em" />
<echo>Saving the report file in ${basedir}/coverage/coverage.html</echo>
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?><!-- ======================================================================      Feb 2, 2010 12:22:12 PM
AndroidAppANTBuild         Build file to build Android Applications                        fredgrott                                                                     ====================================================================== --><project name="AndroidAppANTBuild" default="help" basedir=".">    <description>            Build file to build Android Applications, not the apps test build    </description>	 <property environment="env"/>	 <tstamp/>
<!-- The local.properties file is created and updated by the 'android' tool.         It contains the path to the SDK and the framework.aidl file and         the platform version tools folder and the sdk tols folder. It should          *NOT* be checked in in Version         Control Systems.                   sdk-location         sdk-tools-location         sdk-platform-location         sdk-platform-tools-location         sdk-aidl-location         tested.project.dir         -->    <property file="local.properties" />	 <!-- The build.properties file can be created by you and is never touched	         by the 'android' tool. This is the place to change some of the default property values         used by the Ant rules.	         Here are some properties you may want to change/update:
application.package	             the name of your application package as defined in the manifest. Used by the	             'uninstall' rule.	         source.dir	             the name of the source directory. Default is 'src'.	         out.dir	             the name of the output directory. Default is 'bin'.
Properties related to the SDK location or the project target should be updated	          using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your application and	         should be checked in in Version Control Systems.
-->	<property file="build.properties" />
<!-- The default.properties file is created and updated by the 'android' tool, as well	         as ADT.	         This file is an integral part of the build system for your application and	         should be checked in in Version Control Systems. -->	<property file="default.properties" />	 <!-- Custom Android task to deal with the project target, and import the proper rules.	         This requires ant 1.6.0 or above. -->	<path id="android.antlibs">	        <pathelement path="${sdk-tools-location}/lib/anttasks.jar" />	        <pathelement path="${sdk-tools-location}/lib/sdklib.jar" />	        <pathelement path="${sdk-tools-location}/lib/androidprefs.jar" />	        <pathelement path="${sdk-tools-location}/lib/apkbuilder.jar" />	        <pathelement path="${sdk-tools-location}/lib/jarutils.jar" />	</path>	 <taskdef name="setup"	        classname="com.android.ant.SetupTask"	        classpathref="android.antlibs" />	 <!-- Execute the Android Setup task that will setup some properties specific to the target,	         and import the build rules files.
The rules file is imported from	            <SDK>/platforms/<target_platform>/templates/android_rules.xml
To customize some build steps for your project:	         - copy the content of the main node <project> from android_rules.xml	         - paste it in this build.xml below the <setup /> task.	         - disable the import by changing the setup task below to <setup import="false" />
This will ensure that the properties are setup correctly but that your customized	         build steps are used.	    -->	<setup import="false" />
<!-- Custom tasks -->	<taskdef name="aaptexec"	    classname="com.android.ant.AaptExecLoopTask"	    classpathref="android.antlibs" />
<taskdef name="apkbuilder"	    classname="com.android.ant.ApkBuilderTask"	    classpathref="android.antlibs" />
<taskdef name="xpath"	    classname="com.android.ant.XPathTask"	    classpathref="android.antlibs" />	 <!-- Tells adb which device to target. You can change this from the command line	         by invoking "ant -Dadb.device.arg=-d" for device "ant -Dadb.device.arg=-e" for	         the emulator. -->	<property name="adb.device.arg" value="" />	<property name="android.tools.dir" location="${sdk-tools-location}" />	 <property name="tested.project.absolute.dir" location="${tested.project.dir}" />	<property name="instrumentation.dir" value="instrumented" />	<property name="instrumentation.absolute.dir" location="${instrumentation.dir}" />
<property name="test.runner" value="android.test.InstrumentationTestRunner" />	 <property name="android.aidl" value="${sdk-aidl-location}"/>	 <!-- TODO: make it more configurable in the next CL's - now it is default for auto-generated	         project -->	<property name="emma.dump.file"	                  value="/data/data/${tested.manifest.package}/files/coverage.ec" />
<!-- Name of the application package extracted from manifest file -->	<xpath input="AndroidManifest.xml" expression="/manifest/@package"	     output="manifest.package" />	<xpath input="${tested.project.absolute.dir}/AndroidManifest.xml"	     expression="/manifest/@package" output="tested.manifest.package" />	 <!-- Input directories -->	<property name="source.dir" value="${source-folder}" /> <property name="source.absolute.dir" location="${source.dir}" />	<property name="gen.dir" value="gen" />	<property name="gen.absolute.dir" location="${gen.dir}" />	<property name="resource.dir" value="res" />	<property name="resource.absolute.dir" location="${resource.dir}" />	<property name="asset.dir" value="assets" />	<property name="asset.absolute.dir" location="${asset.dir}" />	 <!-- Directory for the third party java libraries -->    <property name="external.libs.dir" value="libs" />	<property name="external.libs.absolute.dir" location="${external.libs.dir}" />
<!-- Directory for the native libraries -->	<property name="native.libs.dir" value="libs" />	<property name="native.libs.absolute.dir" location="${native.libs.dir}" />
<!-- Output directories -->	 <property name="out.dir" value="${out-folder}" />	 <property name="out.absolute.dir" location="${out.dir}" />	 <property name="out.classes.dir" value="${out.absolute.dir}/classes" />	 <property name="out.classes.absolute.dir" location="${out.classes.dir}" />
<!-- Intermediate files -->	<property name="dex.file.name" value="classes.dex" />	<property name="intermediate.dex.file" location="${out.absolute.dir}/${dex.file.name}" />
<!-- The final package file to generate -->	<property name="out.debug.unaligned.package"	                  location="${out.absolute.dir}/${ant.project.name}-debug-unaligned.apk" />	<property name="out.debug.package"	                  location="${out.absolute.dir}/${ant.project.name}-debug.apk" />	<property name="out.unsigned.package"	                  location="${out.absolute.dir}/${ant.project.name}-unsigned.apk" />	<property name="out.unaligned.package"	                  location="${out.absolute.dir}/${ant.project.name}-unaligned.apk" />	<property name="out.release.package"	                  location="${out.absolute.dir}/${ant.project.name}-release.apk" />
<!-- Verbosity -->    <property name="verbose" value="false" />	<!-- This is needed by emma as it uses multilevel verbosity instead of simple 'true' or 'false'	     The property 'verbosity' is not user configurable and depends exclusively on 'verbose'	     value.--> <condition property="verbosity" value="verbose" else="quiet">	     <istrue value="${verbose}" />	</condition>	<!-- This is needed to switch verbosity of zipalign and aapt. Depends exclusively on 'verbose'	     -->	<condition property="v.option" value="-v" else="">	    <istrue value="${verbose}" />	</condition>	<!-- This is needed to switch verbosity of dx. Depends exclusively on 'verbose' -->	<condition property="verbose.option" value="--verbose" else="">	    <istrue value="${verbose}" />	</condition>
<!-- Tools -->    <condition property="exe" value=".exe" else=""><os family="windows" /></condition>	<property name="adb" location="${android.tools.dir}/adb${exe}" />	<property name="zipalign" location="${android.tools.dir}/zipalign${exe}" />
<!-- Emma configuration -->	<property name="emma.dir" value="${sdk-tools-location}/lib" />	<path id="emma.lib">	     <pathelement location="${emma.dir}/emma.jar" />	     <pathelement location="${emma.dir}/emma_ant.jar" />	</path> <taskdef resource="emma_ant.properties" classpathref="emma.lib" />	<!-- End of emma configuration -->	 <!-- Configurable macro, which allows to pass as parameters output directory,	         output dex filename and external libraries to dex (optional) --> <macrodef name="dex-helper">	       <element name="external-libs" optional="yes" />	       <element name="extra-parameters" optional="yes" />	       <sequential>	         <echo>Converting compiled files and external libraries into ${intermediate.dex.file}...	         </echo>	         <apply executable="${dx}" failonerror="true" parallel="true">	             <arg value="--dex" />	             <arg value="--output=${intermediate.dex.file}" />	             <extra-parameters />	             <arg line="${verbose.option}" />	             <arg path="${out.classes.absolute.dir}" />	             <fileset dir="${external.libs.absolute.dir}" includes="*.jar" />	             <external-libs />	         </apply>	       </sequential>	</macrodef>	 <!-- This is macro that enable passing variable list of external jar files to ApkBuilder	         Example of use:	         <package-helper>	             <extra-jars>	                <jarfolder path="my_jars" />	                <jarfile path="foo/bar.jar" />	                <jarfolder path="your_jars" />	             </extra-jars>	         </package-helper> -->	    <macrodef name="package-helper">	        <attribute name="sign.package" />	        <element name="extra-jars" optional="yes" />	        <sequential>	            <apkbuilder	                    outfolder="${out.absolute.dir}"	                    basename="${ant.project.name}"	                    signed="@{sign.package}"	                    verbose="${verbose}">	                <file path="${intermediate.dex.file}" />	                <sourcefolder path="${source.absolute.dir}" />	                <nativefolder path="${native.libs.absolute.dir}" />	                <jarfolder path="${external.libs.absolute.dir}" />	                <extra-jars/>	            </apkbuilder>	        </sequential>	    </macrodef>	 <!-- This is macro which zipaligns in.package and outputs it to out.package. Used by targets	         debug, -debug-with-emma and release.-->	    <macrodef name="zipalign-helper">	        <attribute name="in.package" />	        <attribute name="out.package" />	        <sequential>	            <echo>Running zip align on final apk...</echo>	            <exec executable="${zipalign}" failonerror="true">	                <arg line="${v.option}" />	                <arg value="-f" />	                <arg value="4" />	                <arg path="@{in.package}" />	                <arg path="@{out.package}" />	            </exec>	        </sequential>	    </macrodef>
<!-- This is macro used only for sharing code among two targets, -install and	         -install-with-emma which do exactly the same but differ in dependencies -->	    <macrodef name="install-helper">	        <sequential>	            <echo>Installing ${out.debug.package} onto default emulator or device...</echo>	            <exec executable="${adb}" failonerror="true">	                <arg line="${adb.device.arg}" />	                <arg value="install" />	                <arg value="-r" />	                <arg path="${out.debug.package}" />	            </exec>	        </sequential>	    </macrodef>	 <macrodef name="run-tests-helper">	        <attribute name="emma.enabled" default="false" />	        <element name="extra-instrument-args" optional="yes" />	        <sequential>	            <echo>Running tests ...</echo>	            <exec executable="${adb}" failonerror="true">	                <arg value="shell" />	                <arg value="am" />	                   <arg value="instrument" />	                <arg value="-w" />	                <arg value="-e" />	                   <arg value="coverage" />	                   <arg value="@{emma.enabled}" />	                <extra-instrument-args />                <arg value="${manifest.package}/${test.runner}" />	            </exec>	        </sequential>	    </macrodef>
<!-- - - - - - - - - - - - - - - - - - - 	      target: -dirs	      Creates the output directories if they 	      don't exist yet.	     - - - - - - - - - - - - - - - - - - -->	<target name="-dirs">	        <echo>Creating output directories if needed...</echo>	        <mkdir dir="${resource.absolute.dir}" />	        <mkdir dir="${external.libs.absolute.dir}" />	        <mkdir dir="${gen.absolute.dir}" />	        <mkdir dir="${out.absolute.dir}" />	        <mkdir dir="${out.classes.absolute.dir}" />	</target>
<!-- - - - - - - - - - - - - - - - - - - 	      target: -resource-src	      Generates the R.java file for this 	      project's resources.	     - - - - - - - - - - - - - - - - - - -->	<target name="-resource-src" depends="-dirs">	        <echo>Generating R.java / Manifest.java from the resources...</echo>	        <exec executable="${aapt}" failonerror="true">	            <arg value="package" />	            <arg line="${v.option}" />	            <arg value="-m" />	            <arg value="-J" />	            <arg path="${gen.absolute.dir}" />	            <arg value="-M" />	            <arg path="AndroidManifest.xml" />	            <arg value="-S" />	            <arg path="${resource.absolute.dir}" />	            <arg value="-I" />	            <arg path="${android.jar}" />	        </exec>    </target>
<!-- - - - - - - - - - - - - - - - - 	      target: -aidl	      Generates java classes from .aidl files.	     - - - - - - - - - - - - - - - - -->	<target name="-aidl" depends="-dirs">	        <echo>Compiling aidl files into Java classes...</echo>	        <apply executable="${aidl}" failonerror="true">	            <arg value="-p${android.aidl}" />	            <arg value="-I${source.absolute.dir}" />	            <arg value="-o${gen.absolute.dir}" />	            <fileset dir="${source.absolute.dir}">	                <include name="**/*.aidl" />	            </fileset>	        </apply>	</target>
<!-- - - - - - - - - - - - - - - - - - - - - - 	      target: compile	      Compiles this project's .java files 	      into .class files.	     - - - - - - - - - - - - - - - - - - - - - -->	<target name="compile" depends="-resource-src, -aidl"	                description="Compiles project's .java files into .class files">	        <!-- If android rules are used for a test project, its classpath should include	             tested project's location -->	        <condition property="extensible.classpath"	                           value="${tested.project.absolute.dir}/bin/classes" else=".">	            <isset property="tested.project.absolute.dir" />	        </condition>	        <javac encoding="ascii" target="1.5" debug="true" extdirs=""	                destdir="${out.classes.absolute.dir}"	                bootclasspathref="android.target.classpath"	                verbose="${verbose}" classpath="${extensible.classpath}">	            <src path="${source.absolute.dir}" />	            <src path="${gen.absolute.dir}" />	            <classpath>	                <fileset dir="${external.libs.absolute.dir}" includes="*.jar" />	            </classpath>	        </javac>	</target>
<!-- - - - - - - - - - - - - - - - - - - - - - 	      target: -dex	      Converts this project's .class files 	      into .dex files	     - - - - - - - - - - - - - - - - - - - - - -->	<target name="-dex" depends="compile">	        <dex-helper />	</target>
<!-- - - - - - - - - - - - - - - - - - - - - - 	      target: -package-resources	      Puts the project's resources into the 	      output package file This actually can 	      create multiple resource package in case	      Some custom apk with specific configuration have been	      declared in default.properties.	     - - - - - - - - - - - - - - - - - - - - - -->	<target name="-package-resources">	        <echo>Packaging resources</echo>	        <aaptexec executable="${aapt}"	                command="package"	                manifest="AndroidManifest.xml"	                resources="${resource.absolute.dir}"	                assets="${asset.absolute.dir}"	                androidjar="${android.jar}"	                outfolder="${out.absolute.dir}"	                basename="${ant.project.name}" />	</target>
<!-- - - - - - - - - - - - - - - - - - - - -	      target: -package-debug-sign	      Packages the application and sign 	      it with a debug key.	     - - - - - - - - - - - - - - - - - - - - -->	<target name="-package-debug-sign" depends="-dex, -package-resources">	        <package-helper sign.package="true" />	</target>
<!-- - - - - - - - - - - - - - - - - - - - 	      target: -package-no-sign	      Packages the application without 	      signing it.	     - - - - - - - - - - - - - - - - - - - -->	<target name="-package-no-sign" depends="-dex, -package-resources">	        <package-helper sign.package="false" />	</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - 	      target: -compile-if-tested-if-test	     - - - - - - - - - - - - - - - - - - - - - - -->	<target name="-compile-tested-if-test" if="tested.project.dir" unless="do.not.compile.again">	       <subant target="compile">	            <fileset dir="${tested.project.absolute.dir}" includes="build.xml" />	       </subant>	</target>
<!-- ========================================	      target: debug	      Builds debug output package, provided 	      all the necessary files are already dexed	     ======================================== -->	<target name="debug" depends="-compile-tested-if-test, -package-debug-sign"	                description="Builds the application and signs it with a debug key.">	        <zipalign-helper in.package="${out.debug.unaligned.package}"	                                   out.package="${out.debug.package}" />	        <echo>Debug Package: ${out.debug.package}</echo>	</target>
<!-- - - - - - - - - - - - - - - - - - -	  target: -release-check	 - - - - - - - - - - - - - - - - - - -->	<target name="-release-check">	        <condition property="release.sign">	            <and>	                <isset property="key.store" />	                <isset property="key.alias" />	            </and>	        </condition>	</target>
<!-- - - - - - - - - - - - - - - - - - -	      target: -release-nosign	     - - - - - - - - - - - - - - - - - - -->	<target name="-release-nosign" depends="-release-check" unless="release.sign">	        <echo>No key.store and key.alias properties found in build.properties.</echo>	        <echo>Please sign ${out.unsigned.package} manually</echo>	        <echo>and run zipalign from the Android SDK tools.</echo>	</target>
<!-- ======================================	      target: release	     ====================================== -->	<target name="release" depends="-package-no-sign, -release-nosign" if="release.sign"	                description="Builds the application. The generated apk file must be signed before	                            it is published.">	        <!-- Gets passwords -->	        <input	                message="Please enter keystore password (store:${key.store}):"	                addproperty="key.store.password" />	        <input	                message="Please enter password for alias '${key.alias}':"	                addproperty="key.alias.password" />
<!-- Signs the APK -->	        <echo>Signing final apk...</echo>	        <signjar	                jar="${out.unsigned.package}"	                signedjar="${out.unaligned.package}"	                keystore="${key.store}"	                storepass="${key.store.password}"	                alias="${key.alias}"	                keypass="${key.alias.password}"	                verbose="${verbose}" />
<!-- Zip aligns the APK -->	        <zipalign-helper in.package="${out.unaligned.package}"	                                   out.package="${out.release.package}" />	        <echo>Release Package: ${out.release.package}</echo>	</target>
<!-- ===========================	      target: install	     =========================== -->	<target name="install" depends="debug"	                description="Installs/reinstalls the debug package onto a running	                            emulator or device. If the application was previously installed,	                            the signatures must match." >	        <install-helper />    </target>
<!-- - - - - - - - - - - - - - - - - - - - - -	  target: -uninstall-check	 - - - - - - - - - - - - - - - - - - - - - -->	<target name="-uninstall-check">	        <condition property="uninstall.run">	           <isset property="manifest.package" />	        </condition>	</target>
<!-- - - - - - - - - - - - - - - - - - - - - -	      target: -uninstall-error	     - - - - - - - - - - - - - - - - - - - - - -->	    <target name="-uninstall-error" depends="-uninstall-check" unless="uninstall.run">	        <echo>Unable to run 'ant uninstall', manifest.package property is not defined.	        </echo>	    </target>
<!-- ====================================	  target: unistall	  Uninstalls the package from the 	  default emulator/device ==================================== -->	<target name="uninstall" depends="-uninstall-error" if="uninstall.run"	                description="Uninstalls the application from a running emulator or device.">	        <echo>Uninstalling ${manifest.package} from the default emulator or device...</echo>	        <exec executable="${adb}" failonerror="true">	            <arg line="${adb.device.arg}" />	            <arg value="uninstall" />	            <arg value="${manifest.package}" />	        </exec>	</target>
<!-- ====================================	      target: clean	     ==================================== --> <target name="clean" description="Removes output files created by other targets.">	        <delete dir="${out.absolute.dir}" verbose="${verbose}" />	        <delete dir="${gen.absolute.dir}" verbose="${verbose}" />	</target>
<!-- Targets for code-coverage measurement purposes, invoked from external file -->
<!-- - - - - - - - - - - - - - - - - - 	  target: -emma-instrument	  Emma-instruments tested project 	  classes (compiles the tested 	  project if necessary)	      and writes instrumented classes 	      to ${instrumentation.absolute.dir}/classes	 - - - - - - - - - - - - - - - - - -->	<target name="-emma-instrument" depends="compile">	        <echo>Instrumenting classes from ${out.absolute.dir}/classes...</echo>	        <!-- It only instruments class files, not any external libs -->	        <emma enabled="true">	            <instr verbosity="${verbosity}"	                   mode="overwrite"	                   instrpath="${out.absolute.dir}/classes"	                   outdir="${out.absolute.dir}/classes">	            </instr>	            <!-- TODO: exclusion filters on R*.class and allowing custom exclusion from	                 user defined file -->	        </emma>	</target>
<!-- - - - - - - - - - - - - - - - - - 	  target: -dex-instrumented	 - - - - - - - - - - - - - - - - - -->	<target name="-dex-instrumented" depends="-emma-instrument">	       <dex-helper>	          <extra-parameters>	            <arg value="--no-locals" />	          </extra-parameters>	          <external-libs>	            <fileset file="${emma.dir}/emma_device.jar" />	          </external-libs>	       </dex-helper> </target>
<!-- - - - - - - - - - - - - - - - - - 	  target: -package-with-emma 	  Invoked from external files for 	  code coverage purposes	 - - - - - - - - - - - - - - - - - -->	<target name="-package-with-emma" depends="-dex-instrumented, -package-resources">	        <package-helper sign.package="true">	            <extra-jars>	                <!-- Injected from external file -->	                <jarfile path="${emma.dir}/emma_device.jar" />	            </extra-jars>	        </package-helper>    </target>
<!-- - - - - - - - - - - - - - - - - - 	       target: -debug-with-emma                	     - - - - - - - - - - - - - - - - - -->	<target name="-debug-with-emma" depends="-package-with-emma">	        <zipalign-helper in.package="${out.debug.unaligned.package}"	                                   out.package="${out.debug.package}" />	</target>
<!-- ======================================	  target: -install-with-emma ====================================== -->	<target name="-install-with-emma" depends="-debug-with-emma">	        <install-helper />	</target>
<!-- End of targets for code-coverage measurement purposes -->
<!-- ======================================	      target: help	     ====================================== -->    <target name="help">	        <!-- displays starts at col 13	              |13                                                              80| -->	        <echo>Android Ant Build. Available targets:</echo>	        <echo>   help:      Displays this help.</echo>	        <echo>   clean:     Removes output files created by other targets.</echo>	        <echo>   compile:   Compiles project's .java files into .class files.</echo>	        <echo>   debug:     Builds the application and signs it with a debug key.</echo>	        <echo>   release:   Builds the application. The generated apk file must be</echo>	        <echo>              signed before it is published.</echo>	        <echo>   install:   Installs/reinstalls the debug package onto a running</echo>	        <echo>              emulator or device.</echo>	        <echo>              If the application was previously installed, the</echo>	        <echo>              signatures must match.</echo>	        <echo>   uninstall: Uninstalls the application from a running emulator or</echo>	        <echo>              device.</echo>    	    <echo>   run-tests: Runs EMMA tests</echo>    	    <echo>   coverage:  Runs coverage report</echo>    </target>	  	<!-- - - - - - - - - - - - - - - - - - - - - 	      target: -set-coverage-classpath	      Invoking this target sets the value of 	      extensible.classpath, which is being added to javac	         classpath in target 'compile' (android_rules.xml)	     - - - - - - - - - - - - - - - - - - - - -->	<target name="-set-coverage-classpath">	        <property name="extensible.classpath"	                      location="${instrumentation.absolute.dir}/classes" />	</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - - 	      target: -install-tested-project	      Ensures that tested project is installed on 	      the device before we run the tests.	      Used for ordinary tests, without coverage measurement	     - - - - - - - - - - - - - - - - - - - - - - - -->	<target name="-install-tested-project">	        <property name="do.not.compile.again" value="true" />	        <subant target="install">	            <fileset dir="${tested.project.absolute.dir}" includes="build.xml" />	        </subant>	</target>
<!-- ====================================	      target: run-tests	     ==================================== -->	<target name="run-tests" depends="-install-tested-project, install"	                description="Runs tests from the package defined in test.package property">	        <run-tests-helper />	</target>
<!-- - - - - - - - - - - - - - - - -	      target: -install-instrumented	     - - - - - - - - - - - - - - - - -->	<target name="-install-instrumented">	        <property name="do.not.compile.again" value="true" />	        <subant target="-install-with-emma">	            <property name="out.absolute.dir" value="${instrumentation.absolute.dir}" />	            <fileset dir="${tested.project.absolute.dir}" includes="build.xml" />	        </subant>	</target>
<!-- ===============================================	      target: coverage	     =============================================== -->	<target name="coverage" depends="-set-coverage-classpath, -install-instrumented, install"	                description="Runs the tests against the instrumented code and generates	                            code coverage report">	        <run-tests-helper emma.enabled="true">	            <extra-instrument-args>	                <arg value="-e" />	                   <arg value="coverageFile" />	                   <arg value="${emma.dump.file}" />	            </extra-instrument-args>	        </run-tests-helper>	        <echo>Downloading coverage file into project directory...</echo>	        <exec executable="${adb}" failonerror="true">	            <arg value="pull" />	            <arg value="${emma.dump.file}" />	            <arg value="coverage.ec" />	        </exec>	        <echo>Extracting coverage report...</echo>	        <emma>	            <report sourcepath="${tested.project.absolute.dir}/${source.dir}"	                              verbosity="${verbosity}">	                <!-- TODO: report.dir or something like should be introduced if necessary -->	                <infileset dir=".">	                    <include name="coverage.ec" />	                    <include name="coverage.em" />	                </infileset>	                <!-- TODO: reports in other, indicated by user formats -->	                <html outfile="coverage.html" />	           </report>	        </emma>	        <echo>Cleaning up temporary files...</echo>	        <delete dir="${instrumentation.absolute.dir}" />	        <delete file="coverage.ec" />	        <delete file="coverage.em" />	        <echo>Saving the report file in ${basedir}/coverage/coverage.html</echo>	 </target>
</project>

The other non-emma test targets are not added yet. The main idea is to have one build file that can be used in the app source and test source folders both through the IDE and later on through a continuous build server.

Filed under: Uncategorized

by Fred Grott at February 07, 2010 02:45 PM

Google radio fix… or not

I did a forced update to the new image that Google put out last week because I couldn’t wait to get the 3G issues fixed. Well it seemed to make the phone prefer 3G a little more often but I never got HSDPA. After I installed the Cyanogen rom, I found that my Nexus One all of the sudden realized that there was not only 3G at my house but also HSDPA. I highly suggest that you follow my instructions in my previous post to upgrade your Nexus one. Cyanogen works wonders. Head over to his website and buy him a beer or two.

by Wes at February 07, 2010 12:30 AM

Android got MultiTouch

Yes the world already got this celebrated feature since G1 days, thanks to XDA-developers and everybody at the android community. But officially, that’s not the case. This change last week, when Google announced multitouch availability on US version of Nexus One.

So yesterday, Google Maps 3.4 is coming with multitouch for Motorola Droid / Nexus One. It also has the new night-view mode that will surely useful for us who use it during the night.

Below is a video made by great people at droid-life, a bit of review and tips tricks for u guys. G1, M3G or any android <2.0  owners, just be patient!

by jon at February 07, 2010 12:00 AM

February 06, 2010

Cyanogen ROM Beta 4

Even though the Android platform is technically open, there’s still things that are missing from the Nexus One’s stock ROM.  For one, there’s the use of all of the available RAM on the phone.  With the stock rom and maybe 10 apps running I used to have around 29MB of available RAM.  The next thing is the ability to install applications that require root.  There’s many more benefits for installing a non-stock rom such as the one that Cyanogen has created but chances are, if you’re reading this post you already know about them.  This week I decided that I was going to install the newest Beta version of Cyanogen’s ROM so I went searching for decent directions on how to do it.  I found a bunch of different articles across the web but none of them were overly specific to the Mac platform.  So what I’m going to do is write up a Mac specific step-by-step for you to follow to install a Cyanogen ROM.

INSTALLING A NON-GOOGLE ROM WILL VOID YOUR WARRANTY.  I CANNOT BE HELD RESPONSIBLE FOR TURNING YOUR PHONE INTO A BRICK.

Now that my butt is covered we can get on with it.

Step ONE – UNLOCK BOOTLOADER

Download Fastboot

  • Connect via USB to your mac
  • Extract the .zip to your desktop for easy access.
  • Open up terminal (Applications>Utilities)
  • Enter this command to move to the desktop “cd /users/yourusername/desktop/fastboot”
  • Enter this command “./fastboot-mac oem unlock”
  • Reboot your phone

Step TWO – ROOT

Download Superboot

  • Extract the .zip to your desktop for easy access.
  • Turn off your nexus one
  • Boot up the phone in bootloader mode. (hold trackball and press the power key)
  • Open up terminal (Applications>Utilities)
  • If you extracted superboot to your desktop enter this command “cd /users/yourusername/desktop”
  • Then enter “chmod +x install-superboot-mac.sh”
  • Enter “./install-superboot-mac.sh”
  • Reboot your phone

Step THREE – Install the recovery image…. This image will allow you to do so much.  Go here for more details.

  • Download Amon_RA’s recovery image
  • rename the image to “recovery.img”
  • Boot into Bootloader mode once again
  • cd to your fastboot directory and type in “./fastboot-mac oem unlock”
  • Follow the prompts on your phone
  • Let your phone reboot and then boot into bootloader mode one more time
  • Enter the following command “./fastboot-mac flash recovery /users/yourusername/desktop/recovery.img”

Step FOUR – Install the ROM’s

  • Download the most current Cyanogen ROM from here and copy to the root of your flash drive
  • Download the multitouch add-on from here and copy to the root of your flash drive
  • Download the Google App pack from here and copy to the root of your flash drive
  • Boot into recovery mode (hold volume down and hit power) volume down to “recovery mode” and hit the power button
  • **If you get an Android with an exclamation point hit the volume up and power keys at random until you get to recover mode**
  • Using the trackball scroll to Flash zip from SD Card and select it
  • Select the Cyanogen ROM and let it install
  • Repeat for the multitouch add-on and the Google app pack
  • REBOOT and you’re done!

First thing I suggest you do is install a memory app so you can see how much free memory you now have, it’s exciting!

ENJOY!

by Wes at February 06, 2010 04:00 PM

Android Email Information Leak

Android Application Development: Programming with the Google SDK When you view a HTML email using Androids standard IMAP client, it loads certain remote content without warning. This potentially leaks information to the sender about when a message has been read, and the IP address it was read from.

Images in HTML aren't fetched until you hit the "Show pictures" button, but it does load remote content from the following two HTML tags as soon as you view the message, no matter what you do. [...]

by Mike Cardwell at February 06, 2010 01:30 AM

Overlay a bitmap on another

As I’ve been alluding to in my Twitter feed, I’m on the cusp of deploying a new version of MediaDroid, huge re-write to image gallery, but hopefully I’ll get a post about that out later.  Anyway, the previous way I was marking the images to be included in the albums was to have a combo view with a check box and a thumbnail of the image.  Although this works, it takes up a lot of screen real estate and isn’t terribly efficient.  The next version of the image gallery I wrote extended the Android ImageView class and although this solution isn’t much more efficient (the solution for that is in my newest version), it certainly increases the number of images viewed at a time.

(more…)

by michael at February 06, 2010 01:27 AM

February 05, 2010

Want an App for that? appubator Can Make it Happen!

How many of us have a great mobile application idea but have no clue how to bring it to fruition? appubator, a Mobile Software Incubator, offers capital and development resources to bring ideas for mobile applications to market (Apple App Store, Google Android Market and Windows Mobile). The idea submitter receives 30% revenue share on sales from the app.

So how does it work? Simple, go to their website www.appubator.com, signup and submit ideas. They filter the best ideas and target 20-30 apps each year to develop. If selected, ideas submitters can track the status of their submissions. appubator already has its first round of applications and projected to release some of these apps to market in Q1 of 2010.

Maybe you’re a developer with a cool idea but lack capital to fund your project. Maybe you’re an average joe without the major PR and marketing campaigns. Either way, appubator offers an innovative solution for everyday people to take advantage of the “mobile boom”. So the next time you’re stroked with the “killer app idea”, don’t get stuck like the people in those Windows 7 commercials claiming credit for an idea.

by Antonio Wells at February 05, 2010 11:27 PM

Y.A.A.A.M

Yam -noun. 1) the starchy, tuberous root of any of various climbing vines of the genus Dioscorea, cultivated for food in warm regions. 2) the sweet potato. However, this Y.A.A.A.M stands for Yet Another Alternative Android Market. This may not exactly be news related to Android GUI and phone customizing but developers of things such as themes might use this (or any other kind of app). This particular alternative android market was opened by none other then mAPPn, developers of aHome.

Apparently, they launched this in secret on Jan. 18, 2010. Well, maybe not secretly but it sure was a quiet launch. This market is strictly, from what I've read, geared towards the Asian market, specifically the market in China which has 700 million mobile phone users. Now this would be awesome if they all used Android but they don't so that is just a general statistic.

From the description it looks like they offer a complete suite of services from statistics to payment handling, advertising to localization. Localization/translation is needed since the app itself is chinese language only so for everyone who doesn't know how to speak it, this is definately a plus that they offer this.

It seems all this is possible due to a partnership with "China's large Android forum, Androidin". Upon checking that site through google translate, there is actually a link dedicated on that site to aHome.

To top it all off, aHome is offering any developer wanting to submit apps to this new market one month free meaning you keep 100% of your profits for the first month. Not a bad deal.

If you are looking to check out alternative android markets, this would be another one to consider giving a shot since you get the first month free. I'll probably give it a whirl and see how it goes myself. For more information and the contact email, just visit mAPPn's official aMarket page.

If anyone is already using this service, feel free to comment or get in touch with me and let me know how your experience with it has gone so far.

Yes, it looks a lot like the current Android market app.

by ExtremeT (702records@gmail.com) at February 05, 2010 05:00 PM

Live wallpapers

With the introduction of live wallpapers in Android 2.1, users can now enjoy richer, animated, interactive backgrounds on their home screen. A live wallpaper is very similar to a normal Android application and has access to all the facilities of the platform: SGL (2D drawing), OpenGL (3D drawing), GPS, accelerometers, network access, etc. The live wallpapers included on Nexus One demonstrate the use of some of these APIs to create fun and interesting user experiences. For instance, the Grass wallpaper uses the phone's location to compute sunrise and sunset times in order to display the appropriate sky.

Creating your own live wallpaper is easy, especially if you have had previous experience with SurfaceView or Canvas. To learn how to create a live wallpaper, you should check out the CubeLiveWallpaper sample provided with the Android 2.1 SDK; you will find it in the directory platforms/android-2.1/samples/CubeLiveWallpaper.

A live wallpaper is very similar to a regular Android service. The only difference is the addition of a new method, onCreateEngine() whose goal is to create a WallpaperService.Engine. The engine is responsible for handling the lifecycle and the drawing of a wallpaper. The system provides you with a surface on which you can draw, just like you would with a SurfaceView. Drawing a wallpaper can be very expensive so you should optimize your code as much as possible to avoid using too much CPU, not only for battery life but also to avoid slowing down the rest of the system. That is also why the most important part of the lifecycle of a wallpaper is when it becomes invisible. When invisible, for instance because the user launched an application that covers the home screen, a wallpaper must stop all activity.

The engine can also implement several methods to interact with the user or the home application. For instance, if you want your wallpaper to scroll along when the user swipes from one home screen to another, you can use onOffsetsChanged(). To react to touch events, simply implement onTouchEvent(MotionEvent). Finally, applications can send arbitrary commands to the live wallpaper. Currently, only the standard home application sends commands to the onCommand() method of the live wallpaper:

  • android.wallpaper.tap: When the user taps an empty space on the workspace. This command is interpreted by the Nexus and Water live wallpapers to make the wallpaper react to user interaction. For instance, if you tap an empty space on the Water live wallpaper, new ripples appear under your finger.
  • android.home.drop: When the user drops an icon or a widget on the workspace. This command is also interpreted by the Nexus and Water live wallpapers.

Please note that live wallpaper is an Android 2.1 feature. To ensure that only users with devices that support this feature can download your live wallpaper, remember to add the following to your manifest before releasing to Android Market:

  • <uses-sdk android:minSdkVersion="7" />, which lets Android Market and the platform know that your application is using the Android 2.1 version.
  • <uses-feature android:name="android.software.live_wallpaper" />, which lets the Android Market and the platform know that your application is a live wallpaper.

Many great live wallpapers are already available on Android Market and we can't wait to see more!

by Romain Guy (noreply@blogger.com) at February 05, 2010 05:00 PM

Weekly Theme Category Review Feb. 1-7

It's that time again for the weekly review of the theme category on the Android market. Yes it's only the 5th but generally speaking there usually isn't much movement on the weekend even though sales pick up then. It's strange like that but then again there is a lot strange with the market. Let's jump right into it shall we...

First with the Paid themes top 10. It's interesting to see that other events in this world play a role with apps on the Android market including themes. Due to the superbowl being between the Saints and Colts, a Colts theme has jumped into the Top 10 in 6th place. Yet there is no Saints theme in the Top 10, is this a sign? who knows. Other then that there hasn't been much action in the Top 10 aside from some minor shuffling of ranks. Hello Kitty dropped from 2nd to 3rd with Call of Duty: MW2 Theme taking 2nd place now. With those two changes in the market, everything else in the Top 10 has shuffled either up or down 1 rank. Overall though, not a whole lot of action, I just thought it was interesting that the Colts theme suddenly appears and even more interesting that a Saints theme didn't, because I know there is at least one Saints theme available which is sitting just outside the Top 10.

Quick Correction: There are two Call of Duty: MW2 themes, the one now in 2nd place is a new theme. The other one has dropped to 4th place.

Another thing to note...The Michael Jordan theme pack that was in the Top 10 is now gone. However I believe this is because Droid Heaven started another market account and re-listed it under that new account. Why they did that, I have no idea but they do have a snazzy new website look as well. If anyone from Droid Heaven is available for comment, please get in touch with me.

Onwards to the Free themes Top 10. There is still a mass of clock widgets and Easyroid Hi Aim stuff in the Top 10 so, like before, they are not going to be counted. This is for themes only. I am working on a Top 10 widget list still. There has been some action in this section as well, with aHome Theme: Butterfly by mAPPn coming out of nowhere to being 1st in the Top 10. Seriously. I'm still amazed that theme developers still stick to the stock tab shape (even though they skin them). Other then that theme suddenly appearing into the Top 10, everything else has pretty much remained the same with some slight shuffling due to Butterfly coming out of nowhere and into the number one spot.

And now for a quick review of the new Butterfly theme from mAPPn who are the developers of aHome itself. Overall, this theme has a nice feel to it. It's well done with good detail, nice bright colors and a good background that compliments the icons. Changing the widget colors to match the theme certainly improves the completeness of it. The best feature of this theme are the icons which as mentioned are detailed, bright and crisp. A couple of things to note:

- The clock hands aren't centered, they are below the center of the clock face. Not a big deal but if you are picky like me, you'll notice it.

- The tab is the default shape. Again, most theme designers stick with this shape..don't know why but I personally dislike it.

- The myFavs, Gmail and IM icons aren't skinned.

Overall, a nice theme if you like Butterflies or the color purple. However, it doesn't warrant a #1 spot in the Top 10 in my opinion. There are much better themes out there that are complete that should be #1.

Overall Rating: 4/5 stars

In the end, there is still a nice mix available in the Top 10 for both Free and Paid themes that anyone should be able to find something they like. If not, check out the Top 10-20 themes, there's some really good ones there too which, to be honest, belong in the Top 10 more then some of the themes currently residing at the top.

 

by ExtremeT (702records@gmail.com) at February 05, 2010 04:15 PM

Development of an Android App - MyTwitter Part 4

Goal of part 4

Basic MyTwitter is complete and we turn to enhance the application.

1. Using BroadcastReceiver & Notification services in the MyTwitter application
2. Use LocationServices through LocationHelper


1. Using BroadcastReciever & Notification services in the MyTwitter application

As we enhance the MyTwitter application, there was a need to send a message to the UpdaterService that a new message has been posted on your twitter account. Using the BroadcastReceiver and its related methods inside UpdaterService class, one can send a message to the notification manager to allow us to work with the notification.

UpdaterService class has the following added or changed to make this happen;

- Leaveraged the use of db.insertOrThrow(DbHelper.TABLE, null, values) to check if an insert in the database was performed since no exception was thrown by setting our flag haveNewStatus to true.
- Checking the haveNewStatus state determined if to send a Broadcast intent and create a notfication to sent.

Notifications require a Notification instance and NotificationManager i.e.;

Notification is the icon that appears on the top left corner of the Mytwitter screen when its running. And to ensure that the notification continues when phone boots we implement this BootReceiver class;

BootReceiver.java
Code:
package com.example;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

/** This receiver is called when system boots,
* so it can start our UpdaterService.
*/
public class BootReceiver extends BroadcastReceiver {
static final String TAG = "BootReceiver";
@Override
public void onReceive(Context context, Intent intent) {
context.startService(new Intent(context, UpdaterService.class));
Log.d(TAG, "onReceive started UpdaterService");
}
}


UpdaterService.java

Code:
import java.util.List;

import winterwell.jtwitter.Twitter;
import winterwell.jtwitter.TwitterException;
import winterwell.jtwitter.Twitter.Status;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.os.Handler;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.util.Log;

/**
* Responsible for pulling twitter updates from twitter.com and putting it into
* the database.
*/
public class UpdaterService extends Service {
static final String TAG = "UpdaterService";
static final String ACTION_NEW_TWITTER_STATUS = "ACTION_NEW_TWITTER_STATUS";
Twitter twitter;
Handler handler;
Updater updater;
DbHelper dbHelper;
SQLiteDatabase db;
SharedPreferences prefs;

@Override
public void onCreate() {
super.onCreate();
// Get shared preferences
prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs
.registerOnSharedPreferenceChangeListener(new OnSharedPreferenceChangeListener() {
public void onSharedPreferenceChanged(SharedPreferences arg0,
String arg1) {
twitter = null;
}
});

// Setup handler
handler = new Handler();

// Initialize DB
dbHelper = new DbHelper(this);
db = dbHelper.getWritableDatabase();

Log.d(TAG, "onCreate'd");
}

@Override
public void onStart(Intent i, int startId) {
super.onStart(i, startId);
updater = new Updater();
handler.post(updater);
Log.d(TAG, "onStart'ed");
}

@Override
public void onDestroy() {
super.onDestroy();
handler.removeCallbacks(updater); // stop the updater
db.close();
Log.d(TAG, "onDestroy'd");
}

@Override
public IBinder onBind(Intent intent) {
return null;
}

/** Updates the database from twitter.com data */
class Updater implements Runnable {
static final int NOTIFICATION_ID = 47;
static final long DELAY = 100000L;
Notification notification;
NotificationManager notificationManager;
PendingIntent pendingIntent;

Updater() {
notificationManager = (NotificationManager) UpdaterService.this
.getSystemService(Context.NOTIFICATION_SERVICE);
notification = new Notification( android.R.drawable.stat_sys_download,
"MyTwitter", System.currentTimeMillis());
pendingIntent = PendingIntent.getActivity(UpdaterService.this, 0,
new Intent(UpdaterService.this, Timeline.class), 0);
}

public void run() {
boolean haveNewStatus = false;
Log.d(UpdaterService.TAG, "Updater ran.");

try {
List<Status> timeline = getTwitter().getFriendsTimeline();
for (Status status : timeline) {
ContentValues values = DbHelper.statusToContentValues(status);
// Insert will throw exceptions for duplicate IDs
try {
db.insertOrThrow(DbHelper.TABLE, null, values);

// We have a new status
Log.d(TAG, "run() got new status: " + status.getText());
haveNewStatus = true;
} catch (SQLException e) {
}
Log.d(TAG, "Got status: " + status.toString());
}
} catch (TwitterException e) {
Log.e(TAG, "Updater.run exception: " + e);
}

// If there's new status, send a broadcast & notify user
if (haveNewStatus) {
sendBroadcast(new Intent(ACTION_NEW_TWITTER_STATUS));
Log.d(TAG, "run() sent ACTION_NEW_TWITTER_STATUS broadcast.");

// Create the notification
notification.setLatestEventInfo(UpdaterService.this,
"New Twitter Status", "You have new tweets in the timeline",
pendingIntent);
notification.when = System.currentTimeMillis();

notificationManager.notify(NOTIFICATION_ID, notification);
}

// Set this to run again later
handler.postDelayed(this, DELAY);
}
}

// Initializes twitter, if needed
private Twitter getTwitter() {
if (twitter == null) {
// TODO Fix case when login doesn't work
String username = prefs.getString("username", "");
String password = prefs.getString("password", "");

if (username != null && password != null)
twitter = new Twitter(username, password);
}
return twitter;
}
}


Another addition to our Application was a change in the Timeline.java code where the broadcaster receiver is registered and there is a cursor.requery() to reset information on the Timeline activity.

Timeline.java
Code:
package com.example;

import android.app.Activity;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;

/** Displays the list of all timelines from the DB. */
public class Timeline extends Activity {
static final String TAG = "Timeline";
ListView listTimeline;
DbHelper dbHelper;
SQLiteDatabase db;
Cursor cursor;
TimelineAdapter adapter;
BroadcastReceiver twitterStatusReceiver;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.timeline);

// Find views by id
listTimeline = (ListView) findViewById(R.id.listTimeline);

// Initialize DB
dbHelper = new DbHelper(this);
db = dbHelper.getReadableDatabase();

// Get the data from the DB
cursor = db.query(DbHelper.TABLE, null, null, null, null, null,
DbHelper.C_CREATED_AT + " DESC");
startManagingCursor(cursor);
Log.d(TAG, "cursor got count: " + cursor.getCount());

// Setup the adapter
adapter = new TimelineAdapter(this, cursor);
listTimeline.setAdapter(adapter);

// Register to get ACTION_NEW_TWITTER_STATUS broadcasts
twitterStatusReceiver = new TwitterStatusReceiver();
registerReceiver(twitterStatusReceiver, new IntentFilter(
UpdaterService.ACTION_NEW_TWITTER_STATUS));
}

@Override
public void onResume() {
super.onResume();
// Cancel notification
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
notificationManager.cancel(UpdaterService.Updater.NOTIFICATION_ID);
}

@Override
public void onDestroy() {
super.onDestroy();
unregisterReceiver(twitterStatusReceiver);
}

class TwitterStatusReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, "onReceive got ACTION_NEW_TWITTER_STATUS broadcast");
cursor.requery();
}
}
}




NOTE: Necessary to register BootReceiver in the AndroidManifest.xml file
Code:

<receiver android:name=".BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>


<uses-sdk android:minSdkVersion="3" />
...
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
...



2. Use LocationServices through LocationHelper

Another enhancement was to be able to parser our twitter update we post to look for a code "@loc" which would refer to geolocation when we sent the tweet from.

For this we require the use of LocationHelper class that would manage using the LocationManager and get the location of the cellphone by leaving replacing the "@loc" with "(longitude, latitude)" in the tweet message and since there is 140 character limit, we also made sure the output was not going to be beyond the allowed twitter limit.

LocationHelper.java
Code:
import android.content.Context;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.util.Log;

/** Helper class to add support for location in the status updates. */
public class LocationHelper {
static final String TAG = "LocationHelper";
static final String LOC = "@loc"; // code that gets replaced with location
Context context;
LocationManager locationManager;
Location location;
Criteria criteria;
String bestProvider;

public LocationHelper(Context context) {
this.context = context;
locationManager = (LocationManager) context
.getSystemService(Context.LOCATION_SERVICE);
criteria = new Criteria();
bestProvider = locationManager.getBestProvider(criteria, false);
location = locationManager.getLastKnownLocation(bestProvider);
Log.d(TAG, "construct'd with location: " + location);
}

/** Converts the LOC code to current location */
public String updateStatusForLocation(String input) {
String output;
if (location == null) {
output = input.replaceAll(LOC, "UNKNOWN");
} else {
output = input.replaceAll(LOC, String.format("(%f,%f)",
location.getLongitude(), location.getLatitude()));
}

// Make sure we don't go over 140 characters
output = (output.length() > 139) ? output.substring(0, 139) : output;

Log.d(TAG, String.format("updateStatusForLocation(%s)=>%s", input, output));
return output;
}
}


Reference on Location Services: http://marakana.com/forums/android/android_examples/42.html

AndroidManifest.xml
Code:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example" android:versionCode="1" android:versionName="1.0">
<application android:icon="@drawable/twitter_icon"
android:label="@string/app_name">
<activity android:name=".MyTwitter" 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=".Prefs" />
<activity android:name=".Timeline" />
<service android:name=".UpdaterService" />

<receiver android:name=".BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>

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

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
</manifest>



NOTE: To avoid repeating what each method does please review the comments inserted in the code.

ScreenShots



Source
http://marakana.com/static/tutorials/MyTwitter-Part4.zip

by Serete Itebete at February 05, 2010 05:30 AM

February 04, 2010

Android hits the World!

Our lovely green robot is getting stronger and stronger! Behold, based on the latest admob Mobile Metrics report(as of December 2009) we are now:

  • up from 6 to 8 percent in Western Europe
  • up from 2 to 4 percent in Eastern Europe
  • up from 14 to 27 percent in North America
Globally Android held 19% of smartphone, which result from 36% of smartphone request in US are using Android. That’s really close to iPhone which is now 46%.

Granted, the data may not be as accurate as the statistic that Google Android Platform Dashboard provides. But hey, I’m looking more and more people use Android phone everyday in US, so the trend itself should be right, no?

Earlier this week Motorola is announcing Motoroi in Korea, while also keeping an eye on China (delayed by the infamous Google-saga). HTC itself is also a Taiwan-based company, so while now its pretty much North America and Europe war, Android invasion will surely hit Asia sooner than later. Remember, Nexus One is already ship to Singapore and Hongkong.

Are you from Asia? Africa? Getting Nexus one but your country is not in the list?  Tell us more about this, we would love to hear more from you!

by jon at February 04, 2010 11:15 PM

MotoBlur SuperBowl == bubble bath

MOTOROLA is sending email to its customer about the power of MotoBlur being unleashed during the Super Bowl. So what’s the deal here, is Motorola going to release  a new phone during SuperBowl? Or are they going to have some interactive superbowl ads utilizing MotoBlur?

Sign up on their website if you want to be the first to know. I hope that will give us some sort of explanation behind the use an image of bathtub full of bubble.

by jon at February 04, 2010 11:15 PM

Motorola marries Android

Its official, Motorola is wildly in love with Android.

Sometimes last year, Motorola fell in love with the cute green robot. Their first offspring, Motorola Cliq is a phone that really know how to “socialize”. Then quickly Motorola gives birth to Motorola Droid (people outside US call it Milestone). Then in China we see several others phone popping up. Last week, they have their first korean-born phone.

The year is now 2010 in Motoland, and Motorola wants to give birth another 20-30 phones all over the world. All of them will have the same mother: Android. With Motoblur on their hand, and the chance that the next superphone might be a Moto, all the excitement is building in Motoland.

via Cnet Asia

by jon at February 04, 2010 11:15 PM

Google Apple 6 Month Rule on Touching


Six months ago Eric Schmidt the CEO of Google resigned from the board of directors at Apple at the beginning of August 2009 so was a 6 month rule enacted?

In the Urban Dictionary after six months without sex, a man may have sex with anyone he see’s fit so was this applied in regard to multitouch on Android after Eric has gone approximately 6 months without “inter-coursing” with Apple?

The actual resignation announcement came on August 3rd, 2009 but I agree with Sean Riley at AndroidandMe the actual resignation itself may have occurred the day before which would be exactly 6 months prior to the February 2nd, 2010 pinch to zoom availability announcement for the Nexus One.

A year ago it was even reported that Apple also didn’t want the G1 to have a 3.5mm headphone jack due to one of its patents.

Steve Jobs may have understood he needed to prepare and rile up his troops a week before Android released those shackles by reportedly stating, “Google entered the phone business. Make no mistake they want to kill the iPhone. We won’t let them.”

I am curious if the shackles are off on the reported gentlemen’s aggreement not to recruit and poach each others employees especially those working on mobile.

*** The other unofficial 6 month rule is that if you are over someone within 6 months then that means you were never really in love with them in the first place ***

Perhaps as MG Siegler, an admitted Apple fanboy, at TechCrunch pointed out the gloves may have really come off between Google and Apple.

The question is will the Apple App Store accept this Fight Club app.

Google Apple 6 Month Rule on Touching

Post from: Google And Blog


by Michael Martin at February 04, 2010 08:30 PM

brut.all navigation hack update to 3.4.0

brut.all patched the new 3.4.0 version of maps from the eclair builds.
Of course, this works just on eclair builds or builds that have the MT framework stuff inside like Cyanogenmod.

Get the files and a small instruction from => http://s.2030.tk/navhack

by rac at February 04, 2010 03:00 PM