I am trying to construct a simple app that allows me to see my call
log, displaying names only, in a "simple_list_item_1". I am totally
new to Java and Android and this is really the first step in creating
my first app.

Here's what I've got (go easy, please):

Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
      package="com.ipaulpro.calls"
      android:versionCode="1"
      android:versionName="1.0.0">
    <application android:icon="@drawable/icon" android:label="@string/
app_name" android:debuggable="true">
        <activity android:name=".Calls"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-permission android:name="android.permission.READ_CONTACTS"></
uses-permission>
</manifest>

Calls.java

package com.ipaulpro.calls;

import android.app.ListActivity;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.CallLog;
import android.widget.ListAdapter;
import android.widget.SimpleCursorAdapter;

public class Calls extends ListActivity {
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        Cursor c = getContentResolver().query(
                       android.provider.CallLog.Calls.CONTENT_URI,
                       null, null, null,
                       android.provider.CallLog.Calls.DATE+ " DESC");
           startManagingCursor(c);

           ListAdapter adapter = new SimpleCursorAdapter(
               this,
               android.R.layout.simple_list_item_1,
               c,
               new String[] {CallLog.Calls.CACHED_NAME},
               new int[] {CallLog.Calls.MISSED_TYPE}
       );

       setListAdapter(adapter);
    }
}

Main.xml

<?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
         android:orientation="vertical"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent">

     <ListView android:id="@id/android:list"
               android:layout_width="fill_parent"
               android:layout_height="fill_parent"

     />
           <TextView  id="@+id/row_number"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
          />

</LinearLayout>

And here' s the LogCat:

