Re: [android-beginners] Re: onDestroy() caused "application stopped unexpectedly"

2010-01-07 Thread Justin Anderson
Any particular reason you are using System.exit() as opposed to finish()???

finish() gives Android the opportunity to do any cleanup that it needs to
when your app gets done... I would imaging that System.exit() bypasses this.

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Thu, Jan 7, 2010 at 11:27 PM, ZhouSu  wrote:

> Thanks Justin and TreKing!
> I haven't found the error for onDestroy after looking at the log
> but I've managed to close the application using JAVA System.exit()
> instead.
> It does stop retrieving GPS signals after I exit the app.
>
>
>
> On Jan 7, 2:20 am, TreKing  wrote:
> > > BTW, if i change onDestroy() to finish(), the application works fine so
> > > other parts should have no problem. How can I end the application
> lifecycle
> > > successfully?
> >
> > Um ... call finish() instead of onDestroy?
> >
> > Look at the logs like Justin said. My guess: you're not supposed to call
> > onDestroy() and the system is throwing an exception because you've done
> so
> > (I believe I've seen it also throw if you don't call super.onDestroy() in
> > your overwritten method ... so *it knows* .
> >
> >
> ---
> --
> > TreKing - Chicago transit tracking app for Android-powered deviceshttp://
> sites.google.com/site/rezmobileapps/treking
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> 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
>
>
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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: onDestroy() caused "application stopped unexpectedly"

2010-01-07 Thread ZhouSu
Thanks Justin and TreKing!
I haven't found the error for onDestroy after looking at the log
but I've managed to close the application using JAVA System.exit()
instead.
It does stop retrieving GPS signals after I exit the app.



On Jan 7, 2:20 am, TreKing  wrote:
> > BTW, if i change onDestroy() to finish(), the application works fine so
> > other parts should have no problem. How can I end the application lifecycle
> > successfully?
>
> Um ... call finish() instead of onDestroy?
>
> Look at the logs like Justin said. My guess: you're not supposed to call
> onDestroy() and the system is throwing an exception because you've done so
> (I believe I've seen it also throw if you don't call super.onDestroy() in
> your overwritten method ... so *it knows* .
>
> --- 
> --
> TreKing - Chicago transit tracking app for Android-powered 
> deviceshttp://sites.google.com/site/rezmobileapps/treking
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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


Re: [android-beginners] Re: Alphabetical Method Index for Android SDK

2010-01-07 Thread Caius 'kaio' Chance

(2010年01月06日 02:31), BeWillDir wrote:

An alphabetical list of methods!  What an interesting concept!  What
ever made you think that anyone would find this useful? (-;

On Dec 1 2009, 9:35 pm, jdeisenberg
wrote:
   

The Java SDK documentation contains an alphabetical list of methods,
constructors, and constants. I haven't found anything comparable for
the Android SDK, so I wrote a program to construct one.  Full details
are athttp://langintro.com/android_sdk/If you don't find it useful,
you may find it to be mildly amusing.
 

A crtl-F to search should do for me. ;)

--
Caius 'kaio' Chance ☺ かいお
  Fedora Project Contributor http://fedoraproject.org/wiki/User:kaio
  kaio at fedoraproject.org, kaio on irc.freenode.net, GPG: 17BEFCFA

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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: Problem with Custom Dialog

2010-01-07 Thread mapper
Hi Treking,
I have tried as you have suggested but not able to get the value.
May be i missing something.
Here is my code:


public class GetDialog extends Activity
{


public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Button valueButton = (Button) findViewById(R.id.viewButton);
valueButton.setOnClickListener(new OnClickListener() {
   public void onClick(View v) {
showDialog(0);
   }
 });

}

protected Dialog onCreateDialog(int id) {

LayoutInflater factory = LayoutInflater.from(this);
final View textEntryView = factory.inflate
(R.layout.viewlayout, null);

return new AlertDialog.Builder(this)
.setIcon(R.drawable.view)
.setTitle("Enter Value")
.setView(textEntryView)
.setPositiveButton("OK", new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int
whichButton) {
EditText valueText = (EditText) findViewById
(R.id.viewText);
getvalue(valueText );
}
})
.setNegativeButton("Cancel", new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int
whichButton) {

}
})
.create();

}

