5. Da dove siamo partiti
● GDG Bologna è in "partenza"
● supporto agli organizzatori
● conoscenza di Android
● hey ma un'applicazione Android per la
devfest non esiste?
● GDG Berlin / GDG Zurich (ieri)
6. Requisiti / Punto di partenza
● 15-20 giorni di tempo
● lavoro notturno e nei weekend
● progettazione in pausa pranzo
● ragazze imbufalite
7. Punto di partenza tecnico
● non abbiamo tempo
● android 4.0
● solo smartphone
● fragment ed intent
● ragazze imbufalite
12. Sviluppo
● nuovo progetto Eclipse
● Build SDK: Android 4.1 (API 16)
● Minimum Required SDK: Android 4.0 (API
14)
● android compatibility package
13. Sviluppo - Agenda
● viewpager
● fragment
● custom adapter
(section list)
● no images!
14. Sviluppo - Dettaglio Talk
● dialog fragment
● images!
● intent per condivisione
● intent per aggiunta a
calendario
15. Sviluppo - Intent condivisione
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT,
talk.getTitle()+" - "+talk.getSpeaker());
startActivity(Intent.createChooser(intent, app.
getResources().getString(R.string.
title_sharing_dialog)));
16. Sviluppo - Intent calendario
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setData(Events.CONTENT_URI)
.putExtra(CalendarContract.
EXTRA_EVENT_BEGIN_TIME, talk.getStart().
getTimeInMillis())
.putExtra(CalendarContract.
EXTRA_EVENT_END_TIME, talk.getEnd().
getTimeInMillis())
.putExtra(Events.TITLE, talk.getTitle())
.putExtra(Events.EVENT_LOCATION,
talk.getPlace())
17. Sviluppo - Libreria
android-devfest-2012 android-devfest
json strings.xml List Fragment
Class jsonRaw = R.raw.class;
<string-array name="fest">
<item>Firenze</item>
Field field = jsonRaw.
<item>Sicilia</item>
getField(fest[0].toLowerCase());
</string-array>
InputStream is = activity.getResources().
openRawResource(field.getInt(null));
18. Sviluppo - NFC
String url = "https://play.google.com/store/apps/details?id=org.gdgbologna.devfest2012";
byte[] payload = url.getBytes();
NdefRecord ndefRecord = new NdefRecord(NdefRecord.TNF_ABSOLUTE_URI,
payload, new byte[0], payload);
mNdefPushMessage = new NdefMessage(new NdefRecord[] { ndefRecord });
mNfcAdapter.setNdefPushMessage(mNdefPushMessage, this);
19. Problemi incontrati
● intent calendario
○ +1 per i nexus
○ insulti per HTC, SAMSUNG, etc..
● fragment
○ bellissima idea
○ portano via tempo...
○ gestione ciclo di vita e viewpager