Android : Refresh item inside action bar using circular ProgressBar

android-256 This android tutorial is about adding a refresh item in the action bar. When refreshing is disabled, a simple image is shown. When refreshing is running, a circular progressbar is shown. Let’s see the screenshots below to show the results.

circular-progress-bar3 circular-progress-bar4

Read more...

Android : AsyncTask – Best pratices

android-256 AsyncTask in Android allows you to execute some code in background threads so that it does not block the user interface. They are mostly used to query webservices and to download data like pictures. But AsyncTask are not so easy to use if you want them to behave correctly, especially when a configuration change happens (like rotations). This article presents my conclusion of how to correctly use the AsyncTask. If you don’t know the basics about them, i invite you to read first the Android documentation.

Read more...

Android : Admob tutorial

android-256 Integrating Admob into your android application is quite easy, and this is what i am going to show you in this tutorial. Admob allows you to add advertizing banners in your app so you can make some money and become rich. Here’s some screenshots of the result :

nexus-s-portrait nexus-s-landscape

Read more...

Android ListView : highlight selected item

android-256 In this android tutorial, i will show you how to highlight the selected item of a ListView, so that it keeps being highlighted. By default, the highlight disppears so in a list-detail page, you don’t see which item has been selected. Other people use a radio to do that, but i prefer to change the background color to lighten the UI. Let’s see a little demo:

Read more...

Android : Fragment swapping

android-256 This android tutorial shows how to swap two fragments. The goal was to re-use the fragment instances when rotating, no new fragment instances are re-created when rotating. There is also two layouts : one for portrait mode and one for landscape mode. In portrait mode, the second panel is below the first panel. In landscape mode, the second panel is on the right of the first panel. The support android library has been used.
Read more...

Android Database Sqlite : Handling creation and upgrade

android-256 Hi, i explain in this post the way i use to manage the sqlite database creation and upgrades in my android applications. As you may have already seen, this is done using the class SQLiteOpenHelper : you have to write your own sub class and fill the method onCreate and onUpgrade. So, from that point, there can be a lot of strategies like deleting/recreating the database for upgrades. Let’s talk about mine :
Read more...

Splash screen for your android application using fragment activity, rotation working

android-256 Hi, here’s the way i found to make a splash screen for my android application. First thing to note is that rotation works. I use a FragmentActivity so you need the android support compatibility jar. I didnot used a dialog : the splash screen is an activity that launches the main activity after application initialization which is done in a handler. Last thing about my code: i use the library RoboGuice for IOC.

Here’s the result:

Read more...

Configure Swiz ChannelSetHelper using flashvars

flex When you want to connect a remote service using flex and the swiz framework, you have to use the class ChannelSetHelper. Most of time, you will find in the documentation, articles that kind of example :

<swiz:channelsethelper channelId="myAmfChannel"
contextRoot="/project"
serverName="localhost"
serverPort="8080" >
</swiz:channelsethelper>
<mx:remoteobject id="myService" destination="myService"
channelSet="{myAmfChannel}"></mx:remoteobject>

The problem is that the parameters (server,port,context) are hard coded and you have to compile a swf for each of yours environnements (dev, testing, production). These parameters need to be externalized.

Here is the solution using flashvars :
Read more...

Dstat graph using Vmstax

182744_173346436044663_173344652711508_375137_1780982_n Generating graphs from dstat log files is now possible using Vmstax. At the origin, Vmstax was created to build graphics from vmstat log files. It is very convenient to monitor the server load during a load test. All you had to do is to capture the log with a command like “vmstat -n 5 > output.log“, then upload the log file into vmstax and finally, export the graphs as images to include them into reports.
Actually, it is not a so good solution to analyze your servers : a lot of things is missing like network traffics, load per cpu, io per disk and others. Mpstat, iostat, ifstat can be used together but this is inconvenient because you have to manage several log ouputs.

Dstat is a versatile replacement for vmstat, iostat, netstat and ifstat. You can configure it with a bunch of options and you can even developp your own plugins for your specific needs. So, you have only one command to monitor what ever you want.

Here is an example of dstat output :
dstatoutput

To draw charts from dstat output with Vmstax :
Read more...

Vmstax – Build charts/graphs from vmstat log

Hi,

vmstax.png Learning Flex 3, i wanted to test the chart functionnalities. As a case study, i took the problematic of drawing charts from a vmstat log. At the end of your load tests, you have to build the charts. It may takeĀ  some times to do that with Word or OpenOffice and it is not one of my favorite task. So, i decided to make a littleapplication in Flex : you upload your vmstat log, the chars appears and you can export them as images.

Click here to test: vmstax

Next Page →