void getvalue(EditText val)
{
   try{
String value= val.getText().toString();
Log.i("Value ",value);
  }catch(Exception e){
   Log.i("Error", e.toString() );
   }
}

}

It gives me error as: Java.lang.NullPointerException

please suggest.

Thanks



On Jan 5, 11:45 pm, TreKing  wrote:
> Another (simpler) option:
> - Add a click listener to you dialog
> - When it fires, get the EditText from the dialog (it's passed in as a
> parameter to the listener)
> - Get the text from the EditText object and pass it to the TextView (which I
> assume you have / can get a reference to) since it's in the same actitivty
> - Profit
>
> -
> TreKing - Chicago transit tracking app for Android-powered 
> deviceshttp://sites.google.com/site/rezmobileapps/treking
>
> On Tue, Jan 5, 2010 at 1:10 AM, Lenea  wrote:
> > I've got it done. I just created a new class and set the Theme to
> > @android:style/Theme.Dialog, then i created an intent and called
> > startActivityForResult() and
> > passed the parameters through Bundle. hope this helps others with the
> > same problem as me
>
> > Cheers,
> > Lenea
>
> > On Jan 5, 8:48 am, Kevin Duffey  wrote:
> > > If the dialog you open is to return a value, I forget the call.. still
> > > learning myself.. I think it's like onWaitForDialog or something. You can
> > > have it return a response to the activity that displayed it, which would
> > > probably be the same activity you want to update the textview with. Just
> > > update the textview, possibly in a thread to update the UI with the
> > > response.
>
> > > On Mon, Jan 4, 2010 at 10:29 PM, Justin Anderson <
> > janderson@gmail.com>wrote:
>
> > > > There are several methods available for dealing with dialogs within an
> > > > activity...  Have a look at onCreateDialog(), onPrepareDialog(),
> > > > showDialog(), and removeDialog():
>
> > > >http://developer.android.com/reference/android/app/Activity.html#onCr.
> > ..
>
> > > > Thanks,
> > > > Justin
>
> > > > --
> > > > There are only 10 types of people in the world...
> > > > Those who know binary and those who don't.
> > > > --
>
> > > > On Sat, Jan 2, 2010 at 6:55 AM, Lenea  wrote:
>
> > > >> Hello, everyone.
> > > >> I've got an application in which a button triggers a custom dialog.
> > > >> In the custom dialog i have an EditText.
> > > >> I want to collect data from the EditText and set the text of a
> > > >> TextView to that data.
> > > >> The problem is, the TextView is located in my main Activity(the one
> > > >> which triggered the custom dialog)
> > > >> How do I do that?
>
> > > >> Cheers,
> > > >> Lenea
>
> > > >> --
> > > >> You received this message because you are subscribed to the Google
> > > >> Groups "Android Beginners" group.
>
> > > >> NEW! Try asking and tagging your question on Stack Overflow at
> > > >>http://stackoverflow.com/questions/tagged/android
>
> > > >> 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
>
> > > >  --
> > > > You received this message because you a

Re: [android-beginners] Re: Giving selection priority in XML Layout

2010-01-07 Thread Caius 'kaio' Chance

(2010年01月05日 06:34), Roman Romano wrote:

Many thanks for your help. I think it was an error on my part :-)

i needed to:

btn_Contact.setFocusableInTouchMode(true);

once that was set, the btn_Contact.requestFocus(); worked fine

Very interesting that it was not true by default.

--
Caius 'kaio' Chance ☺ かいお
  Fedora Project Contributor http://fedoraproject.org/wiki/User:kaio
  kaio at fedoraproject.org, kaio on irc.freenode.net, GPG: 17BEFCFA

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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


Re: [android-beginners] all in one poste for site visite all sites here''

2010-01-07 Thread Caius 'kaio' Chance

(2010年01月04日 01:15), bakiyaraj p wrote:

