Welcome Android Developpers

Welcome Android Developpers
My name is Mathias Séguy, I am an Android Expert and Trainer and created the Android2EE company.

For full information, it’s here : Android2EE's Training
You can meet me on Google+, follow me on Twitter or on LinkedIn

Friday, November 25, 2011

Free Android Icons

Bandeau Conference
Hello,

As developpers, we always look for free icons, some are in the SDK but sometimes it's not enough.
You can find thousand of free icons on icones.pro (of course a lot of them are for a non commercial use, but you can contact the author to ask them).
If you have others sources of free icons, drop a comment.

So, Thanks who?
Thanks, Android2ee, the Android Programming Ebooks :o)

Mathias Séguy
mathias.seguy.it@gmail.com
Auteur Android2EE
Ebooks to learn Android Programming.
AndroidEvolution
Retrouvez moi sur Google+
Suivez moi sur Twitter
Rejoignez mon réseau LinkedIn ou Viadeo

Monday, November 21, 2011

Spinner, Managing size and text


Bandeau Conference

Hello,
Sometimes, when using a spinner, you want to manage its size and the font of the displayed text.
To do that you need to do 3 actions (I do that change on the Android spinner example : http://developer.android.com/guide/tutorials/views/hello-spinner.html
1.      Create a spinnertext.xml in your layout folder and define how the spinner’s title has to be displayed
2.      Change your spinner size in your main.xml (where your spinner is defined)
3.      Change your spinner declaration in your activity

Handler and Activity's life cycle, take care about orphan threads!!


Bandeau Conference
Hello,
You have an Activity which uses a Handler. You create your handler and overwrite the handleMessage method, you launch the handler’s thread and that’s it for the handler management… Most of us do such a thing and it’s a huge mistake!!! What happens to your thread when your activity pauses and resumes and worst when it dies and (re)creates? 
You thread becomes an orphan thread !

So you have written something like that :

Thursday, November 17, 2011

My Sensors (new Tutorial on Android2ee)

Bandeau Conference

Hello,
A new tutorial is available on Android2ee. I give you the ability to list the sensors available on the device. Quite simple.
The tutorial is here:
Tutos Android2EE and is called MySensors.
(All tutorials on this page are not available but RSSReader, DynamicGui and MySensors are).

In preparation some articles on sensors (and so some tutorials), see you soon.
So, Thanks who?
Thanks, Android2ee, the Android Programming Ebooks :o)

Mathias Séguy
mathias.seguy.it@gmail.com
Auteur Android2EE
Ebooks to learn Android Programming.
AndroidEvolution
Retrouvez moi sur Google+
Suivez moi sur Twitter
Rejoignez mon réseau LinkedIn ou Viadeo

Wednesday, November 16, 2011

How to disable sleep mode ?o?

Bandeau Conference
Hello,
It's quite easy,
You should use the PowerManager object to retrieve PowerService, then get the PowerManager.WakeLock object and ask for it. So in your Activity class declare the following attribute:

Tuesday, November 15, 2011

Android push methods




Bandeau Conference
Hello,


Sometimes it is very useful for our applications to be notified from our server (well of your server for your applications). This method is called the push and can send notifications to your application.
There are several "sioux" tricks there (via SMS, with a permanent connection to your http server ...). But the problem of "sioux" tricks is that they are not relevant when a turnkey solution is provided by the Android SDK itself. (In french a "sioux" trick is a ultimate trick, an indian trick, don't know the right translation).
In fact, Google makes available to developers servers designed for push and implementing commands that enable you to implement it in your application. This service Android Cloud to Device Messaging Framework also known as the C2DM allows you to implement this feature. Like many of Google features, you must register to enjoy.
The Google tutorial (still very bright) enables you in a "jiffy and two shots ladles" to implement this service:



http://code.google.com/intl/fr/android/c2dm/index.html
And a good push to you: o)


So, Thanks who?
Thanks, Android2ee, the Android Programming Ebooks :o)

Mathias Séguy
mathias.seguy.it@gmail.com
Auteur Android2EE
Ebooks to learn Android Programming.
AndroidEvolution
Retrouvez moi sur Google+
Suivez moi sur Twitter
Rejoignez mon réseau LinkedIn ou Viadeo

Initialize your application when first launched on the device.




Bandeau Conference
Hello,

Today I submit a simple way to implement actions at the first launch of your application on a phone. In other words, how to customize the first launch of your application?

The idea is quite simple and relies on the use of the object SharedPreferences. This object is used to store a set of key-value specific to your application within the system and be able to CRUD (create, read, update, delete) them easily.
The idea is to use this HashMap to retrieve ​​specific values of your application. In particular I would call a Boolean Initialized that lets you know if your application has already been launched on the Android device. The following code shows how to do (this code is in a class that extends Activity in the onCreate method):

