When you are porting Android, one important feature to check is SD card mount.
Needless to say this feature is needed for many functions to operate in correctly.
Couple of such examples are Bluetooth OPP and FTP profiles.
SD card boot up sequence is as follows :
mmc/sd driver recognises the inserted card, makes device object for every partitions
with unique combination of MAJOR:MINOR numbers and generate uevent.
uevent comes to user-level via kernel socket NETLINK_KOBJECT_UEVENT.
vold handles this uevent in uevent.c::handle_block_event().
vold reads boot sector to determine, how many partitions remains on storage.
If all partitions are found, vold will start "mount" procedure.
If mount is successfully finished, vold sends "volume_mounted:/sdcard" to
com.android.server.MountListener.
com.android.server.MountListener dispatches message to
com.android.server.MountService by handleEvent() method.
com.android.server.MountService provides to framework the logical interpretation of
vold actions such as update icon notification and forwards command from user to vold.
So, in our case MountService::notifyMediaMounted() will generate
Intent.ACTION_MEDIA_MOUNTED.
This intent will start com.android.providers.media.MediaScanner which will start
searching the media content and makes the database. Parallely
com.android.settings.deviceinfo.Memory will update memory status.
Some important files to remember for SD card boot sequence are mmc.c,
ums.c vold.c, voldmgr.c, uevent.c. These files will be useful in debugging SD card
boot up sequence. The configuration file of SD card is vold.conf and is present in
/etc.
SD Card Boot Sequence on Android Platform
1:04 AM
Mr Dollar'Ria
Posted in
Android,
bootsequesnce,
sdcard
Trick to show Your Name after time in Taskbar
12:57 AM
Mr Dollar'Ria
I am interested to share a funny trick with time display in the taskbar....Let us see.....
Trick to show ur Name after time in taskbar....
Here is a trick to add up ur name in place of AM and PM beside time and make urself to feel proud among ur group of friends...
Its simple....
Start -> Control Panel -> Regional and Language option -> Customize (beside English US) -> Go to TIME tab -> change AM or PM symbols from AM or PM to ur name or the word u like to display-> Apply -> OK
How to Hide the drives?
12:54 AM
Mr Dollar'Ria
How to Hide the drives(c:,d:,e:,a:...etc)
How to Hide the drives(c:,d:,e:,a:...etc)
This is a great trick you can play on your friends. To disable the display of local or networked drives when you click My Computer.
1.Go to start->run.Type regedit.Now go to:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Now in the right pane create a new DWORD item and name it NoDrives(it is case sensitive). Now modify it's value and set it to 3FFFFFF (Hexadecimal) .Now restart your computer. So, now when you click on My Computer, no drives will be shown(all gone...). To enable display of drives in My Computer, simply delete this DWORD item that you created.Again restart your computer.You can now see all the drives again. Magic.......
Posted in
hard drives,
hide
Different Ways to Shutdown your Personal Computer
12:52 AM
Mr Dollar'Ria
There are so many different ways to turn off your Windows XP computer, let's look at some of them:
1. The standard approach - click the Start Button with your mouse, then select the Turn Off menu and finally click the Turn Off icon on the Turn Off computer dialog. blink.gif
2. Press Ctrl+Esc key or the Win key and press u two times - the fastest approach.
3. Get the Shutdown utility from Download.com - it add the shut down shortcuts for you. Else create them yourself using approach 4.
4. Create a shutdown shortcut on your desktop. Right click on the desktop, choose New Shortcut and type shutdown -s -t 00 in the area where you are asked to specify the location of the program file. Now you can just double click this icon to turn off the computer. The best location would be your quick launch bar.
5. Press the Win key + R key to open the run window. Type shutdown -s -t 00. [s means shutdown while t means the duration after which you want to initiate the shutdown process].
If some open processes or application won't let you turn off, append a -f switch to force a shut down by closing all active processes.
6. Win+M to minimize all windows and then Alt+F4 to bring the Turn Off computer dialog.
7. Open Windows Task manager (by right clicking the Windows Task bar or Alt+Ctrl+Del) and choose Shut down from the menu. Useful when the Windows are not responding.
World Trade Center Trick from NotePad:
12:45 AM
Mr Dollar'Ria
Trick to find the World Trace Center crash Logic.
1.Open NotePad, type World Trade Center crash flight number Q33N.
2. Increase your font size to 72.
3. change the font type to Wingdings.
and check the result.
How was the result?????
Location Based Services (LBS) on Android :
9:56 AM
Mr Dollar'Ria
Location and maps-based applications are compelling for mobile device users.
You can build application by android.location packages and com.google.android.maps.MapView which is sub class of ViewGroup in Andorid.
Location Services :
1.Android gives your applications access to the location services supported by the device through the classes in the android.location package.
2.The central component of the location framework is the LocationManager system service, which provides APIs to determine location and bearing of the underlying device (if available).
You do not instantiate a LocationManager directly. Rather, you request an instance from the system by calling getSystemService(Context.LOCATION_SERVICE). The method returns a handle to a new LocationManager instance.
Once your application has a LocationManager, your application is able to do three things:
1.we can Query for the list of all LocationProviders for the last known user location.
2.Register/unregister for periodic updates of the user's current location from a location provider .
3.Register/unregister for a given Intent to be fired if the device comes within a given proximity (specified by radius in meters) of a given lat/long.
Next Post we will see this location services with Examples.
Posted in
Android,
android maps location manager,
android.location
Network Programming Tips for Mobile Developers (iPhone, Android, Java ME etc)
1:24 PM
Mr Dollar'Ria
Among the most important things to master for a mobile application developer is network programming. Every mobile application I have developed has involved some kind of network communication. During the year I have learned a thing or two. Read on to get some tips & trick from me.
Quite often the server is developed alongside the client. This means that you as a client developer have to wait for those awfully slow server programmers. Not every server programmer is slow, but most likely you have to wait for some server functionality. In situations like these, it is handy to roll your own server. But as a client developer, you do not want to spend an massive amount of time to setup a server. In fact, if it takes longer than a couple of minutes most client developers give up. What you need is a server that is very quick and easy to setup. Also it needs to be simple, yet powerful. Many server programmers would recommend you setting up a Tomcat server. The advantage of using a Tomcat server is that it is very versatile. But I do not really like Tomcat. It is to advanced for me. Another solution is to use a Jetty server. This is simpler to setup than Tomcat, but yet rather powerful. It could be executed from Maven. As such is is convenient to use for automated tests. Maven takes cares most of the work, including starting and stopping your Jetty server. But there is a new and rising star, the Sinatra server. The Sinatra server is actually a Ruby library. You use Ruby to program the behavior of your server.
A simple “Hello World” implementation for Sinatra looks like the one below (from the Sinatra Book).
require 'rubygems'
require 'sinatra'
get '/' do
"Hello world, it's #{Time.now} at the server!"
end
The file is saved as a file with .rb extension, in our example we save it as “hello.rb”. Then you start your server as simple as this:
ruby hello.rb
You get a nice line saying that Sinatra has taken the stage and that your server uses port 4567. This could of course be changed, if you want to mimic another server without changing your code. It is very easy to extend your server functionality. Ruby is easy to learn and powerful for making your own server without any big hazzle. Take a look at the “Sinatra Book” if you want to master Sinatra.
Another common scenario is that you need to figure out what happens when you make a certain URL request, for example if you do a REST request. Before even writing a single of code, you could use the cURL command line tool. Its available on most platforms, like Unix, Linux, Mac OS, Windows etc. For a matter of discussion, let us assume that you want to check that you programmed your Sinatra web server correctly. Then you the following command:
curl http://127.0.0.1:4567/
The response should look like this:
Hello world, it's Mon Oct 25 20:44:19 +0200 2010 at the server!
So now you know how to implement your own simple server, as well as how to debug your server request using curl. But wait, there is even more tricks I want to share with you. I hope that you feel like reading a little bit more.
I think that XML is a rather misused technologies around. It is used for many things, ranging from describing your builds (Ant, Maven, etc) to describing serialized objects traveling through cyberspace (SOAP, REST etc). When SOAP was introduced, one main argument for XML is that it human readable. What? Have you ever seen a SOAP request that is human readable? If you are about to send and/or receive objects there are much more suitable technologies than XML. Especially when making a mobile client, where XML parsing could take to much time and memory, it is important to understand that there are good alternatives. One good old technology is ASN.1, that is hugely underestimated. It was designed for communicating data between different architectures and CPUs. It is fast even on a 8-bit CPU. The biggest drawback is that it is not widely supported and it requires an ASN.1 compiler. However you could implement your own ASN.1 encoder/decoder quite easy. Another solution that is easier to use, but building on the same principles as ASN.1 is the Hessian protocol. It is a binary web service protocol. The specification is originally designed by Caucho, who did the Resin web server. The specification is open and implemented in many languages, including .NET, Flash, Ruby, Python, Objective-C etc. I have primarily used it for Java ME, where only a subset is implemented. If you use it in Java ME, I would recommend considering using it to store object data in the record store. But now it is more relevant for me to use it on Android or iPhone. The Objective-C variant for iPhone is called HessianKit. It is open source and released under Apache 2.0 license. Thus it is not a viral open source license, which I think is great. I will not describe how to use it, since there already is a good article on the subject “HessianKit Released”. I hope that you will consider using Hessian if you are in the position to decide what web service protocol to use. If you feel the urge to use XML for your web services, you could use Burlap which is the XML version of Hessian. The communication is as simple as it could get using XML.
Another useful tool is a network analyzer. This is good for finding out what happens between the client and server. For example, if you want to take a look at the headers are many times auto generated. I have used Wireshark with great success. It would not say it is easy to use, but when you need to use it is priceless.
These are the tools that I think I use the most for network programming. What are your best tools when doing network programming?
Posted in
Android,
Best Practices,
iPhone,
Java ME,
Maven,
Open Source,
Tips and Tricks