http://basicsofdnafingerprinting.blogspot.com/
http://dnafingerprintingandforensics-baki.blogspot.com/
http://plasmid-fingerprinting.blogspot.com/ 
http://dna-fingerprinting001.blogspot.com/
http://amplifiedfragment-length-polymorphis.blogspot.com/
http://whatisdnafingerprinting.blogspot.com/
http://amplifiedfragment-length-polymorphis.blogspot.com/
http://dna-profiling.blogspot.com/  
http://hivaids-in-india.blogspot.com/
http://india-hiv-caseload.blogspot.com/ 
http://hivaids-in-asia.blogspot.com/
http://the-mobilestore.blogspot.com/
http://app-store123.blogspot.com/
http://baki-standard-chartered-bank.blogspot.com/
http://structural-engineering123.blogspot.com/
http://chiefministersinsuranceschemeforbaki.blogspot.com/http://baki-nokia6600.blogspot.com/
http://baki-annamalai-university.blogspot.com/  
http://visa-requirements-baki.blogspot.com/
http://userwisewhipbharatmatrimony.blogspot.com/
http://health-tips57.blogspot.com/
http://baki-dna123.blogspot.com/
http://al-service.blogspot.com/
http://cancer-information107.blogspot.com/  
http://dna-money.blogspot.com/?zx=c0e2aa080cbac622
http://dnareplication123.blogspot.com/  
http://types-ofcancer.blogspot.com/
http://baki-hdfcbank.blogspot.com/  
http://dna-fingerprinting001.blogspot.com/
http://experimenttakes-us-backto.blogspot.com/  
http://baki-reliance.blogspot.com/
http://rob-zombie143.blogspot.com/  
http://baki-mostbeautifulhollywoodactress.blogspot.com/
http://keggpathway.blogspot.com/
http://white-blood-cell.blogspot.com/
http://computer-softwares001.blogspot.com/

   

spam

--
Caius 'kaio' Chance ☺ かいお
  Fedora Project Contributor http://fedoraproject.org/wiki/User:kaio
  kaio at fedoraproject.org, kaio on irc.freenode.net, GPG: 17BEFCFA

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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


Re: [android-beginners] Re: Help with scrollbar in resized LinearLayout

2010-01-07 Thread Caius 'kaio' Chance

(2010年01月05日 02:05), Stephen B wrote:

Replying to this so that when the next guy searches for this problem,
the answer is to hand.

I've solved the behavioral problem by wrapping the LinearLayout in a
ScrollView, and the docs for ScrollView say that's what it's for.

I'm surprised, then, that something (android? LinearLayout?) is
*sometimes* constructing a ScrollView implicitly.

   

Great Job!

--
Caius 'kaio' Chance ☺ かいお
  Fedora Project Contributor http://fedoraproject.org/wiki/User:kaio
  kaio at fedoraproject.org, kaio on irc.freenode.net, GPG: 17BEFCFA

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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: Reminder IRC office hours today 5:00- 6:00 PST

2010-01-07 Thread Megha Joshi
Answers to 12/17 office hours have been posted:
http://moderator.appspot.com/#15/e=120951&t=121ce5

2010/1/7 Megha Joshi 

>
> Office hours Thursday Jan 7th 5:00 - 6:00 PST, post questions @
> http://moderator.appspot.com/#15/e=120951&t=126bf1
>
> Thanks,
> Megha
>
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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] Reminder IRC office hours today 5:00- 6:00 PST

2010-01-07 Thread Megha Joshi
Office hours Thursday Jan 7th 5:00 - 6:00 PST, post questions @
http://moderator.appspot.com/#15/e=120951&t=126bf1

Thanks,
Megha
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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


Re: [android-beginners] Re: Databases in Android

2010-01-07 Thread Kevin Duffey
I've only read a little bit about the DB.. is it possible to create/store on
on the SD card? If we're limited to 24MB ram, 16MB on older devices, does
that restrict the amount of data a DB can store as well? Seems it should be
possible to put the DB on the SD card.

On Wed, Jan 6, 2010 at 11:56 PM, Nithin  wrote:

>
> > Firstly, is it possible to implement composite keys?
>
> Yes, its possible.
>
> Can do something like this,
>
> CREATE *TABLE* example1(
>  field1 text not null,
>  field2 text not null,
>  *PRIMARY* *KEY*(field1, field2)
>   );
>
>
> > And secondly, how can I load a pre-created database onto an Android
> > device efficiently?
>
> Database will be loaded, when you load the apk into the deveice. All
> the resource, that application has (like files, database etc.) will be
> bundled in the .apk file. And moreover, Database is private to the
> application in Android.
>
> Nithin
>
>
>
> On Jan 4, 7:44 pm, verb  wrote:
> > I'm currently doing a project which requires a potentially large
> > underlying relational database, and have a couple of queries on how to
> > implement this in Android.
> >
> > Firstly, is it possible to implement composite keys? I have seen
> > methods which suggest that all primary keys in a database must be
> > called '_id' for Android to recognise them, but cannot find anything
> > on if there is more than one key in a table.
> >
> > And secondly, how can I load a pre-created database onto an Android
> > device efficiently? It will only need to be added once on
> > installation, but potentially be updated or have individual entries
> > added by the user.
> >
> > I am currently implementing in API Level 4 (Android 1.6).
> >
> > Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> 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
>
>
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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


Re: [android-beginners] how to turn gps on/off programatically

2010-01-07 Thread Caius 'kaio' Chance

(2010年01月08日 01:59), Sean Hodges wrote:

On Thu, Jan 7, 2010 at 3:42 PM, Yousuf Faheem  wrote:



How is it different? Are you looking for some callback to tell you
whether the GPS is currently in use?


Save battery.

--
Caius 'kaio' Chance ☺ かいお
  Fedora Project Contributor http://fedoraproject.org/wiki/User:kaio
  kaio at fedoraproject.org, kaio on irc.freenode.net, GPG: 17BEFCFA
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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


Re: [android-beginners] how to turn gps on/off programatically

2010-01-07 Thread Yousuf Faheem
Hi,

Thanks, I was trying to do it programatically. But as you said the GPS is
turn on/off automatically I dont have to switch it on/off. Now I will need
to check whether GPS is on/off. will the Location manager be helpful for
this or do I need to access a different set of apis.

Thanks & Regards,
Yousuf Syed




On Thu, Jan 7, 2010 at 10:59 AM, Sean Hodges wrote:

> On Thu, Jan 7, 2010 at 3:42 PM, Yousuf Faheem 
> wrote:
> > Hi,
> >
> > I am writting a code which has to turn gps on when its needed and turn
> gps
> > off when its not needed. This is different from enabling or disabling the
> > gps. Is there any api that is used for this purpose.
> >
>
> How is it different? Are you looking for some callback to tell you
> whether the GPS is currently in use?
>
> When the GPS is not needed, the last known location data is stored
> away, and it is automatically turned off. You'll notice the little
> satellite icon disappears from your tray when this happens.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> 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
>
>
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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


Re: [android-beginners] Re: launch an activity right into the background

2010-01-07 Thread Justin Anderson
Complicated layouts definitely have a huge impact on speed...  Perhaps some
of the pointers on these pages could help:

http://developer.android.com/resources/articles/layout-tricks-reuse.html
http://developer.android.com/resources/articles/layout-tricks-efficiency.html
http://developer.android.com/resources/articles/layout-tricks-stubs.html
http://developer.android.com/resources/articles/layout-tricks-merge.html

Thanks,
Justin

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Thu, Jan 7, 2010 at 9:32 AM, bsd_mike  wrote:

