13 giugno 2013

LabelToDo 1.0.3 released

 LabelToDo 1.0.3 on the road!!! Changelog:

Version 1.0.3
★ New widget: Task quick add
★ Larger fonts for notification page
★ Minor bugfixes

Version 1.0.2
★ New widget: Label shortcut on home screen
★ Notification sound choice
★ More options for postpone notifications
★ Bug fixed for landascape screen orientation

Version 1.0.1
★ Custom font size
★ Minor bug fix

Next version
★ New widgets are coming!!!

03 giugno 2013

Android development: shortcut vs widget part 2

Second part of post "Android development: shortcut vs widget", the code.

As from previous post the necessary steps to create a shortcut that user can add to his home screen are 3:
  • create the activity launched when the user adds the shortcut
  • add the previous activity to manifest.xml
  • write the code for previous activity

1. create the activity launched when the user adds the shortcut
This is the simplest task, you have only to create a class that exend Activity, in my case the acticity name is Widget1LabelShortcut.

2. add the previous activity to manifest.xml
You have to add the previous activity Widget1LabelShortcut to manifest.xml. It is a normal activity with an intent-filter as the following code.
Be careful, the shortcut will appear in the list of widgets (or shortcuts depending on the Android version ) with the application name as label . If you want to display a custom name you must add the field label in the manifest, as in the example below. This can be useful for the user to understand what the shortcut makes and if you create multiple shortcuts to avoid confusion.

<activity 
  android:name="com.crbin1.labeltodo.Widget1LabelShortcut"  
  android:configChanges="keyboardHidden|orientation|screenSize"
  android:label="Label shortcut">
  <intent-filter>
    <action android:name="android.intent.action.CREATE_SHORTCUT"/>
    <category android:name="android.intent.category.DEFAULT"/>
  </intent-filter> 
</activity>

3. write the code for activity Widget1LabelShortcut
And now the Activity code to create the shortcut.
In the simplest case this activity is invisible to the user and it only serves to create the shortcut, all the code will be in the method onCreate.
In other cases the activity can have its own ContentView, a layout and respond to user interaction that can customize the shortcut.
The code below with comments should be self explanatory.


  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // You have to create 2 Intents
    
    // Intent #1.  It is the intent that will launch your targer Activity 
    // when user will click the shortcut.
    Intent shortcutIntent = new Intent(this, ActivityTarget.class);
    // You can use this intent to pass parameters to target activity
    // in my app the label id for example
    long labelId; // [...] code to retrieve labelId
    shortcutIntent.putExtra("tid", labelId);
    // Or to set flags
    shortcutIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    shortcutIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
    
    // Intent #2.  It is the intent used to create shortcut.
    Intent intent = new Intent();
    // This intent must have:
    // --- the previous shortcut intent
    intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
    // --- a name showed in home screen
    String name; // [...] code to retrieve name
    intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, name);
    // --- an icon showed in home screen
    ShortcutIconResource ir = 
        Intent.ShortcutIconResource.fromContext(this, R.drawable.w1);
        intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, ir);
        
        // that's all, now you need to set shortcut and finish activity
        setResult(RESULT_OK, intent);
        finish();

    super.onCreate(savedInstanceState);
  }

31 maggio 2013

Android development: shortcut vs widget

In the next version of LabelToDo there will be the first widget, an icon 1x1 that allows user to launch a "non-launcher activity" of the application. In particular widget launches the activity of Tasks, displaying only the tasks with the label that the user has chosen when he created the widget.

I raised the issue of how to do the widget, initially planning to build a "real widget". Many applications use this solution, but I soon realized that it is not the best solution.

How explained here from an Android framework engineer "Widgets should look like widgets, not like shortcuts". Here is the solution, create a shortcut and not a widget, moreover in the latest versions of the Android shortcuts appear in the same menu of widgets and they are widgets for users.

What are the advantages of a shortcut than a widget to create an icon 1x1 that launches an activity?

- Efficiency, a shortcut does the shortcut job better than a widget
- Graphics, the shortcut has its label and its icon and aligns with the other icons on the home better than a widget that has to be adapted and normally has no label
- Writing code, it is not necessary to adjust the widget, shortcut's code is quiet simple

After this long introduction let's see how to create a shortcut that:
- the user can add to the home screen
- launches an activity
- passes parameters to launched activity

The necessary steps are:
1. create the activity launched when the user adds the shortcut
2. add the previous activity to manifest.xml
3. write the code of the previous activity, in the simplest case activity is invisible to the user, it just serves to create a shortcut. There are cases, like mine, in which the activity requires instead an interaction with user to configure the shortcut before creating it

In each case the activity will:
a. create the intent that will launch the target activity on shortcut clic
b. create another intent that do the shortcut
c. add to previous intent the shortcut's description and icon

All the way here to the theory, in the next post we will see a little code.

29 maggio 2013

LabelToDo 1.0.1 released

New version for LabelToDo, the Android application to manage todo list, appointments, tasks.

The main new feature is the possibility to customize font size, you can now choose the best font size for your taste and device.

23 maggio 2013

Recensione LabelToDo

A 3 giorni dalla pubblicazione su Google Play della sua prima versione oggi LabelToDo ha avuto l'onore di essere recensita sul portale TuttoAndroid.net.

Rimando a questo link per la recensione e ringrazio la redazione del portale per le parole spese.

21 maggio 2013

LabelToDo

E' stata rilasciata sul Google Play la prima versione di LabelToDo .

LabelToDo è un'applicazione per Android per gestire impegni, liste TODO e ricordarsi attività da fare. I punti di forza di LabelToDo sono la semplicità di utilizzo e la potenza nell'organizzare le attività sotto varie prospettive (etichette e priorità). Con i suoi promemoria che non ti lasciano mai solo diventerà il tuo assistente personale per non perderti e non dimenticarti più niente.

Per ogni attività puoi:

- assegnare una o più ETICHETTE (stile Gmail) per organizzarle al meglio e non perderti mai niente. Ogni attività può avere più etichette e ogni etichetta può avere più attività e diventare la tua lista di cose da fare.
- assegnare una PRIORITA' in una scala da 1 a 5 e ricercare o ordinare le attività per priorità.
- assegnare PROMEMORIA che ti avvertiranno di scadenze o ti ricorderanno che è ora di eseguire quell'attività.
- associare un testo per prendere note e appunti sull'attività e non dimenticarsi mai di niente.

******* Pagina sul Blog *******

******* Pagina Google Play *******



02 maggio 2013

Statistiche distribuzioni, un anno di Android ad aprile 2013

Ed ecco pubblicate da Google le statistiche sulle distribuzioni Android relative al mese di aprile 2013.


Non ci sono state come si vede grandi rivoluzioni rispetto al mese scorso, soltanto una lenta progressione di Jelly Bean, meglio apprezzabile nella seguente tabella che aggrega i dati per nome versione invece che per API.


Jelly Bean supera Ice Cream Sandwich ma Gingerbread è ancora lontana. Attendiamo adesso il Google I/O di metà mese, secondo gli ultimi rumors sarà presentato Jelly Bean 4.3 e non il tanto atteso Key Lime Pie 5.0 rimandato forse a fine anno.

Infine la solita tabella che aggrega i dati per macro versione.


Anche qua variazioni impercettibili, con le versioni 4.x che non riescono ad avere la diffusione di cui avrebbero bisogno.