How to get Log of the Day in Android?
<p>I'm writing the code to get the log of all activities which user does in his android device and I succeed. The code is shown below .I had two questions</p>

<p>Que 1 :- How to get the log of whole day?<br/>
Que 2 :- How to get and display called numbers, sms numbers mms number etc?</p>

<p>Due to stackoverflow limitation complete output is not shown because it exceed 6000 characters</p>

<pre><code>private String getFormattedKernelVersion() 
{
    String procVersionStr;

    try {
        BufferedReader reader = new BufferedReader(new FileReader("/proc/version"), 256);
        try {
            procVersionStr = reader.readLine();
        } finally {
            reader.close();
        }

        final String PROC_VERSION_REGEX =
            "\\w+\\s+" + /* ignore: Linux */
            "\\w+\\s+" + /* ignore: version */
            "([^\\s]+)\\s+" + /* group 1: 2.6.22-omap1 */
            "\\(([^\\s@]+(?:@[^\\s.]+)?)[^)]*\\)\\s+" + /* group 2: (xxxxxx@xxxxx.constant) */
            "\\([^)]+\\)\\s+" + /* ignore: (gcc ..) */
            "([^\\s]+)\\s+" + /* group 3: #26 */
            "(?:PREEMPT\\s+)?" + /* ignore: PREEMPT (optional) */
            "(.+)"; /* group 4: date */

        Pattern p = Pattern.compile(PROC_VERSION_REGEX);
        Matcher m = p.matcher(procVersionStr);

        if (!m.matches()) {
            Log.e(TAG, "Regex did not match on /proc/version: " + procVersionStr);
            return "Unavailable";
        } else if (m.groupCount() &lt; 4) {
            Log.e(TAG, "Regex match on /proc/version only returned " + m.groupCount()
                    + " groups");
            return "Unavailable";
        } else {
            return (new StringBuilder(m.group(1)).append("\n").append(
                    m.group(2)).append(" ").append(m.group(3)).append("\n")
                    .append(m.group(4))).toString();
        }
    } catch (IOException e) {  
        Log.e(TAG,
            "IO Exception when getting kernel version for Device Info screen",
            e);

        return "Unavailable";
    }
</code></pre>

<p>output is:</p>

<p><pre>   --------- beginning of /dev/log/system
    01-23 15:59:59.042 I/ActivityManager(  247): Start proc com.sonyericsson.updatecenter       for service com.sonyericsson.updatecenter/.UpdateCenterService: pid=5181 uid=10013 gids={3003, 2001, 1015}
    01-23 16:00:09.042 I/ActivityManager(  247): Start proc com.scoreloop.magicbox for service com.scoreloop.magicbox/.service.MagicBoxService: pid=5189 uid=10023 gids={3003, 1015}
   rvice for service com.sonyericsson.secureclockservice/.SecureClockStartupService: pid=5236 uid=10104 gids={3003}
    01-23 16:14:35.709 I/TelephonyRegistry(  247): notifyDataConnection: state=2 isDataConnectivityPossible=true reason=null interfaceName=rmnet0 networkType=2
    01-23 16:19:33.351 I/ActivityManager(  247): No longer want com.sonyericsson.crashmonitor (pid 4080): hidden #16
    01-23 16:19:33.351 I/ActivityManager(  247): No longer want com.es.BootService in 24960ms
01-23 16:24:06.179 W/ActivityManager(  247): Scheduling restart of crashed service com.sonyericsson.updatecenter/.UpdateCenterService in 34957ms
01-23 16:24:06.179 W/ActivityManager(  247): Scheduling restart of crashed service com.scoreloop.magicbox/.service.MagicBoxService in 44951ms
01-23 16:24:11.149 I/ActivityManager(  247): Start proc com.sonyericsson.android.datamonitor for service com.sonyericsson.android.datamonitor/com.sonyericsson.app.costcontrol.service.DataTrafficService: pid=5392 uid=10058 gids={3003}
01-23 16:27:28.838 I/ActivityManager(  247): Start proc com.facebook.katana for service com.facebook.katana/.service.MediaUploadService: pid=5399 uid=10024 gids={3003, 1006, 1015}
01-23 16:29:38.491 I/ActivityManager(  247): Start proc com.wsandroid.suite for service com.wsandroid.suite/.core.services.BootService: pid=5425 uid=10126 gids={3003, 1015, 1007}
01-23 16:29:48.491 I/ActivityManager(  247): Start proc com.sonyericsson.updatecenter for service com.sonyericsson.updatecenter/.UpdateCenterService: pid=5435 uid=10013 gids={3003, 2001, 1015}
01-23 16:34:05.759 I/ActivityManager(  247): Start proc com.scoreloop.magicbox for service com.scoreloop.magicbox/.service.MagicBoxService: pid=5445 uid=10023 gids={3003, 1015}
01-23 16:45:22.551 I/TelephonyRegistry(  247): notifyDataConnection: state=0 isDataConnectivityPossible=false reason=null interfaceName=null networkType=2
01-23 16:45:22.571 I/TelephonyRegistry(  247): notifyDataConnection: state=1 isDataConnectivityPossible=true reason=null interfaceName=null networkType=2
01-23 16:45:22.941 I/ActivityManager(  247): Start proc com.sonyericsson.appshare for broadcast com.sonyericsson.appshare/.backend.SyncSchedulerReceiver: pid=5467 uid=10138 gids={3003, 1015}
01-23 16:45:23.091 I/ActivityManager(  247): Start proc com.google.android.gm for broadcast com.google.android.gm/.downloadprovider.DownloadReceiver: pid=5475 uid=10018 gids={3003, 1015}
01-23 16:45:28.901 I/TelephonyRegistry(  247): notifyDataConnection: state=2 isDataConnectivityPossible=true reason=null interfaceName=rmnet0 networkType=2
01-23 16:53:41.072 I/ActivityManager(  247): Start proc com.google.android.apps.maps:BackgroundFriendService for service 
01-23 17:04:39.991 I/ActivityManager(  247): Start proc com.scoreloop.magicbox for service com.scoreloop.magicbox/.service.MagicBoxService: pid=5611 uid=10023 gids={3003, 1015}
01-23 17:04:49.991 I/ActivityManager(  247): Start proc com.sonyericsson.updatecenter for service com.sonyericsson.updatecenter/.UpdateCenterService: pid=5630 uid=10013 gids={3003, 2001, 1015}
01-23 17:05:28.529 V/BackupManagerService(  247): Backup requested but nothing pending
01-23 17:13:59.866 I/TelephonyRegistry(  247): notifyDataConnection: state=3 isDataConnectivityPossible=true reason=2GVoiceCallStarted interfaceName=rmnet0 networkType=2
01-23 17:13:59.886 I/ActivityManager(  247): Start proc com.facebook.orca for broadcast com.facebook.orca/.phone.TelephonyReceiver: pid=5659 uid=10148 gids={3003, 1015, 1006}
01-23 17:14:00.036 D/StatusBarService(  313): Notification has fullScreenIntent; sending fullScreenIntent
01-23 17:14:00.036 I/ActivityManager(  247): Starting: Intent { act=android.intent.action.MAIN flg=0x10840000 cmp=com.android.phone/.SemcInCallScreen } from pid -1
01-23 17:14:00.746 W/WindowManager(  247): Layout repeat skipped after too many iterations
01-23 17:14:00.746 W/WindowManager(  247): Layout repeat skipped after too many iterations
01-23 17:14:00.746 W/WindowManager(  247): Layout repeat skipped after too many iterations
01-23 17:14:00.756 W/WindowManager(  247): Animation repeat aborted after too many iterations
01-23 17:14:02.796 I/ActivityManager(  247): No longer want com.sonyericsson.widget.analogclock (pid 4656): hidden #16
01-23 17:14:02.806 I/ActivityManager(  247): Start proc org.videolan.vlc.betav7neon for broadcast org.videolan.vlc.betav7neon/.PhoneStateReceiver: pid=5675 uid=10152 gids={3003, 1007, 1015}
01-23 xx flg=0x10000000 cmp=com.android.phone/.SemcInCallScreen (has extras) } from pid 351
01-23 17:21:03.821 I/ActivityManager(  247): No longer want com.sonyericsson.idd.agent (pid 4221): hidden #16
01-23 17:21:03.821 I/ActivityManager(  247): No longer want org.videolan.vlc.betav7neon (pid 5675): hidden #17
01-23 17:21:04.161 I/ActivityManager(  247): Start proc org.videolan.vlc.betav7neon for broadcast org.videolan.vlc.betav7neon/.PhoneStateReceiver: pid=5778 uid=10152 gids={3003, 1007, 1015}
01-23 17:21:04.352 I/TelephonyRegistry(  247): notifyDataConnection: state=3 isDataConnectivityPossible=true reason=2GVoiceCallStarted interfaceName=rmnet0 networkType=2
01-23 17:21:04.521 I/ActivityManager(  247): No longer want com.sonyericsson.androidapp.fbmusiclike (pid 4305): hidden #16
01-23 17:21:05.101 I/ActivityManager(  247): Start proc com.sonyericsson.idd.agent for broadcast com.sonyericsson.idd.agent/.IDDAutoStart: pid=5788 uid=10010 gids={3003, 1015}
01-23 17:21:05.521 I/ActivityManager(  247): Start proc com.sonyericsson.androidapp.fbmusiclike for broadcast com.sonyericsson.androidapp.fbmusiclike/.facebook.AvailabilityChangeReceiver: pid=5797 uid=10011 gids={3003}
01-23 17:21:06.021 I/ActivityManager(  247): No longer want com.sonyericsson.facebook.proxylogin (pid 4358): hidden #16
01-23 17:21:06.021 I/ActivityManager(  247): No longer want com.sonyericsson.statusswitch (pid 481): hidden #16
01-23 17:21:06.031 W/ActivityManager(  247): Scheduling restart of crashed service com.sonyericsson.statusswitch/.UpdateService in 5000ms
01-23 17:21:id=5930 uid=10018 gids={3003, 1015}
01-23 17:27:42.752 W/InputManagerService(  247): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@2b3b21e0 (uid=10018 pid=5930)
01-23 17:27:46.282 I/ActivityManager(  247): Start proc com.wsandroid.suite for service com.wsandroid.suite/.core.services.BootService: pid=5952 uid=10126 gids={3003, 1015, 1007}
01-23 17:27:56.292 I/ActivityManager(  247): Start proc com.sonyericsson.updatecenter for service com.sonyericsson.updatecenter/.UpdateCenterService: pid=5962 uid=10013 gids={3003, 2001, 1015}
01-23 17:28:06.282 I/ActivityManager(  247): Start proc com.scoreloop.magicbox for service com.scoreloop.magicbox/.service.MagicBoxService: pid=5970 uid=10023 gids={3003, 1015}
01-23 17:39:36.512 I/ActivityManager(  247): Start proc com.sonyericsson.androidapp.storefront for service com.sonyericsson.androidapp.storefront/.service.StoreFrontService: pid=5991 uid=10042 gids={3003}
01-23 17:45:26.520 I/TelephonyRegistry(  247): notifyDataConnection: state=0 isDataConnectivityPossible=false reason=null interfaceName=null networkType=2
01-23 17:45:26.540 I/TelephonyRegistry(  247): notifyDataConnection: state=1 isDataConnectivityPossible=true reason=null interfaceName=null networkType=2
01-23 17:45:26.730 I/ActivityManager(  247): Start proc com.sonyericsson.appshare for broadcast com.sonyericsson.appshare/.backend.SyncSchedulerReceiver: pid=6008 uid=10138 gids={3003, 1015}
01-23 17:45:32.520 I/TelephonyRegistry(  247): notifyDataConnection: state=2 isDataConnectivityPossible=true reason=null interfaceName=rmnet0 networkType=2
01-23 17:47:41.072 I/ActivityManager(  247): Start proc com.google.android.apps.maps:BackgroundFriendService for service com.google.android.apps.maps/com.google.googlenav.friend.android.BackgroundFriendService: pid=6044 uid=10050 gids={3003, 1015}
01-23 17:49:22.453 I/ActivityManager(  247): No longer want com.sonyericsson.usbux (pid 315): hiodClient$Stub$Proxy@2b48a9a8
01-23 18:35:18.629 I/ActivityManager(  247): Starting: Intent { act=android.intent.action.VIEW dat=content://com.google.android.providers.talk/messagesByAcctAndContact/1/saklani.sanjeev%40gmail.com flg=0x34000000 cmp=com.google.android.talk/.ChatScreen bnds=[0,94][320,158] (has extras) } from pid -1
01-23 18:35:18.699 I/ActivityManager(  247): Start proc com.google.android.talk for activity com.google.android.talk/.ChatScreen: pid=6413 uid=10121 gids={3003, 1015, 1006}
01-23 18:35:28.349 W/InputManagerService(  247): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@2b50a888 (uid=10121 pid=6413)
01-23 18:35:29.749 I/ActivityManager(  247): Starting: Intent { act=android.intent.action.PROVIDER_CHANGED cat=[dashingsanchit@gmail.com] dat=content://gmail-ls/unread/^i flg=0x4000000 cmp=com.google.android.gm/.ConversationListActivity bnds=[0,94][320,158] (has extras) } from pid -1
01-23 18:35:29.749 W/ActivityManager(  247): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=android.intent.action.PROVIDER_CHANGED cat=[dashingsanchit@gmail.com] dat=content://gmail-ls/unread/^i flg=0x4000000 cmp=com.google.android.gm/.ConversationListActivity bnds=[0,94][320,158] (has extras) }
01-23 18:35:40.479 I/Activin permission android.permission.PACKAGE_VERIFICATION_AGENT in package com.android.vending
01-23 19:13:48.480 W/PackageManager(  247): Unknown permission android.permission.MANAGE_USERS in package com.android.vending
01-23 19:13:48.480 W/PackageManager(  247): Unknown permission android.permission.INTERACT_ACROSS_USERS in package com.android.vending
01-23 19:13:48.510 W/PackageManager(  247): Unknown permission com.sonyericsson.permission.CUSTOMIZATION in package com.sonyericsson.retaildemo
01-23 19:13:48.510 W/PackageManager(  247): Not granting permission android.permission.CLEAR_APP_USER_DATA to package com.sonyericsson.retaildemo (protectionLevel=2 flags=0xbe45)
01-23 19:13:48.510 W/PackageManager(  247): Unknown permission com.sonyericsson.extras.liveview.permission.LIVEVIEW_API in package com.sonyericsson.androidapp.timescapefeedsplugin
01-23 19:13:48.510 W/PackageManager(  247): Unknown permission com.sonyericsson.permission.CONTACTS_PICK_CONVERSATIONS_TARGET in package com.sonyericsson.conversations
01-23 19:13:48.510 W/PackageManager(  247): Unknown permission com.sonyericsson.permission.ACCESS_PROTECTED_CONTACTS in package com.sonyericsson.conversations
01-23 19:13:48.510 Was) }, flags=2
01-23 19:15:04.730 E/fb_music_like( 6974): No action, ignoring intent
01-23 19:15:04.73T freed 174K, 50% free 2892K/5767K, external 743K/1036K, paused 27ms
01-23 19:15:16.990 D/dalvikvm( 3102): GC_CONCURRENT freed 461K, 46% free 3767K/6855K, external 743K/1036K, paused 2ms+3ms
01-23 19:15:17.180 D/dalvikvm( 5816): GC_CONCURRENT freed 442K, 49% free 3119K/6087K, external 743K/1036K, paused 1ms+3ms
01-23 19:15:17.630 D/dalvikvm( 3278): GC_EXPLICIT freed 200K, 51% free 2875K/5767K, external 743K/1036K, paused 25ms
01-23 
01-23 19:15:22.480 D/dalvikvm(  247): GC_EXPLICIT freed 387K, 38% free 7506K/11975K, external 1343K/1943K, paused 69ms
01-23 19:15:23.390 D/dalvikvm( 6907): GC_CONCURRENT freed 525K, 45% free 3675K/6599K, external 1330K/1607K, paused 3ms+3ms
01-23 19:15:23.580 D/dalvikvm( 6907): GC_FOR_MALLOC freed 1062K, 55% free 3089K/6855K, external 924K/1436K, paused 54ms</p>

<p>Sent from my Sony Ericsson Xperia mini pro</pre></p>