> Thanks, you are of curse correct...I was being lazy.
>
> I did try the postDelay and that helped a bit but not as much as I
> need.
>
> My layout is really super complicated too..is it possible some of the
> time is stuck unwinding that?
>
> Is it possible to load a different, less complicated layout then
> overlay it with the final one...
> Without the layout sliding away and the new one sliding in?
>
> Thank you.
>
> -Mike
>
> On Jan 7, 10:14 am, Sean Hodges  wrote:
> > I assume this carries on from your earlier question about delaying
> > tasks in an onCreate()?
> >
> > It is technically possible to move your intensive code into a
> > "Service" and have it start when the phone boots up, but bear in mind
> > that this is an unpopular method, as users will find their phones
> > become sluggish whilst your app does all it's processing work in the
> > background.
> >
> > My recommendation is to try and optimise your app a bit better.
> > Otherwise you will get low ratings on the market and lots of refunds
> > (if you plan to sell it). Some suggestions:
> >
> > - Take a look at some of the suggestions on your previous thread
> > - Use a progress dialog when slow loading operations are occurring (it
> > makes a BIG difference when the user can see that something is busy)
> > - Delay some of your processing until the user does something (like
> > clicking on a tab)
> > - Cache some of your processed data, either in a database or a file,
> > so you don't have as much to do the next time the app is loaded
> >
> > There are plenty of other things you can do, some thought and research
> > should . Really, launching stuff in the background should be avoided
> > as much as possible, mobile devices have very limited resources and
> > your app will have a negative impact on the phone's responsiveness.
> >
> >
> >
> > On Thu, Jan 7, 2010 at 3:48 PM, Michael Dorin 
> wrote:
> > > Can I launch an activity and have it go strait into the background
> without
> > > the user seeing it, until they select to launch it themselves?
> >
> > > Basically I have an application that takes a long time to start the
> first time,
> > > but is super snappy after that.
> >
> > > -Mike
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Beginners" group.
> >
> > > NEW! Try asking and tagging your question on Stack Overflow at
> > >http://stackoverflow.com/questions/tagged/android
> >
> > > 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
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> 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
>
>
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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: launch an activity right into the background

2010-01-07 Thread bsd_mike
Thanks, you are of curse correct...I was being lazy.

I did try the postDelay and that helped a bit but not as much as I
need.

My layout is really super complicated too..is it possible some of the
time is stuck unwinding that?

Is it possible to load a different, less complicated layout then
overlay it with the final one...
Without the layout sliding away and the new one sliding in?

Thank you.

-Mike

On Jan 7, 10:14 am, Sean Hodges  wrote:
> I assume this carries on from your earlier question about delaying
> tasks in an onCreate()?
>
> It is technically possible to move your intensive code into a
> "Service" and have it start when the phone boots up, but bear in mind
> that this is an unpopular method, as users will find their phones
> become sluggish whilst your app does all it's processing work in the
> background.
>
> My recommendation is to try and optimise your app a bit better.
> Otherwise you will get low ratings on the market and lots of refunds
> (if you plan to sell it). Some suggestions:
>
> - Take a look at some of the suggestions on your previous thread
> - Use a progress dialog when slow loading operations are occurring (it
> makes a BIG difference when the user can see that something is busy)
> - Delay some of your processing until the user does something (like
> clicking on a tab)
> - Cache some of your processed data, either in a database or a file,
> so you don't have as much to do the next time the app is loaded
>
> There are plenty of other things you can do, some thought and research
> should . Really, launching stuff in the background should be avoided
> as much as possible, mobile devices have very limited resources and
> your app will have a negative impact on the phone's responsiveness.
>
>
>
> On Thu, Jan 7, 2010 at 3:48 PM, Michael Dorin  wrote:
> > Can I launch an activity and have it go strait into the background without
> > the user seeing it, until they select to launch it themselves?
>
> > Basically I have an application that takes a long time to start the first 
> > time,
> > but is super snappy after that.
>
> > -Mike
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Beginners" group.
>
> > NEW! Try asking and tagging your question on Stack Overflow at
> >http://stackoverflow.com/questions/tagged/android
>
> > 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
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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


Re: [android-beginners] launch an activity right into the background

2010-01-07 Thread Sean Hodges
I assume this carries on from your earlier question about delaying
tasks in an onCreate()?

It is technically possible to move your intensive code into a
"Service" and have it start when the phone boots up, but bear in mind
that this is an unpopular method, as users will find their phones
become sluggish whilst your app does all it's processing work in the
background.

My recommendation is to try and optimise your app a bit better.
Otherwise you will get low ratings on the market and lots of refunds
(if you plan to sell it). Some suggestions:

- Take a look at some of the suggestions on your previous thread
- Use a progress dialog when slow loading operations are occurring (it
makes a BIG difference when the user can see that something is busy)
- Delay some of your processing until the user does something (like
clicking on a tab)
- Cache some of your processed data, either in a database or a file,
so you don't have as much to do the next time the app is loaded