How to send an Email O_o'


Bandeau Conference
Hello,
To send an email, just use the code below:

//load string for email:

String[] adresses=getResources().getStringArray(R.string.mail_adresses);
String subject=getResources().getString(R.string.mail_subject);
String body=getResources().getString(R.string.mail_body);

// send an email
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, adresses);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, body);
startActivity(Intent.createChooser(emailIntent, "Send mail..."));

Notice that you are using Intent to call the Emails' sender activity.

So, Thanks who?
Thanks, Android2ee, the Android Programming Ebooks :o)

Mathias Séguy
mathias.seguy.it@gmail.com
Auteur Android2EE
Ebooks to learn Android Programming.
AndroidEvolution

Emulator screen capture ???



Bandeau Conference
Hello,

Just for those who wonder "how can i make a screen capture of my emulator's screen?", have a look in the DDMS view of Eclipse, there is a small button designed for that. It's the small camera in the tab paned that contains "Devices" and "Emultaor Controls" tabs. Yes, just there, on the right of those buttons, there are several buttons (Debug and so on) and the last button is the "Screen Capture" button.

So, Thanks who?
Thanks, Android2ee, the Android Programming Ebooks :o)

Mathias Séguy
mathias.seguy.it@gmail.com
Auteur Android2EE
Ebooks to learn Android Programming.
AndroidEvolution

Retrouvez moi sur Google+
Suivez moi sur Twitter
Rejoignez mon réseau LinkedIn ou Viadeo

How to manage screen brightness for your Activity?



Bandeau Conference
Hello,

There are several notions to understand when trying to change screen brightness.

First: You want to change your Activity's brightness

A simple place to find Android icons set.


Bandeau Conference
Hello,
A simple question that freezes us sometimes : Where can I find free Android icons for my applications...?
Just have a look in your Android SDK, there is a bunch of free android icons. You can find them under:
\android-sdk_r08-windows\android-sdk-windows\platforms\android-10\data\res\
There are sorted by density and locales, that will save yours GUI sometimes.
So, Thanks who?
Thanks, Android2ee, the Android Programming Ebooks :o)

Mathias Séguy
mathias.seguy.it@gmail.com
Auteur Android2EE
Ebooks to learn Android Programming.
AndroidEvolution

Android War Patents


Bandeau Conference
Hello,

As you all know, the war has just begun !!!

Have a look here (for a deeper comprehension of the war):
pcworld: mobile_patent_wars_a_closer_look_at_how_everyone_loses
and there :
smh.com.au: apple-v-samsung-war-might-have-been-avoided
Or there for older posts:
Par techCrunch
Par Htc-Dev
Par TalkAndroid
Par Larry Page (le CEO de Google, la source)

So, Thanks who?
Thanks, Android2ee, the Android Programming Ebooks :o)

Mathias Séguy
mathias.seguy.it@gmail.com
Auteur Android2EE
Ebooks to learn Android Programming.
AndroidEvolution

Android Evolution Infography

Bandeau Conference
Hello,

Just two infographies I like that describe the Android evolution:
fontera.com: Android-InfoGraphic
technobuffalo: android-infographic

So, Thanks who?
Thanks, Android2ee, the Android Programming Ebooks :o)

Mathias Séguy
mathias.seguy.it@gmail.com
Auteur Android2EE
Ebooks to learn Android Programming.
AndroidEvolution

Monday, November 14, 2011

Where are my Android logs ? in your DDMS ;o)


Bandeau Conference
Hello,

Noting that I took a very long time to find my logs Android, I told myself that I was not the only one. And indeed, in dev room, I was not alone.

So where are the logs and how to implement them?

Define your picture in dp not in px


Bandeau Conference

When defining an image (here, for example, use an image 73 pixels wide and 29 pixels high), you tend to write:

Define your pictures for all densities : ldpi,mdpi,hdpi (and xhdpi if you target tablet)



Bandeau Conference

In my previous post we understood why we need to declare our images in the layout file in dp (density-independent pixels). Thus, whatever the density of the screen, the image is the "same" size.
The corollary is: if you define/declare your pictures (in the folder drawable) once regardless of the density, they'll appear coarse in hdpi (and also in ldpi).

Welcome


Bandeau Conference
Welcome on my brand new blog.
For this new day, i will post some french posts here (i translate them first).
But before, who am I?
I am a french guy, expert in Java - J2EE (8 years of experience) and last year i decide to have a deep look at Android. So, i wrote three EBooks on it, I gave conferences in universities and engineering schools. And this year I will do training for Enterprise. So if you are intersted, just send me an email.
I have 3-5 days training session for enterprise, i'll drop soon an english version of the planing.

Mathias Séguy
mathias.seguy.it@gmail.com
Auteur Android2EE
Ebooks pour apprendre la programmation sous Android.
AndroidEvolution