[android-beginners] Question

2009-07-18 Thread Jose Ayerdis
I was reading the NotepadV2 app the following code...

super.onListItemClick(l, v, position, id);
Cursor c = mNotesCursor;
c.moveToPosition(position);
Intent i = new Intent(this, NoteEdit.class);
i.putExtra(NotesDbAdapter.KEY_ROWID, id);

i.putExtra(NotesDbAdapter.KEY_TITLE, c.getString(
c.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE)));
i.putExtra(NotesDbAdapter.KEY_BODY, c.getString(
c.getColumnIndexOrThrow(NotesDbAdapter.KEY_BODY)));

startActivityForResult(i, ACTIVITY_EDIT);



And wonder how does the method set the correct id, i mean i never told it
who was the id, how does it know can somebody explainme???

-- 
Atte

[[Jose Luis Ayerdis Espinoza]]
http://blognecronet.blogspot.com

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



[android-beginners] Re: How to set the activity as Main ?

2009-07-18 Thread Nerj

Any One...

On Jul 15, 3:07 pm, Nerj  wrote:
> Thank you for ur reply,
> For your kindly information, I already mention that "action" tag for
> "SpinnerTest".
>
> Pls, suggest me
>
> On Jul 13, 1:30 pm, golem  wrote:
>
> > You should also move  > android:name="android.intent.action.MAIN" />
> > to the intent-filter of SpinnerTest.
>
> > Check out how intent-filters work at this 
> > websites:http://developer.android.com/guide/topics/fundamentals.html#ifiltersh...
>
> > On Jul 13, 6:11 am,Nerj wrote:
>
> > > Thanks for ur reply,
> > > I tried ur suggestion, even through I didn't able to launch the
> > > specified activity, see my code for manifest file (.xml) below,
>
> > > 
> > >          > >                   android:label="Spinner">
> > >             
> > >                 
> > >                   > > android:name="android.intent.category.DEFAULT" />
> > >                  > > android:name="android.intent.category.LAUNCHER" />
> > >             
> > >         
> > >           > >                   android:label="@string/app_name">
> > >             
> > >                 
> > >                   > > android:name="android.intent.category.SAMPLE_CODE"/>
> > >             
> > >         
> > >     
>
> > > I want to launch, SpinnerTest activity as the First.  But I saw the
> > > SampleDemo activity is my main one.
>
> > > Pls, suggest me...
>
> > > On Jul 11, 5:22 pm, Mark Murphy  wrote:
>
> > > >Nerjwrote:
> > > > > Pls, Suggest me
> > > > > Its urgent, I can't get the solution...
>
> > > > Only put the LAUNCHER intent filter in the  entries in your
> > > > manifest that you want to have appear as icons in the Launcher.
>
> > > > > On Jul 10, 4:10 pm,Nerj wrote:
> > > > >> Hi!
> > > > >> I am begginer of Android Development.
> > > > >> I can create an activity with different views, and can run them
> > > > >> successfully.
> > > > >> The problem is that,
> > > > >>          >>   If  I have several activities in the android project, 
> > > > >> it
> > > > >> takes only one to launch.
> > > > >> Can u pls, tell me how to set an activity as Main one which is to be
> > > > >> launch at first time when the app is open?
>
> > > > >> Pls, suggest me..
>
> > > > >> Thanks in advance...
>
> > > > --
> > > > Mark Murphy (a Commons 
> > > > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > > > Warescription: Three Android Books, Plus Updates, $35/Year
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to set the activity as Main ?

2009-07-18 Thread Mark Murphy

Nerj wrote:
> Any One...






Put that intent filter on the activity that goes in your launcher. For
the time being, remove all other intent filters from all other activities.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training in Germany, 18-22 January 2010: http://bignerdranch.com

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



[android-beginners] Timeout executing service - how to avoid this?

2009-07-18 Thread kaloer

Hi,

When I debug my application, it suddenly disconnects from the DalvikVM
without throwing an exception. Regarding this, the emulator shows an
ANR dialog. It happens some time after I have started a service to do
an operation, by a Broadcast receiver. The operation does take pretty
long time, because it is parsing a xml document. It does not stop
after a special point in my code. I know that a Broadcast receiver
needs to be executed fast, but when I start a service by the
context.startService(Intent) method it shouldn't wait for the
service's execution, should it?

I've attached the log (which do have a line with
"07-18 20:35:24.148: WARN/ActivityManager(583): Timeout executing
service: ServiceRecord{43818238
com.kaloersoftware.flickrwall/.FlickrWallService}"

Can it help if I do the xml parsing in a thread?


07-18 20:35:24.148: WARN/ActivityManager(583): Timeout executing
service: ServiceRecord{43818238
com.kaloersoftware.flickrwall/.FlickrWallService}
07-18 20:35:31.357: INFO/ActivityManager(583): ANR (application not
responding) in process: com.kaloersoftware.flickrwall
07-18 20:35:31.357: INFO/ActivityManager(583): Annotation: Executing
service ComponentInfo{com.kaloersoftware.flickrwall/
com.kaloersoftware.flickrwall.FlickrWallService}
07-18 20:35:31.357: INFO/ActivityManager(583): CPU usage:
07-18 20:35:31.357: INFO/ActivityManager(583): Load: 2.59 / 0.99 /
0.87
07-18 20:35:31.357: INFO/ActivityManager(583): CPU usage from 11984ms
to 214ms ago:
07-18 20:35:31.357: INFO/ActivityManager(583):   system_server: 117% =
82% user + 34% kernel
07-18 20:35:31.357: INFO/ActivityManager(583):
com.kaloersoftware.flickrwall: 39% = 39% user + 0% kernel
07-18 20:35:31.357: INFO/ActivityManager(583):   qemud: 7% = 0% user +
7% kernel
07-18 20:35:31.357: INFO/ActivityManager(583):   events/0: 2% = 0%
user + 2% kernel
07-18 20:35:31.357: INFO/ActivityManager(583): TOTAL: 100% = 82% user
+ 17% kernel
07-18 20:35:31.387: INFO/ActivityManager(583): Removing old ANR trace
file from /data/anr/traces.txt
07-18 20:35:31.407: INFO/Process(583): Sending signal. PID: 1786 SIG:
3
07-18 20:35:31.417: INFO/Process(583): Sending signal. PID: 1743 SIG:
3
07-18 20:35:31.447: INFO/Process(583): Sending signal. PID: 760 SIG: 3
07-18 20:35:31.447: INFO/dalvikvm(760): threadid=7: reacting to signal
3
07-18 20:35:31.507: INFO/Process(583): Sending signal. PID: 695 SIG: 3
07-18 20:35:31.507: INFO/dalvikvm(695): threadid=7: reacting to signal
3
07-18 20:35:31.527: INFO/Process(583): Sending signal. PID: 647 SIG: 3
07-18 20:35:31.527: INFO/dalvikvm(647): threadid=7: reacting to signal
3
07-18 20:35:31.537: INFO/Process(583): Sending signal. PID: 679 SIG: 3
07-18 20:35:31.537: INFO/dalvikvm(679): threadid=7: reacting to signal
3
07-18 20:35:31.547: INFO/Process(583): Sending signal. PID: 732 SIG: 3
07-18 20:35:31.547: INFO/dalvikvm(732): threadid=7: reacting to signal
3
07-18 20:35:31.547: INFO/Process(583): Sending signal. PID: 725 SIG: 3
07-18 20:35:31.547: INFO/dalvikvm(725): threadid=7: reacting to signal
3
07-18 20:35:31.567: INFO/Process(583): Sending signal. PID: 583 SIG: 3
07-18 20:35:31.567: INFO/dalvikvm(583): threadid=7: reacting to signal
3
07-18 20:35:31.567: INFO/dalvikvm(760): Wrote stack trace to '/data/
anr/traces.txt'
07-18 20:35:31.667: INFO/dalvikvm(695): Wrote stack trace to '/data/
anr/traces.txt'
07-18 20:35:31.727: DEBUG/Zygote(553): Process 1786 terminated by
signal (3)
07-18 20:35:31.757: DEBUG/Zygote(553): Process 1743 terminated by
signal (3)
07-18 20:35:31.787: INFO/dalvikvm(725): Wrote stack trace to '/data/
anr/traces.txt'
07-18 20:35:31.797: INFO/dalvikvm(647): Wrote stack trace to '/data/
anr/traces.txt'
07-18 20:35:31.817: INFO/dalvikvm(679): Wrote stack trace to '/data/
anr/traces.txt'
07-18 20:35:31.827: INFO/dalvikvm(732): Wrote stack trace to '/data/
anr/traces.txt'
07-18 20:35:31.827: INFO/dalvikvm(583): Wrote stack trace to '/data/
anr/traces.txt'
07-18 20:35:31.847: DEBUG/dalvikvm(583): GREF has decreased to 199
07-18 20:35:31.857: INFO/WindowManager(583): WIN DEATH: Window
{43746898 com.android.launcher/com.android.launcher.Launcher
paused=false}
07-18 20:35:31.918: INFO/Process(583): Sending signal. PID: 662 SIG: 3
07-18 20:35:31.927: INFO/dalvikvm(662): threadid=7: reacting to signal
3
07-18 20:35:31.937: INFO/dalvikvm(662): Wrote stack trace to '/data/
anr/traces.txt'
07-18 20:35:31.937: INFO/Process(583): Sending signal. PID: 622 SIG: 3
07-18 20:35:31.947: INFO/dalvikvm(622): threadid=7: reacting to signal
3
07-18 20:35:31.957: INFO/ActivityManager(583): Process
com.kaloersoftware.flickrwall (pid 1786) has died.
07-18 20:35:31.957: WARN/ActivityManager(583): Scheduling restart of
crashed service com.kaloersoftware.flickrwall/.FlickrWallService in
5000ms
07-18 20:35:31.967: INFO/dalvikvm(622): Wrote stack trace to '/data/
anr/traces.txt'
07-18 20:35:31.977: INFO/ActivityManager(583): Process
android.process.acore (pid 1743) has died.
07-18 20:35:32.107: INFO/ActivityManager(583): Start proc
and

[android-beginners] Re: Timeout executing service - how to avoid this?

2009-07-18 Thread Mark Murphy

kaloer wrote:
> When I debug my application, it suddenly disconnects from the DalvikVM
> without throwing an exception. Regarding this, the emulator shows an
> ANR dialog. It happens some time after I have started a service to do
> an operation, by a Broadcast receiver. The operation does take pretty
> long time, because it is parsing a xml document. It does not stop
> after a special point in my code. I know that a Broadcast receiver
> needs to be executed fast, but when I start a service by the
> context.startService(Intent) method it shouldn't wait for the
> service's execution, should it?

All callbacks from Android need to be done quickly. This includes
starting services. Only work done on threads of your own creation can
take longer.

> I've attached the log (which do have a line with
> "07-18 20:35:24.148: WARN/ActivityManager(583): Timeout executing
> service: ServiceRecord{43818238
> com.kaloersoftware.flickrwall/.FlickrWallService}"

Something in your service (onCreate() or onStart(), most likely) is
taking too long.

> Can it help if I do the xml parsing in a thread?

Yes. Use AsyncTask or something to move the XML parsing off the thread
used for the callback.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Need Android talent? Ask on HADO! http://wiki.andmob.org/hado

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



[android-beginners] Re: Timeout executing service - how to avoid this?

2009-07-18 Thread kaloer

Thank you very much. I put the xml parsing into an AsyncTask, and it
works perfectly.

//Kaloer

On 18 Jul., 22:54, Mark Murphy  wrote:
> kaloer wrote:
> > When I debug my application, it suddenly disconnects from the DalvikVM
> > without throwing an exception. Regarding this, the emulator shows an
> > ANR dialog. It happens some time after I have started a service to do
> > an operation, by a Broadcast receiver. The operation does take pretty
> > long time, because it is parsing a xml document. It does not stop
> > after a special point in my code. I know that a Broadcast receiver
> > needs to be executed fast, but when I start a service by the
> > context.startService(Intent) method it shouldn't wait for the
> > service's execution, should it?
>
> All callbacks from Android need to be done quickly. This includes
> starting services. Only work done on threads of your own creation can
> take longer.
>
> > I've attached the log (which do have a line with
> > "07-18 20:35:24.148: WARN/ActivityManager(583): Timeout executing
> > service: ServiceRecord{43818238
> > com.kaloersoftware.flickrwall/.FlickrWallService}"
>
> Something in your service (onCreate() or onStart(), most likely) is
> taking too long.
>
> > Can it help if I do the xml parsing in a thread?
>
> Yes. Use AsyncTask or something to move the XML parsing off the thread
> used for the callback.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Need Android talent? Ask on HADO!http://wiki.andmob.org/hado
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Rooting?

2009-07-18 Thread stephen rigg
How big of a risk am I taking???
Is this reversable??

On Jul 17, 2009 1:42 AM, "Roman"  wrote:


Hi,

Here is a pretty good description of how to root your G1 phone.

http://androidandme.com/2009/05/guides/beginners-guide-for-rooting-your-android-g1-to-install-cupcake/


Of course there is always a risk that during rooting something goes
wrong. Make sure that you charge your battery before you start the
process. You don't won't that during flashing and rooting your device
that the device turns of.

Also follow exactly the steps in the same order.

Good luck!

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.

On Jul 16, 4:16 pm, stephen rigg  wrote: > Haven't
researched it : ( > Jus hav...

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