There are plenty of other things you can do, some thought and research
should . Really, launching stuff in the background should be avoided
as much as possible, mobile devices have very limited resources and
your app will have a negative impact on the phone's responsiveness.

On Thu, Jan 7, 2010 at 3:48 PM, Michael Dorin  wrote:
> Can I launch an activity and have it go strait into the background without
> the user seeing it, until they select to launch it themselves?
>
> Basically I have an application that takes a long time to start the first 
> time,
> but is super snappy after that.
>
> -Mike
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> 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
>
>
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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


Re: [android-beginners] how to turn gps on/off programatically

2010-01-07 Thread Sean Hodges
On Thu, Jan 7, 2010 at 3:42 PM, Yousuf Faheem  wrote:
> Hi,
>
> I am writting a code which has to turn gps on when its needed and turn gps
> off when its not needed. This is different from enabling or disabling the
> gps. Is there any api that is used for this purpose.
>

How is it different? Are you looking for some callback to tell you
whether the GPS is currently in use?

When the GPS is not needed, the last known location data is stored
away, and it is automatically turned off. You'll notice the little
satellite icon disappears from your tray when this happens.
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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


Re: [android-beginners] how to turn gps on/off programatically

2010-01-07 Thread Justin Anderson
How is this different from disabling and enabling GPS?

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Thu, Jan 7, 2010 at 8:42 AM, Yousuf Faheem wrote:

> Hi,
>
> I am writting a code which has to turn gps on when its needed and turn gps
> off when its not needed. This is different from enabling or disabling the
> gps. Is there any api that is used for this purpose.
>
>
> Thanks & Regards,
> Yousuf.
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> 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
>
>
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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] launch an activity right into the background

2010-01-07 Thread Michael Dorin
Can I launch an activity and have it go strait into the background without
the user seeing it, until they select to launch it themselves?

Basically I have an application that takes a long time to start the first time,
but is super snappy after that.

-Mike
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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] how to turn gps on/off programatically

2010-01-07 Thread Yousuf Faheem
Hi,

I am writting a code which has to turn gps on when its needed and turn gps
off when its not needed. This is different from enabling or disabling the
gps. Is there any api that is used for this purpose.


Thanks & Regards,
Yousuf.
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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: problem with adb

2010-01-07 Thread Rc3375
1. Windows7
2. Eclipse & android were installed in C;\dirname of software pkg.
3. Got it to fire up, but the emulator does not pick up the pkg I'm
trying to debug.
And if you just right click on that pkg and say run/debug, that's when
that error comes up.  But if you go 2 preferences and click on the
android portion. That's where u see android versions then u can select
one/or create a new one(those do work, but the pkg fails to show up on
the emulator).  This is a copy of my other laptop, and all works fine
on that one.  Plus, it isn't finding some of the software that is on
the system that is in the path.

On Jan 6, 9:08 am, Indicator Veritatis  wrote:
> A number of questions come to mind:
>
> 1) what operating system are you on?
> 2) how did you do the install of Eclipse?
> 3) how did you install the Android Plugin?
> 4) how did you install the Android SDK?
>
> On Jan 5, 5:00 pm, Rc3375  wrote:
>
>
> > Had to do a reinstall of Eclipse.  All software is where it needs to
> > be, but when you fire up Eclipse, this error keeps coming up; failed
> > to parse the output of 'adb version.   Try and restart adb and restart
> > eclipse.'
> > Done all that a million timesbut still won't work.  Any ideas on
> > this problemthanks for the help...Rc3375
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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 can I make a vew show up really, really fast?

2010-01-07 Thread redders6...@googlemail.com
Are there any good documents giving an overview of all these different
methods. Doesn't have to specifically be android, of course.