03-17 12:45:15.992: DEBUG/dalvikvm(4426): Calling exit(1)
03-17 12:45:16.012: INFO/ActivityManager(58): Process
com.ipaulpro.calls (pid 4426) has died.
03-17 12:45:16.012: INFO/WindowManager(58): WIN DEATH: Window{430edaa0
com.ipaulpro.calls/com.ipaulpro.calls.Calls}
03-17 12:45:16.022: DEBUG/Zygote(31): Process 4426 exited cleanly (1)
03-17 12:45:16.452: DEBUG/AndroidRuntime(4435): >>>>>>>>>>>>>>
AndroidRuntime START <<<<<<<<<<<<<<
03-17 12:45:16.452: DEBUG/AndroidRuntime(4435): CheckJNI is OFF
03-17 12:45:16.582: DEBUG/AndroidRuntime(4435): --- registering native
functions ---
03-17 12:45:16.592: INFO/jdwp(4435): received file descriptor 17 from
ADB
03-17 12:45:17.252: DEBUG/PackageParser(58): Scanning package: /data/
app/vmdl16664.tmp
03-17 12:45:17.352: WARN/PackageManager(58): Attempt to re-install
com.ipaulpro.calls without first uninstalling.
03-17 12:45:17.362: INFO/installd(35): unlink /data/dalvik-cache/
d...@app@vmdl16664....@classes.dex
03-17 12:45:17.372: DEBUG/AndroidRuntime(4435): Shutting down VM
03-17 12:45:17.382: DEBUG/dalvikvm(4435): DestroyJavaVM waiting for
non-daemon threads to exit
03-17 12:45:17.382: INFO/dalvikvm(4435): DestroyJavaVM shutting VM
down
03-17 12:45:17.382: DEBUG/dalvikvm(4435): HeapWorker thread shutting
down
03-17 12:45:17.392: DEBUG/dalvikvm(4435): HeapWorker thread has shut
down
03-17 12:45:17.392: DEBUG/jdwp(4435): JDWP shutting down net...
03-17 12:45:17.392: DEBUG/jdwp(4435): Got wake-up signal, bailing out
of select
03-17 12:45:17.392: INFO/dalvikvm(4435): Debugger has detached; object
registry had 1 entries
03-17 12:45:17.392: DEBUG/dalvikvm(4435): VM cleaning up
03-17 12:45:17.412: ERROR/dalvikvm(4435): pthread_setspecific failed,
err=22
03-17 12:45:17.432: DEBUG/dalvikvm(4435): LinearAlloc 0x0 used 529708
of 4194304 (12%)
03-17 12:45:17.792: DEBUG/dalvikvm(58): GC freed 6717 objects / 411200
bytes in 380ms
03-17 12:45:17.982: DEBUG/AndroidRuntime(4443): >>>>>>>>>>>>>>
AndroidRuntime START <<<<<<<<<<<<<<
03-17 12:45:17.982: DEBUG/AndroidRuntime(4443): CheckJNI is OFF
03-17 12:45:18.112: DEBUG/AndroidRuntime(4443): --- registering native
functions ---
03-17 12:45:18.122: INFO/jdwp(4443): received file descriptor 17 from
ADB
03-17 12:45:18.792: DEBUG/PackageParser(58): Scanning package: /data/
app/vmdl16665.tmp
03-17 12:45:18.892: DEBUG/PackageManager(58): Removing package
com.ipaulpro.calls
03-17 12:45:18.902: DEBUG/PackageManager(58):   Activities:
com.ipaulpro.calls.Calls
03-17 12:45:18.902: DEBUG/PackageManager(58): Scanning package
com.ipaulpro.calls
03-17 12:45:18.912: INFO/PackageManager(58): /data/app/vmdl16665.tmp
changed; unpacking
03-17 12:45:18.922: DEBUG/installd(35): DexInv: --- BEGIN '/data/app/
vmdl16665.tmp' ---
03-17 12:45:19.062: DEBUG/dalvikvm(4449): DexOpt: load 18ms, verify
11ms, opt 0ms
03-17 12:45:19.102: DEBUG/installd(35): DexInv: --- END '/data/app/
vmdl16665.tmp' (success) ---
03-17 12:45:19.102: DEBUG/PackageManager(58):   Activities:
com.ipaulpro.calls.Calls
03-17 12:45:19.312: INFO/installd(35): move /data/dalvik-cache/
d...@app@vmdl16665....@classes.dex -> /data/dalvik-cache/
d...@app@com.ipaulpro.calls....@classes.dex
03-17 12:45:19.332: DEBUG/PackageManager(58): New package installed
in /data/app/com.ipaulpro.calls.apk
03-17 12:45:19.552: DEBUG/AndroidRuntime(4443): Shutting down VM
03-17 12:45:19.552: DEBUG/dalvikvm(4443): DestroyJavaVM waiting for
non-daemon threads to exit
03-17 12:45:19.582: INFO/dalvikvm(4443): DestroyJavaVM shutting VM
down
03-17 12:45:19.582: DEBUG/dalvikvm(4443): HeapWorker thread shutting
down
03-17 12:45:19.582: DEBUG/dalvikvm(4443): HeapWorker thread has shut
down
03-17 12:45:19.582: DEBUG/jdwp(4443): JDWP shutting down net...
03-17 12:45:19.582: DEBUG/jdwp(4443): +++ peer disconnected
03-17 12:45:19.582: INFO/dalvikvm(4443): Debugger has detached; object
registry had 1 entries
03-17 12:45:19.592: DEBUG/dalvikvm(4443): VM cleaning up
03-17 12:45:19.622: DEBUG/dalvikvm(4443): LinearAlloc 0x0 used 529708
of 4194304 (12%)
03-17 12:45:19.632: DEBUG/ActivityManager(58): Uninstalling process
com.ipaulpro.calls
03-17 12:45:20.332: DEBUG/AndroidRuntime(4454): >>>>>>>>>>>>>>
AndroidRuntime START <<<<<<<<<<<<<<
03-17 12:45:20.332: DEBUG/AndroidRuntime(4454): CheckJNI is OFF
03-17 12:45:20.412: DEBUG/dalvikvm(58): GC freed 5504 objects / 293416
bytes in 420ms
03-17 12:45:20.532: WARN/ResourceType(58): Failure getting entry for
0x7f07009a (t=6 e=154) in package 0: 0xffffffb5
03-17 12:45:20.762: DEBUG/AndroidRuntime(4454): --- registering native
functions ---
03-17 12:45:20.792: INFO/jdwp(4454): received file descriptor 17 from
ADB
03-17 12:45:20.792: DEBUG/dalvikvm(103): GC freed 2725 objects /
145128 bytes in 367ms
03-17 12:45:21.742: DEBUG/ActivityManager(58): Uninstalling process
com.ipaulpro.calls
03-17 12:45:21.742: INFO/ActivityManager(58): Starting activity:
Intent { flags=0x10000000 comp={com.ipaulpro.calls/
com.ipaulpro.calls.Calls} }
03-17 12:45:21.852: DEBUG/AndroidRuntime(4454): Shutting down VM
03-17 12:45:21.852: DEBUG/dalvikvm(4454): DestroyJavaVM waiting for
non-daemon threads to exit
03-17 12:45:21.862: INFO/ActivityManager(58): Start proc
com.ipaulpro.calls for activity com.ipaulpro.calls/.Calls: pid=4463
uid=10041 gids={}
03-17 12:45:21.892: INFO/dalvikvm(4454): DestroyJavaVM shutting VM
down
03-17 12:45:21.892: DEBUG/dalvikvm(4454): HeapWorker thread shutting
down
03-17 12:45:21.892: DEBUG/dalvikvm(4454): HeapWorker thread has shut
down
03-17 12:45:21.892: DEBUG/jdwp(4454): JDWP shutting down net...
03-17 12:45:21.902: DEBUG/jdwp(4454): Got wake-up signal, bailing out
of select
03-17 12:45:21.902: INFO/dalvikvm(4454): Debugger has detached; object
registry had 1 entries
03-17 12:45:21.902: DEBUG/dalvikvm(4454): VM cleaning up
03-17 12:45:21.912: ERROR/AndroidRuntime(4454): ERROR: thread attach
failed
03-17 12:45:21.942: DEBUG/dalvikvm(4454): LinearAlloc 0x0 used 541500
of 4194304 (12%)
03-17 12:45:21.972: INFO/jdwp(4463): received file descriptor 13 from
ADB
03-17 12:45:22.082: WARN/ActivityThread(4463): Application
com.ipaulpro.calls is waiting for the debugger on port 8100...
03-17 12:45:22.112: INFO/System.out(4463): Sending WAIT chunk
03-17 12:45:22.142: INFO/dalvikvm(4463): Debugger is active
03-17 12:45:22.332: INFO/System.out(4463): Debugger has connected
03-17 12:45:22.332: INFO/System.out(4463): waiting for debugger to
settle...
03-17 12:45:22.352: INFO/ActivityManager(58): Stopping service:
com.android.vending/.PackageMonitorReceiver
$UpdateCheckinDatabaseService
03-17 12:45:22.532: INFO/System.out(4463): waiting for debugger to
settle...
03-17 12:45:22.743: INFO/System.out(4463): waiting for debugger to
settle...
03-17 12:45:22.944: INFO/System.out(4463): waiting for debugger to
settle...
03-17 12:45:23.143: INFO/System.out(4463): waiting for debugger to
settle...
03-17 12:45:23.346: INFO/System.out(4463): waiting for debugger to
settle...
03-17 12:45:23.547: INFO/System.out(4463): waiting for debugger to
settle...
03-17 12:45:23.750: INFO/System.out(4463): waiting for debugger to
settle...
03-17 12:45:23.952: INFO/System.out(4463): waiting for debugger to
settle...
03-17 12:45:24.154: INFO/System.out(4463): waiting for debugger to
settle...
03-17 12:45:24.358: INFO/System.out(4463): waiting for debugger to
settle...
03-17 12:45:24.562: INFO/System.out(4463): debugger has settled (1397)
03-17 12:45:25.282: INFO/ActivityManager(58): Displayed activity
com.ipaulpro.calls/.Calls: 3534 ms
03-17 12:45:30.392: DEBUG/dalvikvm(4409): GC freed 3937 objects /
270656 bytes in 99ms
03-17 12:45:30.402: INFO/dalvikvm(4409): Uncaught exception thrown by
finalizer (will be discarded):
03-17 12:45:30.402: INFO/dalvikvm(4409): Ljava/lang/
IllegalStateException;: Finalizing cursor
android.database.sqlite.sqlitecur...@4302dd68 on assets10 that has not
been deactivated or closed
03-17 12:45:30.402: INFO/dalvikvm(4409):     at
android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:440)
03-17 12:45:30.412: INFO/dalvikvm(4409):     at
dalvik.system.NativeStart.run(Native Method)
03-17 12:45:35.422: DEBUG/dalvikvm(139): GC freed 23 objects / 776
bytes in 122ms


So the app starts, but displays an empty list (with borders).

Any helps, tips, links would be very appreciated. I have been all over
anddev.org and it appears most of the tutorials are outdated,
unattended, or totally disregarded. Now, I try Google :)

Thanks, in advance.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to