Tips & Tricks: BugSense

Hi developers,

Last week there was no tips and tricks from PullesSon – Android, because of the workload.

This time it will be not really about code, but about bugs.

For those who found the errors overview in the Android market console useful, but almost never get errors reported, there is BugSense.

BugSense will catch all the exceptions and send it right away to your BugSense dashboard and if you have it activated, also it will send you notification to your email.

Signing up is easy and it will direct you to add an application. Be sure to remember your API Key, even it’s also in your dashboard available.
After this there has to be made some code change in your application. First you have to download and add the library file to your project, then you need to add the internet permission by adding to the android manifest file. Then in the onCreate() method you have to add: BugSenseHandler.setup(this, YOUR_API_KEY);, where YOUR_API_KEY is your API Key from your dashboard (or the one previously remembered). Also don’t forget to include import com.bugsense.trace.BugSenseHandler; else you will get compile errors.

The dashboard is really intuitive and easy to understand. A quick overview of the errors reported is shown on the first page of your dashboard with exception name, file name, line number, OS version and application version. From here you can click on the error and it will show details.

The details page will show you all that’s included in the quick overview plus the amount of occurrences, a short stacktrace, last error instance time, ip, country, phone model, screen information and communication information.

In the configuration of the app registered in the dashboard you can add project viewers, like developers that want to know the error information. Also there is an option to set the application stage between testing and production.

Besides they have twitter and a chat to talk for support.

We also got an email from BugSense, mentioning if we needed help to implement the code, because there were no errors reported.
Seems we configured all well and we did some good coding, because there were just no errors generated. After provoking an exception we received it in the dashboard.

Good service and support on the BugSense’ side and easy to implement and understand. Keep up the good work.

Regards,
PullesSon – Android

Tips & Tricks: CalendarContract

Hi Android dev’s,

Like most of you already know: We got sauce! or in normal tems, Google released the source of Android 4.0 a.k.a. Ice Cream Sandwich (ICS). For more information see: http://source.android.com/.
This is the first version with code for tablets and phones. And with the source available the carriers and custom rom developers will roll out ICS soon.
That’s why today we will talk about a new feature in the SDK of ICS.

CalendarContract is the Calendar API for Android 4.0 (SDK 14) and up.

CalendarContract provides developers an interface for the calendar URI’s and data columns.

CalendarContract.Calendars:
This table holds the calendar specific information. Each row in this table contains the details for a single calendar, such as the name, color, sync info, etc.
CalendarContract.Events:
This table holds the event specific information. Each row in this table has the info for a single event. It contains information such as event title, location, start time, end time, etc. The event can occur one-time or can recur multiple times. Attendees, reminders, and extended properties are stored on separate tables and reference the _ID to link them with the event.
CalendarContract.Instances:
This table holds the start and end time for occurrences of an event. Each row in this table represents a single occurrence. For one-time events there will be a 1:1 mapping of instances to events. For recurring events, multiple rows will automatically be generated which correspond to multiple occurrences of that event.
CalendarContract.Attendees:
This table holds the event attendee or guest information. Each row represents a single guest of an event. It specifies the type of guest they are and their attendance response for the event.
CalendarContract.Reminders:
This table holds the alert/notification data. Each row represents a single alert for an event. An event can have multiple reminders. The number of reminders per event is specified in MAX_REMINDERS which is set by the Sync Adapter that owns the given calendar. Reminders are specified in minutes before the event and have a type.
CalendarContract.ExtendedProperties:
This table hold opaque data fields used by the sync adapter. The provider takes no action with items in this table except to delete them when their related events are deleted.

Add a new event to the calendar directly:

long startMillis = 0;
long endMillis = 0;
Calendar beginTime = Calendar.getInstance();
beginTime.set(2011, 11, 14, 16, 00);    //year, month, day, hour, minute
startMillis = beginTime.getTimeInMillis();
Calendar endTime = Calendar.getInstance();
endTime.set(2011, 11, 14, 17, 00);    //year, month, day, hour, minute
endMillis = endTime.getTimeInMillis();
 
ContentResolver cr = getContentResolver();
ContentValues values = new ContentValues();
values.put(CalendarContract.Events.DTSTART, startMillis);
values.put(CalendarContract.Events.DTEND, endMillis);
values.put(CalendarContract.Events.TITLE, "Ice Cream Sandwich Source Code Release");
values.put(CalendarContract.Events.DESCRIPTION, "Release the ICS source code, so all android followers are happy and will be busy with compiling their custom firmware base on the new source code.");
values.put(CalendarContract.Events.CALENDAR_ID, 3);
Uri uri = cr.insert(CalendarContract.Events.CONTENT_URI, values);

For this method you will need the permission: android.permission.READ_CALENDAR, if you don’t want extra permissions in your app, just launch a calendar intent with the event data.

To get a list of all the calendar event, just query Calendar.Events through the ContentResolver.

Regards,
PullesSon – Android

Let Me Android That For You – Update

Hi all,

Let Me Android That For You is updated and you can now add your own Bit.Ly userid and API key. Press the menu button and then: Change Bitly settings.

This new version is now available in the market.

Regards,
PullesSon – Android

Android market link for Developer PullesSon

Find all our applications by clicking the following image:

Available in Android Market

LMATFY is updated

Hi all.

LMATFY is just updated with a widget. The widget works like a shortcut, because their is no way to add a inputbox to a widget. It will be updated when it’s available.

The code is ready for the input box, only the Android OS doesn’t support it (yet).

Greetings,
Niek
PullesSon – Android