On Jan 7, 10:50 am, skink  wrote:
> On Jan 7, 10:26 am, Sean Hodges  wrote:
>
>
>
> > The method really depends on your requirements:
>
> > * If the amount of work isn't too great, and you just want the
> > activity to be drawn before the processing starts, then postDelayed()
> > is a sensible approach.
>
> > * If you have a lot of processing to do, and the execution needs to be
> > linear (e.g. (a) must finish before (b) which must finish before (c))
> > , then an ASyncTask or Runnable would allow that to happen without
> > interfering with the activity event loop.
>
> > * If you have a lot of processing to do, but want to split it up into
> > lots of asynchronous background tasks (and execution order is less of
> > an issue), then using a message queue would be more manageable.
>
> > If you're unsure which one you will need, then a postDelayed() is a
> > simple approach to start off with. You could extract intensive work
> > into background threads later on.
>
> imho message queue is better solution than postDelayed() since with
> the latter you have to pass delayms: 200 could be ok, but maybe 100
> would be better, or maybe 50 or 20? it all depends on how complex your
> view is and how fast/busy your device is
>
> pskink
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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] open all blocked sites in your country now

2010-01-07 Thread alagmy
open all blocked sites in your country now


Browse the internet securely using Your Proxy

 You can unblock popular social networking sites such as myspace,
bebo, facebook and many other sites.

يمكنك الآن فتح المواقع المحجوبه فى بلدك من هذا الرابط

http://alagmyproxy.zxq.net/proxy/index.php

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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 can I make a vew show up really, really fast?

2010-01-07 Thread skink


On Jan 7, 10:26 am, Sean Hodges  wrote:
> The method really depends on your requirements:
>
> * If the amount of work isn't too great, and you just want the
> activity to be drawn before the processing starts, then postDelayed()
> is a sensible approach.
>
> * If you have a lot of processing to do, and the execution needs to be
> linear (e.g. (a) must finish before (b) which must finish before (c))
> , then an ASyncTask or Runnable would allow that to happen without
> interfering with the activity event loop.
>
> * If you have a lot of processing to do, but want to split it up into
> lots of asynchronous background tasks (and execution order is less of
> an issue), then using a message queue would be more manageable.
>
> If you're unsure which one you will need, then a postDelayed() is a
> simple approach to start off with. You could extract intensive work
> into background threads later on.
>
>

imho message queue is better solution than postDelayed() since with
the latter you have to pass delayms: 200 could be ok, but maybe 100
would be better, or maybe 50 or 20? it all depends on how complex your
view is and how fast/busy your device is

pskink
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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


Re: [android-beginners] Re: how to structure my app to run in background

2010-01-07 Thread Sean Hodges
You can create a ContentProvider for this:

http://developer.android.com/intl/fr/guide/topics/providers/content-providers.html

A tutorial can be found here:

http://www.devx.com/wireless/Article/41133

It will provide a interface to your database, that can be shared
between applications.


On Tue, Jan 5, 2010 at 2:57 PM, pentium10  wrote:
> So I need a service and an activity.
>
> How are you handling the database across two different app (i mean
> shared) ?
> how can I create a single database class and use that for db
> interactions all over my apps/services ?
>
> On Jan 5, 4:50 pm, Justin Anderson  wrote:
>> AFAIK, it is not possible to undermine the Android OS and prevent your
>> program from being closed down if memory gets low.
>>
>> However, to run in the background you would want to take a look at
>> Services.  To launch an activity from a service you would use the
>> startActivity() method.  As for being notified when certain things occur,
>> you would want to take a look at BroadcastReceiver class.
>>
>> Hope that helps you get started in the right direction.  A word to the wise
>> though, provide an option to turn off the background stuff... users get
>> really upset if they can't control stuff like whether an app runs in the
>> background.
>>
>> I have an app, called AppSwipe, that will tell you which programs are
>> running in the background and will let you close them.  I routinely check it
>> and close apps that I don't want running and wasting my battery life.  And
>> if an app gets too annoying with restarting itself after I close it, I
>> uninstall it no matter how useful or cool it is.
>>
>> Thanks,
>> Justin
>> MagouyaWare
>>
>> --
>> There are only 10 types of people in the world...
>> Those who know binary and those who don't.
>> --
>>
>>
>>
>> On Tue, Jan 5, 2010 at 2:50 AM, pentium10  wrote:
>> > Hello,
>>
>> > I am new to Android, and I need some advices for start up.
>> > I want to build an application, which will show up, when the user gets
>> > into some hot situation.
>> > By hot situation I mean:
>> > * his GPS/cell coordinates are in known zone;
>> > * known Bluetooth device detected;
>> > * known Wi-Fi network detected;
>> > * weather info has change;
>>
>> > I see something running in background and when one of the clauses hit,
>> > it will trigger and open the app.
>> > * How to get started?
>> > * How do I make sure my app won't be shut down?
>> > As I read somewhere that Android OS will terminate apps if memory out
>> > occurs or consumes too much, and my app would consume a lot, making
>> > repeated measures/checks to see if situation changed.
>>
>> > Regards,
>> > Pentium10
>>
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Android Beginners" group.
>>
>> > NEW! Try asking and tagging your question on Stack Overflow at
>> >http://stackoverflow.com/questions/tagged/android
>>
>> > To unsubscribe from this group, send email to
>> > android-beginners+unsubscr...@googlegroups.com> >  i...@googlegroups.com>
>> > For more options, visit this group at
>> >http://groups.google.com/group/android-beginners?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> 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
>
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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


Re: [android-beginners] Re: How can I make a vew show up really, really fast?

2010-01-07 Thread Sean Hodges
The method really depends on your requirements:

* If the amount of work isn't too great, and you just want the
activity to be drawn before the processing starts, then postDelayed()
is a sensible approach.

* If you have a lot of processing to do, and the execution needs to be
linear (e.g. (a) must finish before (b) which must finish before (c))
, then an ASyncTask or Runnable would allow that to happen without
interfering with the activity event loop.

* If you have a lot of processing to do, but want to split it up into
lots of asynchronous background tasks (and execution order is less of
an issue), then using a message queue would be more manageable.

If you're unsure which one you will need, then a postDelayed() is a
simple approach to start off with. You could extract intensive work
into background threads later on.


On Thu, Jan 7, 2010 at 5:53 AM, Kevin Duffey  wrote:
> Couldn't you spawn a thread to do the work, then put a Runnable on the UI
> thread to do the actual updating of the UI?
>
> On Wed, Jan 6, 2010 at 9:08 AM, skink  wrote:
>>
>>
>> On Jan 6, 1:52 pm, "Mark Murphy"  wrote:
>> > > I do a setContentView(R.layout.main);  in my onCreate, but have a ton
>> > > of other things to do before the onCreate
>> > > finishes...and it take a lot of time for anything to show up on the
>> > > display.
>> > > Is there an easy way just to have the layout at least pop up then get
>> > > filled so I don't have the delay?
>> >
>> > Delay the extra work you have in onCreate() to a later point. For
>> > example,
>> > use Handler#postDelayed() to have that work be done after 200ms, to
>> > allow
>> > Android to draw your layout.
>> >
>> > --
>> > Mark Murphy (a Commons Guy)http://commonsware.com
>> > Android App Developer Books:http://commonsware.com/books.html
>>
>> hi,
>>
>> i'd use
>>
>> http://developer.android.com/intl/fr/reference/android/os/MessageQueue.html#addIdleHandler(android.os.MessageQueue.IdleHandler)
>>
>> pskink
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Beginners" group.
>>
>> NEW! Try asking and tagging your question on Stack Overflow at
>> http://stackoverflow.com/questions/tagged/android
>>
>> 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
>>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> 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
>
>
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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] Need Help : canvas.drawtext() for a lengthy string

2010-01-07 Thread Latha Shivanna
Hi All

I am stuck in a very simple problem.

I have one lengthy string & I need to draw that on the device display.

My code is as follows:

void ShowText(String text) {
 canv = thread.mSurfaceHolder.lockCanvas(); 

if (text!= null) {

canv.drawColor(Color.WHITE); //background color
mPaint.setColor(Color.BLACK); //font color
mPaint.setTextSize(15); //font size 

canv.drawText(text, 10, 200, mPaint);   
//startign at some
(10,200) coordinates , dratext
}

 unlockCanvasAndPost(canv);
}

But the problem here is, the string is going out of the screen. I want
it to break down into multiple lines if it is too big for the screen
width.

Can anybody show me some example to do this?

Thanks
Latha
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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