Re: [android-developers] Recents

2010-10-21 Thread Dianne Hackborn
A task, as a logical collection of activities, is unrelated to a physical
process.

On Thu, Oct 21, 2010 at 10:40 PM, CMWiii  wrote:

> Working on a little sub-project to do with task switching and I came
> across an oddity (for me)
> on RecentTaskInfo.
>
>
> If I start a browser (Dolphin for example)  and then exit using their
> menu exit option
> what I see is that in RecentTaskInfo the id is still positive.  In
> theory it is running
> because the id is not -1.
> If I return to home then launch the browser again the id number is now
> different.
> I would expect this if the last one was actually ended.
>
> DDMS shows the browser and after the menu exit press DDMS shows it
> going away.  The
> presence and absence is also confirmed by looking at the
> RunningTasksInfo.
>
> Any thoughts?  This seems only to happen with browsers.  What am I
> missing?
>
> --
> 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
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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

Re: [android-developers] how to post a tweet through android example

2010-10-21 Thread Kumar Bibek
You the Intent for Twitter app

On Mon, Oct 18, 2010 at 10:55 AM, bhargav  wrote:

> hai ,
> in my application twitter button is there.just i click on the twitter
> button open the text box and enter the message after click on the post
> button .it will post to the twitter.
>
> but in my app i connect twitter.. it will go through the
> browser.it's not correct.
> any one knows please help me
>
> thanks®ards
>
> --
> 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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com

-- 
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

Re: [android-developers] Can't create new Android project in Eclipse

2010-10-21 Thread Kumar Bibek
You need the ADT plugin first installed on eclipse.

On Tue, Oct 19, 2010 at 9:58 PM, egobuilder  wrote:

> I followed the instructions for installing the Android SDK on Windows
> 7 from http://developer.android.com/sdk/index.html ...but when I open
> Eclipse and click "New" it doesn't show "Android" in the list, even
> when I click "Other". Nor does it appear under the "Window" tab. What
> step am I missing to make "Android" appear in the "New" options or
> "Window" options.
>
> --
> 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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com

-- 
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

[android-developers] Re: Android Porting on Telechips TCC89XX: Not able to start init process

2010-10-21 Thread suman
Hello all,

With some changes in the config file we are able to start the android init
script it is able to start all most all process android related
Here is my o/p for ps


07:01:198>/system # ps

07:01:198>  PID  Uid VmSize Stat Command

07:01:214>1 root276 S   init

07:01:214>2 rootSW< [kthreadd]

07:01:214>3 rootRW< [ksoftirqd/0]

07:01:214>4 rootSW< [events/0]

07:01:245>5 rootSW< [khelper]

07:01:245>  173 rootSW< [kintegrityd/0]

07:01:245>  174 rootSW< [kblockd/0]

07:01:245>  180 rootSW< [ksuspend_usbd]

07:01:386>  185 rootSW< [khubd]

07:01:386>  206 rootSW  [pdflush]

07:01:386>  207 rootSW  [pdflush]

07:01:386>  208 rootSW< [kswapd0]

07:01:401>  210 rootSW< [aio/0]

07:01:401>  338 rootSW< [tcc-usb-thread]

07:01:401>  374 root452 S < udevd --daemon

07:01:417>  684 rootSW< [ndda]

07:01:417>  754 root404 S   -sh

07:01:417> 1026 1000256 S   /system/bin/servicemanager

07:01:432> 1027 root348 S   /system/bin/vold

07:01:432> 1028 root292 S   /system/bin/debuggerd

07:01:432> 1031 1001684 S   /system/bin/rild

07:01:448> 1032 root   4800 D   zygote /bin/app_process -Xzygote
> /system/bin --zygote

07:01:448> 1035 root264 S   /system/bin/installd

07:01:448> 1040 root152 S   /sbin/adbd

07:01:464> 1089 root /sbin/adbd

07:01:464> 1090 root368 R   ps



I was able to patch linux-2.6.29 with android patches along with my BSP
patches
also run init script for android above is the ps o/p for android board, but
again i am
facing some problem in android logo.

All i could see on the display was some garbage data.

I have the following doubts

how can i change the resolution for the android image, i think it is now 320
* 480, how can we change it ?

I think my problem is same as this guy
http://groups.google.com/group/android-beginners/browse_thread/thread/19b4a038ffab03e6?pli=1


If you have idea or experience for it, please let me know.

thanks and regards
Suman

On Thu, Sep 23, 2010 at 12:29 PM, Suman  wrote:

> Hello
>
> I have started to port Android on TCC89XX board, I download Android
> SDK. and applied the patch with kernel 2.6.29, the Processor is having
> armv6 instruction set.
>
> I am not able to see the network up ifconfig is not able to show the
> network devices.
>
> Also I do not get why there is no "on" binary in the system/bin,
> system/xbin, the init.rc and init.goldfish.rc.
>
> I cannot get the zygote process up. create_socket throws error.
>
> If any one knows about this, please tell what i need to do correctly
> or point me to some correct URL's which will be help full
>
> thanks Suman




-- 
Rgds
Vijayendra Suman

The only basis for a true and lasting unity of all humanity is the religion
of the heart. The religion of the heart is the religion of love. People can
only be united if they are free from jealousy, hatred and petty-mindedness.
Purify your heart first. Meet hatred with love and malice with goodwill. The
purer you make your heart, the greater will be the power of your love.

-- 
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

[android-developers] Re: Autocomplete widget - not working - code attached

2010-10-21 Thread Anees
Hi,
Sorry for the wrong code. Here is the code which has the issues I
mentioned.

import org.json.JSONArray;
import org.json.JSONException;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.ArrayAdapter;

public class YoutubeAutoComplete extends Activity {
Youtube yt = new Youtube();
CustomAutoComplete myAutoComplete;
ArrayAdapter adapter;
private JSONArray js;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

myAutoComplete = (CustomAutoComplete)
findViewById(R.id.autocomplete);
adapter = new ArrayAdapter(this,
android.R.layout.simple_dropdown_item_1line);
myAutoComplete.addTextChangedListener(textWatcher);
myAutoComplete.setAdapter(adapter);
adapter.notifyDataSetChanged();
}

TextWatcher textWatcher = new TextWatcher() {

public void onTextChanged(final CharSequence s, int start, int
before,
int count) {

Thread t = new Thread() {

public void run() {
try {
System.out.println("in here 
***");
js = 
yt.GetSuggestions(s.toString()).getJSONArray(1);

messageHandler.sendEmptyMessage(0);
} catch (JSONException e) {
// TODO Auto-generated catch 
block
e.printStackTrace();
}

}
};
t.start();
}

public void beforeTextChanged(CharSequence s, int start, int 
count,
int after) {

}

public void afterTextChanged(Editable s) {
}
};

private Handler messageHandler = new Handler() {
public void handleMessage(Message msg) {
for (int i = 0; i < js.length(); i++) {
try {

adapter.add(js.getJSONArray(i).getString(0));

System.out.println(js.getJSONArray(i).getString(0));
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
adapter.notifyDataSetChanged();
}
};

}


Looking forward,
Regards,
Anees

On Oct 22, 11:25 am, Anees  wrote:
> Hi experts,
>
> I am trying to implement a dynamic auto complete widget in android. I
> am done with the major functionalities and the auto completion
> implemented is for youtube video search.
>
> When I start typing a letter or two, the auto-completion is not
> working. But when I type three letters or more it works prefect. It
> also works when I type two letters and hit a backspace. I do not know
> what is wrong with the code.
>
> Code is as follows
>
> import android.app.Activity;
> import android.content.Intent;
> import android.os.Bundle;
> import android.view.View;
> import android.view.View.OnClickListener;
> import android.widget.Button;
>
> public class SendUrl extends Activity {
>         /** Called when the activity is first created. */
>         Button button;
>
>         @Override
>         public void onCreate(Bundle savedInstanceState) {
>                 super.onCreate(savedInstanceState);
>                 setContentView(R.layout.main);
>                 button = (Button) findViewById(R.id.Button01);
>                 button.setOnClickListener(new OnClickListener() {
>
>                         @Override
>                         public void onClick(View v) {
>                                 Intent picMessageIntent = new Intent(
>                                 android.content.Intent.ACTION_SEND);
>                                 
> picMessageIntent.putExtra(Intent.EXTRA_SUBJECT, "Here's a cool
> youtub video");
>                                 picMessageIntent.putExtra(Intent.EXTRA_TEXT, 
> "Go to url: "+"http://
> google.com/");
>                                 picMessageIntent.setType("plain/text");
>       

[android-developers] Re: Autocomplete widget - not working - code attached

2010-10-21 Thread Anees
Sorry for the wrong code. Here is the correct one which has the issues
I mentioned.

import org.json.JSONArray;
import org.json.JSONException;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.ArrayAdapter;

public class YoutubeAutoComplete extends Activity {
Youtube yt = new Youtube();
CustomAutoComplete myAutoComplete;
ArrayAdapter adapter;
private JSONArray js;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

myAutoComplete = (CustomAutoComplete)
findViewById(R.id.autocomplete);
adapter = new ArrayAdapter(this,
android.R.layout.simple_dropdown_item_1line);
myAutoComplete.addTextChangedListener(textWatcher);
myAutoComplete.setAdapter(adapter);
adapter.notifyDataSetChanged();
}

TextWatcher textWatcher = new TextWatcher() {

public void onTextChanged(final CharSequence s, int start, int
before,
int count) {

Thread t = new Thread() {

public void run() {
try {
System.out.println("in here 
***");
js = 
yt.GetSuggestions(s.toString()).getJSONArray(1);

messageHandler.sendEmptyMessage(0);
} catch (JSONException e) {
// TODO Auto-generated catch 
block
e.printStackTrace();
}

}
};
t.start();
}

public void beforeTextChanged(CharSequence s, int start, int 
count,
int after) {

}

public void afterTextChanged(Editable s) {
}
};

private Handler messageHandler = new Handler() {
public void handleMessage(Message msg) {
for (int i = 0; i < js.length(); i++) {
try {

adapter.add(js.getJSONArray(i).getString(0));

System.out.println(js.getJSONArray(i).getString(0));
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
adapter.notifyDataSetChanged();
}
};

}


On Oct 22, 11:25 am, Anees  wrote:
> Hi experts,
>
> I am trying to implement a dynamic auto complete widget in android. I
> am done with the major functionalities and the auto completion
> implemented is for youtube video search.
>
> When I start typing a letter or two, the auto-completion is not
> working. But when I type three letters or more it works prefect. It
> also works when I type two letters and hit a backspace. I do not know
> what is wrong with the code.
>
> Code is as follows
>
> import android.app.Activity;
> import android.content.Intent;
> import android.os.Bundle;
> import android.view.View;
> import android.view.View.OnClickListener;
> import android.widget.Button;
>
> public class SendUrl extends Activity {
>         /** Called when the activity is first created. */
>         Button button;
>
>         @Override
>         public void onCreate(Bundle savedInstanceState) {
>                 super.onCreate(savedInstanceState);
>                 setContentView(R.layout.main);
>                 button = (Button) findViewById(R.id.Button01);
>                 button.setOnClickListener(new OnClickListener() {
>
>                         @Override
>                         public void onClick(View v) {
>                                 Intent picMessageIntent = new Intent(
>                                 android.content.Intent.ACTION_SEND);
>                                 
> picMessageIntent.putExtra(Intent.EXTRA_SUBJECT, "Here's a cool
> youtub video");
>                                 picMessageIntent.putExtra(Intent.EXTRA_TEXT, 
> "Go to url: "+"http://
> google.com/");
>                                 picMessageIntent.setType("plain/text");
>                                 
> s

[android-developers] Autocomplete widget - not working - code attached

2010-10-21 Thread Anees
Hi experts,

I am trying to implement a dynamic auto complete widget in android. I
am done with the major functionalities and the auto completion
implemented is for youtube video search.

When I start typing a letter or two, the auto-completion is not
working. But when I type three letters or more it works prefect. It
also works when I type two letters and hit a backspace. I do not know
what is wrong with the code.

Code is as follows

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class SendUrl extends Activity {
/** Called when the activity is first created. */
Button button;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
button = (Button) findViewById(R.id.Button01);
button.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
Intent picMessageIntent = new Intent(
android.content.Intent.ACTION_SEND);
picMessageIntent.putExtra(Intent.EXTRA_SUBJECT, 
"Here's a cool
youtub video");
picMessageIntent.putExtra(Intent.EXTRA_TEXT, 
"Go to url: "+"http://
google.com/");
picMessageIntent.setType("plain/text");

startActivity(Intent.createChooser(picMessageIntent, "Send your
url using:"));
}
});
}
}




Experts, kindly guide me. I would be obliged if you can point out
where I have gone wrong with the code.

Any help in this regard will be well appreciated.

Looking forward,
Regards,
Anees

-- 
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


[android-developers] Re: LVL found to be easy to crack

2010-10-21 Thread Jose
I think that an easy way to tamper-proof apk would be:

1) Android Market computes a checksum for the apk when the apk is
uploaded
2) In the License Response (eg. in one extra), Android Market send
this value
3) The aplication computes the same checsum of itself. If the values
don`t match, just finis()

This could be very easy to do for Android Market developers...

Regards,
Jose

On Aug 24, 8:16 pm, Trevor Johns  wrote:
> FYI: We have a blog post up on this topic. It covers many of the points I
> made earlier, but I figured it's worth pointing out.
>
> http://android-developers.blogspot.com/2010/08/licensing-server-news
>
> --
> Trevor Johns
> Google Developer Programs, Androidhttp://developer.android.com
> 
>
> On Tue, Aug 24, 2010 at 8:26 AM, a1  wrote:
> > > But I'm not sure that native code is any harder to patch, and there
> > > are still identifiable syscalls or calls back up to java for i/o to
> > > show where it tries to accomplish verification.
>
> > First of all it's much harder to bypass especially if you are dealing
> > with optimized code and you will have to do it at least twice (for arm
> > abi and armv7 abi). Event toolchain setup is more complicated.
>
> > --
> > Bart Janusz (Beepstreet)
>
> > --
> > 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

-- 
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


Re: [android-developers] Re: Looking for android dev (2-10 yrs) Bangalore

2010-10-21 Thread Kumar Bibek
:D, 10 years lol

On Fri, Oct 22, 2010 at 6:56 AM, metal mikey  wrote:

> Asking for 10 years Android experience? DODGEY!
> Send resumes to a gmail account? DODGEY!
> Best salary in industry...in Bangalore? DODGEY!
>
> On Oct 22, 9:51 am, William Ferguson 
> wrote:
> > I think he meant 2-10 years old.
> > Ie somewhere between just out of nappies and no pubes yet.
> > Child labour, its all the rage in IT these days.
> >
> > On Oct 22, 8:07 am, Kostya Vasilyev  wrote:
> >
> > > Is that 10 years of Android experience? :)
> >
> > > --
> > > Kostya Vasilyev --http://kmansoft.wordpress.com
> >
> > > 22.10.2010 1:32 пользователь "Amit Bihari" 
> написал:
> >
> > > Please send your resume at saswati.peop...@gmail.com
> >
> > > Location : Bangalore
> > > Salary : Best in Industry
> >
> > > --
> > > 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 athttp://
> groups.google.com/group/android-developers?hl=en
>
> --
> 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
>



-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com

-- 
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

[android-developers] Re: My tracks navigation overlay?

2010-10-21 Thread Spiral123

http://code.google.com/p/mytracks/

On Oct 21, 10:24 am, dweinand  wrote:
> Hello,
>
> can somebody point me to the right direction how the navigation
> overlays for My Tracks are implemented? I'm talking about the
> "buttons" for navigating appearing on the left and right side if you
> tap on the screen. Any pointers?
>
> thx a lot

-- 
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


[android-developers] Recents

2010-10-21 Thread CMWiii
Working on a little sub-project to do with task switching and I came
across an oddity (for me)
on RecentTaskInfo.


If I start a browser (Dolphin for example)  and then exit using their
menu exit option
what I see is that in RecentTaskInfo the id is still positive.  In
theory it is running
because the id is not -1.
If I return to home then launch the browser again the id number is now
different.
I would expect this if the last one was actually ended.

DDMS shows the browser and after the menu exit press DDMS shows it
going away.  The
presence and absence is also confirmed by looking at the
RunningTasksInfo.

Any thoughts?  This seems only to happen with browsers.  What am I
missing?

-- 
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


[android-developers] Re: ListView OnClickListners Issue

2010-10-21 Thread Honey
As i have mentioned i am having issues with using two listeners in the
code.One for the button in the list and the other having listener for
the list itself.

On Oct 21, 10:29 pm, TreKing  wrote:
> On Thu, Oct 21, 2010 at 5:24 AM, Honey  wrote:
> > Please let me know a solution for this issue.
> > I have attached the sample code here:
>
> Sorry, but realistically no one is going to download your files, sift
> through your code, determine your problem, and give you a solution.
>
> Post the code bits where you're specifically having issues (where you set
> the list and button listeners) and we'll be more inclined to try to help.
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
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


[android-developers] Re: Question on Shelves example

2010-10-21 Thread Zsolt Vasvari
I wouldn't obfuscate my code like that.  If this were an inner loop
with a million iterations, maybe, but it would have to backed up by
hard numbers.

On Oct 22, 6:47 am, Romain Guy  wrote:
> This was useful before the JIT was added in Android 2.2. It's a bit
> faster, though in this particular case it doesn't really matter, I did
> it out of habit :)
>
>
>
>
>
> On Thu, Oct 21, 2010 at 3:45 PM, Prakash Iyer  wrote:
> > The reference article on Painless Threading pointed me to the Shelves
> > example as a place to understand AsyncTask. So I was reading that example.
> > One question popped into my head while I was going thru ShelvesActivity. The
> > onPause code calls stopBooksUpdater. That code snippet is as follows,
> > private void stopBooksUpdater() {
> >         final BooksUpdater booksUpdater = mBooksUpdater;
> >         booksUpdater.clear();
> >         booksUpdater.stop();
> > }
> > What's the reason for a local final variable which is manipulated as opposed
> > to the member variable? This happens in one more place but in others the
> > member variable is directly accessed, e.g. in onResume.
> > Thanks!
>
> > --
> > 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
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them- Hide quoted text -
>
> - Show quoted text -

-- 
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


[android-developers] Re: ListView OnClickListners Issue

2010-10-21 Thread Honey
Thanks TreKing fro your help.

On Oct 21, 10:29 pm, TreKing  wrote:
> On Thu, Oct 21, 2010 at 5:24 AM, Honey  wrote:
> > Please let me know a solution for this issue.
> > I have attached the sample code here:
>
> Sorry, but realistically no one is going to download your files, sift
> through your code, determine your problem, and give you a solution.
>
> Post the code bits where you're specifically having issues (where you set
> the list and button listeners) and we'll be more inclined to try to help.
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
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


Re: [android-developers] Aptana ADT Signing Application

2010-10-21 Thread Kumar Bibek
http://techdroid.kbeanie.com/2010/02/sign-your-android-applications-for.html

Location is set to "C:/Program Files/java/jer6/bin/keytool.exe" This step is
not right

On Thu, Oct 21, 2010 at 3:03 PM, Martin Barker wrote:

> Hi Got a little problem with Signing my Application
>
> I'm Using Aptana (for those that don't know its Eclipse with some add-
> ons)
>
> I have the app working and just trying to add it to the market place
> but for some reason i'm hitting the wall,
>
> So here's a run though of what i do.
>
> Right click on project
>
> Hover over Android and click on Export Signed Application Package
>
> Click Next
>
> Select Use Existing KeyStone
>
> Location is set to "C:/Program Files/java/jer6/bin/keytool.exe"
>
> I set my password
>
> Click Next
>
> Select Create New Key
>
> I fill out the form and click next
>
> I browse to my desktop to save the *.apk to
>
> Then i click Finish and GET
>
> "Keytool Error: java.io.IOException: Invalid keystore format"
>
> Can any one help please
>
> --
> 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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com

-- 
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

[android-developers] Re: Memory Leak with a ListView revisited

2010-10-21 Thread John Gaby
As an experiment, I tried removing the GListView from it's parent
LinearLayout when I no longer needed it.  When I did this, the garbage
collector was then able to recycle the parent (the LinearLayout), but
the GListView remained in memory and was not freed.

Using the Memory Analyzer, I can list the incoming references for one
of the GListViews which should be freed but is not:

Class
Name  |
Shallow Heap | Retained Heap
---
com.gabysoft.system.GListView @ 0x43e6fec8
Unknown  |  672 | 3,432
|- host android.view.View$ScrollabilityCache @
0x43e701b8   |   80 |   584
|- this$0 android.widget.AbsListView$RecycleBin @
0x43e70488|   40 |96
|- mCallback android.graphics.drawable.StateListDrawable @
0x43e70500   |   64 | 1,464
|- this$0 android.widget.AdapterView$AdapterDataSetObserver @
0x43e70d10|   16 |16
'- Total: 4
entries
|  |
---

Does this give anyone a clue as to where the problem might be?  Surly
I must be doing something wrong here. There cannot be this kind of
leak in general can there?

Thanks.


On Oct 21, 5:47 pm, John Gaby  wrote:
> I have already tried making the ListAdapter a completely separate
> public class, and it does not seem to help.  I can post that code, if
> it would be helpful (perhaps I have something wrong with it).
>
> Thanks.
>
> On Oct 21, 5:33 pm, Mark Murphy  wrote:
>
> > Move your ListAdapter to a public class or a static inner class of
> > your Activity, and see if that helps. A ListView being its own adapter
> > is not a well-trod path.
>
> > On Thu, Oct 21, 2010 at 8:04 PM, John Gaby  wrote:
> > > I am still struggling with a memory leak associated with a ListView.
> > > I have created the following small program which exhibits this
> > > behavior.
>
> > > What I do is create 2 LinearLayouts.  The first has a Button and a
> > > GListView control.  The code for GListView is below, but it just sub-
> > > classes ListView, and implements the ListAdapter interface.  When the
> > > GListView is created, it sets it's adapter to itself.
>
> > > Now when you press the button I switch to the second LinearLayout.
> > > This layout has only a single button.  When you press this button, I
> > > create a new 1st layout with a new GListView and set it as the active
> > > view.
>
> > > Run the program, and switch between the two views 20 times.  Then
> > > bring up the DDMS and force a garbage collection.  Then Dump the heap,
> > > and use the Memory Analyzer and you will find 21 GListView objects
> > > remaining.  That is, the 20 GListViews that are not longer connected
> > > to anything have NOT been freed.
>
> > > Now if I comment out the 'setAdapter(this)' function in the GListView
> > > constructor and repeat the above, I find that there is only 1
> > > GListView that remains.  That is, in this case, all of the unused
> > > GListViews have been properly recycled.
>
> > > Someone suggested that I create a private class within my GListView to
> > > handle the ListAdapter interface, and I tried that, but it did not
> > > help.
>
> > > Surely there is some way to make these objects go away when they are
> > > no longer used anywhere.  (Isn't that what garbage collection is all
> > > about?)
>
> > > Any help would be appreciated.  I am really pulling my hair out on
> > > this one.
>
> > > Thanks.
>
> > > /*
> > >  * Activity
> > >  */
>
> > > package com.gabysoft.memoryleak;
>
> > > import android.app.Activity;
> > > import android.os.Bundle;
> > > import android.view.View;
> > > import android.widget.Button;
> > > import android.widget.LinearLayout;
> > > import android.widget.ListView;
>
> > > public class MemoryLeak extends Activity implements
> > > android.view.View.OnClickListener
> > > {
> > >    LinearLayout ll2;
> > >    boolean page2 = false;
>
> > >    private LinearLayout CreateLayout()
> > >    {
> > >        LinearLayout ll = new LinearLayout(this);
>
> > >        Button btn1 = new Button(this);
> > >        ListView    lv    = new GListView(this);
>
> > >        btn1.setText("Press");
> > >        btn1.setLayoutParams(new LinearLayout.LayoutParams(100, 40));
> > >        btn1.setOnClickListener(this);
>
> > >        ll.addView(btn1);
> > >        ll.addView(lv);
>
> > >        return(ll);
> > >    }
>
> > >    /** Called when the activity is first created. */
> > >   �...@override
> > >    public void onCreate(Bundle savedInstanceState)
> > >    {
> > >        super.onCreate(savedInstanceState);
>
> > >        CreateLayout();
>
> > >        LinearLayout ll = CreateLayout();
> > >        ll2 = new LinearLayout(this);
>
> > >        Button btn2 = new Button(this);
>
> > >        b

[android-developers] Re: Shared Memory

2010-10-21 Thread Bob Kerns
Actually, you can arrange for them to run in the same process, if you
supply both the android:sharedUserId attribute on the manifest
element, and the android:process attribute on the application element,
and you sign them both with the same signing certificate.

You'll also have to work out how to share access to the information,
as the applications will have been loaded by different classloaders,
but there are ways that can be done.

But I'd question whether that's really what you want or need to do.
That's really not how the system is designed to be used normally. A
service, or sharing using android:sharedUserId to allow access to each
other's data, or even persisting the data off the device in a web
service are more usual approaches. You really didn't say what you are
trying to accomplish, so we can't really make a more specific
recommendation.

On Oct 20, 6:14 am, chazz  wrote:
> Hi, I am new in android development. i was wondering if i could share
> some data between two applications in android. One way is to place the
> text file on SdCard but i dont want to do this... second way is to
> place in data folder, and i dont know how to 3rd way is to place
> the data in shared memory so both applications can see it... also i
> dont want the user to see or delete this file, only my two
> applications can change this file or data.
> Please help me... i've been wondering on this for 2 days
>
> regards,

-- 
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


Re: [android-developers] Install-time Extraction of .apk files

2010-10-21 Thread Dianne Hackborn
Ignoring the fact that there is no promise this hack will work in the
future, doing this is also telling the platform that your app relies on ARM
code so it will not be available to devices running with other CPUs whenever
those appear.

Why do you need to do this?  If you need the data as an uncompressed file
for random access and such, it is more efficient to store it uncompressed in
the .apk use the API to retrieve an fd and offset to the file for reading.
 Otherwise you have to install on the user's device both the compressed and
uncompressed versions of the file.

On Thu, Oct 21, 2010 at 8:10 AM, Jonathan Pryor  wrote:

> I'm writing an application and would like to have some files extracted
> from the .apk during _installation_ time, as the files can be quite
> large and extracting them from the .apk during the first run results in
> a noticeable slowdown which I would prefer to avoid.
>
> After lots of experimentation, I have found one way to make this work,
> but I'm unsure about the "long-term" ramifications of this approach,
> specifically: will this actually work in android-9 and later?
>
> The approach is to name the files I want extracted at installation time
> as "lib*.so", and place them into the appropriate lib/ABI folder within
> the apk file, e.g. the .apk contains:
>
>lib/armeabi/libMyLargeFile.dat.so
>
> and at installation time this is (nicely) installed as:
>
>$APPDIR/lib/libMyLargeFile.dat.so
>
> My concern is that 'libMyLargeFile.dat.so' is NOT an ELF shared library.
> This approach only works because PackageManagerService only checks for
> files matching the `lib/ABI/lib*.so` pattern (which is followed) and
> does not check the contents of the extracted file.
>
> This approach works for Android 1.6 through Android 2.2.  I'm wondering
> if this will continue to work in the future, or if I need to investigate
> an alternate mechanism.
>
> Thanks,
>
>  - Jon
>
> P.S. On a related note, I did see android.app.backup.BackupAgent, which
> says "Restore operations are typically performed only when applications
> are first installed on a device."  Unfortunately, this type is only
> supported in Android 2.2, and even when I
> specify /manifest/application/@android:backupAgent my BackupAgent isn't
> ever instantiated, never mind "when...first installed on a device," so
> the docs appear to be misleading or I'm missing some other crucial
> undocumented step.
>
>
> --
> 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
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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

Re: [android-developers] How can I access data from SD card?

2010-10-21 Thread Miguel Morales
Google offers some good documentation on this:
http://developer.android.com/guide/topics/data/data-storage.html

On Thu, Oct 21, 2010 at 8:30 PM, MG  wrote:
> Hello everyone!
>
> I juts want to know how can I access a certain data from my SD card.
> How can I browse SD card contents?
> For example, from my application, I want to open a pdf file from SD
> card,
> how am I going to do this?
>
> I tried to write this code but it doesnt seem to work.
>
> Uri uri = Uri.parse("file:///sdcard/");
> Intent intent = new Intent(Intent.ACTION_PICK, uri);
> startActivity(intent);
>
>
> Thank you.
>
> --
> 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



-- 
~ Jeremiah:9:23-24
Android 2D MMORPG: http://developingthedream.blogspot.com/,
http://www.youtube.com/user/revoltingx

-- 
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


[android-developers] How can I access data from SD card?

2010-10-21 Thread MG
Hello everyone!

I juts want to know how can I access a certain data from my SD card.
How can I browse SD card contents?
For example, from my application, I want to open a pdf file from SD
card,
how am I going to do this?

I tried to write this code but it doesnt seem to work.

Uri uri = Uri.parse("file:///sdcard/");
Intent intent = new Intent(Intent.ACTION_PICK, uri);
startActivity(intent);


Thank you.

-- 
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


[android-developers] Re: Setting Widget Icon Image on Widget Load

2010-10-21 Thread metal mikey
A Button is not an ImageView.

Try using an ImageView instead of a Button.

On Oct 22, 8:14 am, YuviDroid  wrote:
> I'm not sure what's wrong with your code and I'm kind of guessing
> here...but:
>
> - onEnabled() is only called when the FIRST widget is created. So, if you
> try to add a second widget to the homescreen this method will not be called.
> Also, maybe, when onEnabled() is called the widget actually does not exist
> yet? So your updateAppWidget() is probably doing nothing.
>
> - try moving this piece of code to the onUpdate() method of your widget
> provider (which is called whenever the widget requires an update).
>
> - are you setting other RemoteViews objects in your onReceive() method?
>
> Yuvi
>
>
>
> On Sat, Oct 16, 2010 at 7:40 PM, Benaiah  wrote:
> > I am writing my first application and am trying to get my widget to
> > load a different image when it is added to the home screen based on
> > the state of the notification volume.  It is detecting the
> > notification state fine and the proper Toast messages appear when I
> > add the widget, but I'm not getting any icon.  I just get an empty
> > button.  I'm using the same code to change the icon in my onReceive()
> > method to do other things and that works fine.  Is this the proper way
> > to accomplish that?  Any suggestions as to what I'm doing wrong would
> > be appreciated!
>
> >       @Override
> >        public void onEnabled(Context context)
> >        {
> >                AudioManager aManager = (AudioManager)
> > context.getSystemService(Context.AUDIO_SERVICE);
>
> >                RemoteViews remoteViews = new
> > RemoteViews(context.getPackageName(),
> > R.layout.widget);
>
> >                if
> > (aManager.getStreamVolume(AudioManager.STREAM_NOTIFICATION) ==
> > 0)
> >                {
> >                        Toast.makeText(context, "Off",
> > Toast.LENGTH_SHORT).show();
> >                        remoteViews.setImageViewResource(R.id.button,
> > R.drawable.off);
> >                        ComponentName cn = new ComponentName(context,
> > SilenceWidget.class);
>
> >  AppWidgetManager.getInstance(context).updateAppWidget(cn,
> > remoteViews);
> >                }
> >                else
> >                {
> >                        Toast.makeText(context, "On",
> > Toast.LENGTH_SHORT).show();
> >                        remoteViews.setImageViewResource(R.id.button,
> > R.drawable.on);
> >                        ComponentName cn = new ComponentName(context,
> > SilenceWidget.class);
>
> >  AppWidgetManager.getInstance(context).updateAppWidget(cn,
> > remoteViews);
> >                }
> >        }
>
> > --
> > 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
>
> --
> YuviDroid
> Check out Launch-X  (a widget to
> quickly access your favorite apps and contacts!)http://android.yuvalsharon.net

-- 
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


Re: [android-developers] Issue with Catch Handler

2010-10-21 Thread John Moline
Thanks Brad. I did narrow it down to my emulator. If I run the same
process without using the emulator, it runs fine. It looks like some
sort of permissions or framework issue within the emulator.

On Thu, Oct 21, 2010 at 7:22 PM, Brad Gies  wrote:
> I have had the same problem... It's not the Exception that is null, it's
> that getMessage() returns null.
>
> In some catch blocks (I think mainly or only to do with HTTPClient, but it
> may happen also with JSON Exceptions... I can't remember) calling
> e.getMessage() returns null since I updated my SDK to 2.2, and it caused
> major issues because I normally wrote that to a log file, which meant that
> my catch block was creating an exception
>
> Would love to know the reason... And would be even better if it got fixed.
>
> In the meantime, I'm doing this in my catch block if I use the message for
> ANYTHING:
>
>                String message = ex.getMessage();
>                if (message == null)
>                    message = "null";
>
> Then I write the message... It's a major pain...
>
> I don't have an answer for you either... just letting you know it's not just
> you :)
>
> Sincerely,
>
> Brad Gies
> ---
> Bistro Bot - Bistro Blurb
> http://bgies.com            http://nocrappyapps.com
> http://bistroblurb.com      http://forcethetruth.com
> http://ihottonight.com
> ---
> Everything in moderation, including abstinence (paraphrased)
>
> Every person is born with a brain... Those who use it well are the
> successful happy ones - Brad Gies
>
> Adversity can make or break you... It's your choice... Choose wisely - Brad
> Gies
>
> Never doubt that a small group of thoughtful, committed people can
> change the world. Indeed. It is the only thing that ever has - Margaret Mead
>
>
> On 19/10/2010 9:35 PM, Johnny Molina wrote:
>>
>> Hello,
>>
>> I have recently hit a snag using the Android plugin to Eclipse. For
>> some reason, ALL of my errors being thrown don't initialize and show
>> me the error. Has anyone ever seen this issue before and if so, what
>> did you do to correct it?
>>
>> In particular, I am seeing it when I try to invoke the HTTPGet in a
>> HTTPClient object. If I have no connectivity, then I should get an
>> error. The Catch block does fire when this occurs...however, when I
>> check my general Exception object, the object is NULL (NULL Pointer).
>> Why would this happen if the catch is grabbing the exception?
>>
>> My exceptions used to be workingand I was able to see the stack
>> trace. However, I can no longer see any stack trace regardless of the
>> Exception class I am using. Can someone please help me understand what
>> the heck is wrong with Eclipse, Android, or both? Is there something I
>> am missing on the configuration side?...is this a bug?
>>
>> Mind you, I have already used Stack Overflow for this question. It has
>> been viewed 40 times but no answer yet. I hope anybody on here can
>> help me understand why this is occurring.
>>
>> Thanks in advance,
>>
>> John
>>
>
> --
> 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

-- 
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


[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-21 Thread DanH
Probably true on Android, not universally true.  Would fail on
standard Java, like I said, if -Xfuture were specified.

On Oct 21, 5:27 pm, fadden  wrote:
> On Oct 20, 11:10 am, DanH  wrote:
>
> > The wrapper class example is defective if the verifier is
> > "conventional" -- doesn't have the  swizzle you describe since 1.6.
>
> It works because the code does something like:
>
>   if (version is 2.0 or later)
>     use wrapped stuff
>   else
>     feature not available, do nothing
>
> The wrapper class would fail verification and not be usable, but
> references *to* the wrapped class would be okay.  Verification happens
> between loading and initialization.  If class C refers to class D, the
> VM needs to be able to load D and examine it, but does not need to
> initialize and verify D in order to verify C.  This is still true in
> older versions of Android.

-- 
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


[android-developers] Re: Difference between StageFright and Opencore

2010-10-21 Thread Indicator Veritatis
And at the time Google made the decision to switch to Stagefright,
Packet Video had not updated that "sophisticated framework" for years.
That despite obvious irritating -- if not crippling -- bugs.

On Oct 16, 12:21 am, Shashank 
wrote:
> Guys,
>
> Opencore is a sophisticated multimedia framework developed by Packet
> video company.
>
> Over the years it has matured a lot, but as a side effect its huge in
> terms of number lines of code.
>
> Whereas Stagefright is not a multimedia framework in my opinion. Its a
> custom library meant for multimedia playback
> use case. Stagefright has OMX interface at its core, simple and
> elegant.
>
> But still needs lot of surgery ;)
>
> regards
> Shashank
>
> -- Forwarded message --
> From: TreKing 
> Date: May 24, 9:38 pm
> Subject: Difference between StageFright and Opencore
> To: Android Developers
>
> On Mon, May 24, 2010 at 1:35 AM, SHameed 
> wrote:
> > What are the differences between StageFright and Opencore?
>
> Try google.com.
>
> > What does this mean to app developers?
>
> Try google.com.
>
> > Please point me to any links, tutorials online.
>
> Try google.com
>
> -
> 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 Developers" group.
> To post to this group, send email to android-
> develop...@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en
>
>

-- 
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


[android-developers] Re: Why doesn't the screen ever time out with the Android Emulator

2010-10-21 Thread Indicator Veritatis
Really? Well, I do have to admit that what I routinely see is just a
little different: maybe it is that difference you are referring to.

What I routinely see is that the emulator does time out, and when it
times out, it locks the phone, requiring you to either slide a key (on
2.2) or press Menu (on most earlier versions) to unlock. But it does
not dim the screen.

Remember that the emulator is only an emulator. It is not meant to
precisely mimic EVERY feature of the phone, just the most useful for
developing in emulation. I am having a hard time seeing how the
failure to actually dim the screen could impede your development. You
can still tell that it is servicing the timeout.

On Oct 16, 2:40 pm, pprochamp  wrote:
> I'm new to the Emulator and trying to test some code.  In the system
> settings of the phone device, I set the screen timeout to 15 seconds.
> However, I never see the screen go dim and lock.  How do I accomplish
> this?

-- 
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


Re: [android-developers] Implementing sync adapter - Sync icon wont disappear

2010-10-21 Thread Dmitri Plotnikov
Make sure you add the CALLER_IS_SYNCADAPTER query parameter.  If the
provider does not know that the changes are made by the sync adapter, it
assumes that the changes are made by the user and notifies the sync adapter
that they need to be synced.  Thus an infinite loop.

On Mon, Oct 18, 2010 at 4:59 AM, Descartes  wrote:

> Hi
>
> I'm implementing my own sync adapter and everything works great.
> A strange i'm having is that after the sync is over, the Android still
> shows the sync icon (the one with the rounded arrow) in the account
> activity, and that someone (i guess its the account manager)
> repeatedly calls the sync again and again, every 30 to 60 seconds.
>
> Now i tried all sort of things to test this issue and i have
> discovered something strange.
> In my code, i do resolver.applyBatch every 50 new rows. (each new
> contact i sync has about 5 rows).
> If i remove the applyBatch (which means i retrieve the data from the
> next, sort it and prepare it, but never "commit" it) - the problem
> goes away.
> The icon disappear and the account manager never calls it again on its
> own (I'm using Android 2.1).
>
> I must also state that no exception is being thrown in any of the
> cases and that all the methods finish gracefully.
>
> Any help would be appreciated !
>
> --
> 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
>

-- 
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

Re: [android-developers] How to manual aggregate contacts?

2010-10-21 Thread Dmitri Plotnikov
Update. Don't insert.  Here's a quote from the doc: "This type only supports
query and update. Neither insert nor delete are supported."  Update even
though this row does not exist - the provider will know what to do.

On Mon, Oct 18, 2010 at 2:38 AM, Goran Krstevski wrote:

> I read in ContactsContract API that applications can manual control
> contacts aggregation by adding a row to the
> ContactsContract.AggregationExceptions table. I try this code:
> ...
> ArrayList ops = new
> ArrayList();
>
>
> ops.add(ContentProviderOperation.newInsert(ContactsContract.AggregationExceptions.CONTENT_URI)
>.withValue(AggregationExceptions.TYPE,
> AggregationExceptions.TYPE_KEEP_TOGETHER)
>.withValue(AggregationExceptions.RAW_CONTACT_ID1,
> masterContactId)
>.withValue(AggregationExceptions.RAW_CONTACT_ID2,
> contactId).build());
>
>
> getApplicationContext().getContentResolver().applyBatch(ContactsContract.AUTHORITY,
> ops);
> ...
>
> but this Exception was thrown:
>
> java.lang.UnsupportedOperationException: Unknown uri:
> content://com.android.contacts/aggregation_exceptions
> at
>
> com.android.providers.contacts.LegacyApiSupport.insert(LegacyApiSupport.java:
> 832)
>
> Any suggestion for manual contact aggregation that works?
>
> --
> 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
>

-- 
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

[android-developers] Re: Is it possible to make the LED / trackball pulse while the screen is on ?

2010-10-21 Thread metal mikey
Its tied to the Notification feature, read up on that.

On Oct 19, 8:04 am, KeKeSeB  wrote:
> Hi,
>
> Is there a way I can make the LED or trackball pulse while my
> application is running and the screen is on ? The same behaviour as
> when a phonecall is received for instance ?
>
> Thanks

-- 
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


[android-developers] Re: Looking for android dev (2-10 yrs) Bangalore

2010-10-21 Thread metal mikey
Asking for 10 years Android experience? DODGEY!
Send resumes to a gmail account? DODGEY!
Best salary in industry...in Bangalore? DODGEY!

On Oct 22, 9:51 am, William Ferguson 
wrote:
> I think he meant 2-10 years old.
> Ie somewhere between just out of nappies and no pubes yet.
> Child labour, its all the rage in IT these days.
>
> On Oct 22, 8:07 am, Kostya Vasilyev  wrote:
>
> > Is that 10 years of Android experience? :)
>
> > --
> > Kostya Vasilyev --http://kmansoft.wordpress.com
>
> > 22.10.2010 1:32 пользователь "Amit Bihari"  написал:
>
> > Please send your resume at saswati.peop...@gmail.com
>
> > Location : Bangalore
> > Salary : Best in Industry
>
> > --
> > 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 
> > athttp://groups.google.com/group/android-developers?hl=en

-- 
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


Re: [android-developers] Unable to load all contact photos in my application

2010-10-21 Thread Dmitri Plotnikov
I bet those are Facebook pictures.  There is a bug in ContactsProvider2 that
does not allow loading of Facebook photos by any non-system apps.

On Sun, Oct 17, 2010 at 1:26 AM, t2k269  wrote:

> Hi all,
>
> In my app, I am using below code to obtain all contacts with PHOTO_ID:
>
>Uri uri = ContactsContract.Contacts.CONTENT_URI;
>Cursor cur = contentResolver.query(uri, new String[]
> {
>ContactsContract.Contacts._ID,
>
>  ContactsContract.Contacts.LOOKUP_KEY,
>ContactsContract.Contacts.PHOTO_ID,
>
>  ContactsContract.Contacts.DISPLAY_NAME,
>
>  ContactsContract.Contacts.HAS_PHONE_NUMBER,
>}, CLAUSE_ONLY_VISIBLE, null,
> ContactsContract.Contacts._ID);
>
> The app has a list view to display all contacts and use the
> ContactPhotoLoader in the stock contact app to load the contact photo
> async. When running, some contact photo can be displayed correctly and
> some cannot.
>
> When clicking on the list items, the app will start the view contact
> activity of the stock contacts app:
>
>Uri uri =
> ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI,
> contact.getId());
>Intent intent = new
> Intent(Intent.ACTION_VIEW, uri);
>startActivity(intent);
>
> For the contacts, which photo cannot be displayed properly, is able to
> display correctly in the stock view contact activity. I have compared
> the source code of the stock contacts app and my app. They are doing
> the same thing basically. I have also checked for the permissions used
> by my app are covered the set of permissions used by the stock
> contacts app. What's happening?
>
> Regards,
> Thomas
>
> --
> 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
>

-- 
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

[android-developers] Re: using JSON to retrieve .NET Web Service

2010-10-21 Thread metal mikey
What's this got to do with Android?

WebServices use SOAP, not JSON. You may have defined the response
format to be JSON, but I assume the request requires SOAP since it is
a WebService.

On Oct 21, 2:22 am, Jude  wrote:
> Here is my .NET Web Service
> [WebMethod]
>     [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
>     public ArrayList GetAList()
>     {
>         ArrayList myList = new ArrayList();
>         myList.Add("One");
>         myList.Add("Two");
>         myList.Add("Three");
>
>         return myList;
>     }
>
> myserver.com/webservice.asmx
>
> How would i call this using JSON?
>
> Ironically i know what to do with it after it has already been called
> using the JSONArray Object.

-- 
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


[android-developers] Re: Catching "button" behavior

2010-10-21 Thread metal mikey
If you need to catch the ACTION_UP event, using a Button view is not
the best approach. Use an ImageView with a state-based drawable as the
background (as Kostya suggested), but you need to do your own
capturing of ACTION_DOWN and ACTION_UP. I've implemented this myself,
but I don't have the code handy so can't tell you how to get that
ACTION_UP...all I can say is: its possible :)

On Oct 22, 8:51 am, Kostya Vasilyev  wrote:
> Sure, there is a better way: use a button with a custom background, which
> should be a state-based drawable, pointing to individual images for various
> states: default, selected, disabled, etc...
>
> --
> Kostya Vasilyev --http://kmansoft.wordpress.com
>
> 22.10.2010 1:36 пользователь "Bill C"  написал:
>
> I need to specify the full button images for both the up and down
> positions.  My impression is that the most probable choice is to use
> an custom button based on the ImageView and specify the image for up
> and down positions.  I am using the OnTouchEvent method to capture the
> ACTION_DOWN, but I'm not getting the ACTION_UP event.
>
> Is there a better choice for creating a button that controls the full
> button image, catches the Down/Up and can subdivide the down time into
> time slices?  If not, how do I catch the up event.
>
> My application expects a screen touch on the "button" and not a
> keyboard action.
>
> Thx,
> Bill
>
> --
> 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 
> athttp://groups.google.com/group/android-developers?hl=en

-- 
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


[android-developers] Re: Memory Leak with a ListView revisited

2010-10-21 Thread John Gaby
I have already tried making the ListAdapter a completely separate
public class, and it does not seem to help.  I can post that code, if
it would be helpful (perhaps I have something wrong with it).

Thanks.

On Oct 21, 5:33 pm, Mark Murphy  wrote:
> Move your ListAdapter to a public class or a static inner class of
> your Activity, and see if that helps. A ListView being its own adapter
> is not a well-trod path.
>
>
>
> On Thu, Oct 21, 2010 at 8:04 PM, John Gaby  wrote:
> > I am still struggling with a memory leak associated with a ListView.
> > I have created the following small program which exhibits this
> > behavior.
>
> > What I do is create 2 LinearLayouts.  The first has a Button and a
> > GListView control.  The code for GListView is below, but it just sub-
> > classes ListView, and implements the ListAdapter interface.  When the
> > GListView is created, it sets it's adapter to itself.
>
> > Now when you press the button I switch to the second LinearLayout.
> > This layout has only a single button.  When you press this button, I
> > create a new 1st layout with a new GListView and set it as the active
> > view.
>
> > Run the program, and switch between the two views 20 times.  Then
> > bring up the DDMS and force a garbage collection.  Then Dump the heap,
> > and use the Memory Analyzer and you will find 21 GListView objects
> > remaining.  That is, the 20 GListViews that are not longer connected
> > to anything have NOT been freed.
>
> > Now if I comment out the 'setAdapter(this)' function in the GListView
> > constructor and repeat the above, I find that there is only 1
> > GListView that remains.  That is, in this case, all of the unused
> > GListViews have been properly recycled.
>
> > Someone suggested that I create a private class within my GListView to
> > handle the ListAdapter interface, and I tried that, but it did not
> > help.
>
> > Surely there is some way to make these objects go away when they are
> > no longer used anywhere.  (Isn't that what garbage collection is all
> > about?)
>
> > Any help would be appreciated.  I am really pulling my hair out on
> > this one.
>
> > Thanks.
>
> > /*
> >  * Activity
> >  */
>
> > package com.gabysoft.memoryleak;
>
> > import android.app.Activity;
> > import android.os.Bundle;
> > import android.view.View;
> > import android.widget.Button;
> > import android.widget.LinearLayout;
> > import android.widget.ListView;
>
> > public class MemoryLeak extends Activity implements
> > android.view.View.OnClickListener
> > {
> >    LinearLayout ll2;
> >    boolean page2 = false;
>
> >    private LinearLayout CreateLayout()
> >    {
> >        LinearLayout ll = new LinearLayout(this);
>
> >        Button btn1 = new Button(this);
> >        ListView    lv    = new GListView(this);
>
> >        btn1.setText("Press");
> >        btn1.setLayoutParams(new LinearLayout.LayoutParams(100, 40));
> >        btn1.setOnClickListener(this);
>
> >        ll.addView(btn1);
> >        ll.addView(lv);
>
> >        return(ll);
> >    }
>
> >    /** Called when the activity is first created. */
> >   �...@override
> >    public void onCreate(Bundle savedInstanceState)
> >    {
> >        super.onCreate(savedInstanceState);
>
> >        CreateLayout();
>
> >        LinearLayout ll = CreateLayout();
> >        ll2 = new LinearLayout(this);
>
> >        Button btn2 = new Button(this);
>
> >        btn2.setText("Back");
> >        btn2.setLayoutParams(new LinearLayout.LayoutParams(100, 40));
> >        btn2.setOnClickListener(this);
>
> >        ll2.addView(btn2);
>
> >        setContentView(ll);
> >    }
>
> >   �...@override
> >    public void onClick(View v)
> >    {
> >        if (page2)
> >        {
> >            LinearLayout ll = CreateLayout();
>
> >            setContentView(ll);
>
> >            page2 = false;
> >        }
> >        else
> >        {
> >            setContentView(ll2);
> >            page2 = true;
> >        }
> >    }
>
> > }
>
> > /*
> >  * GListView
> >  */
> > package com.gabysoft.memoryleak;
>
> > import android.content.Context;
> > import android.database.DataSetObserver;
> > import android.view.View;
> > import android.view.ViewGroup;
> > import android.widget.AdapterView;
> > import android.widget.ListAdapter;
> > import android.widget.ListView;
> > import android.widget.TextView;
>
> > public class GListView extends ListView implements ListAdapter
> > {
> >    Context m_context;
> >    DataSetObserver m_observer = null;
>
> >    public GListView(Context context)
> >    {
> >        super(context);
>
> >        m_context    = context;
>
> >        setAdapter(this);
>
> >        setChoiceMode(CHOICE_MODE_SINGLE);
> >    }
>
> >    /*
> >     * ListAdapter
> >     */
>
> >   �...@override
> >    public boolean areAllItemsEnabled()
> >    {
> >        return true;
> >    }
>
> >   �...@override
> >    public boolean isEnabled(int position)
> >    {
> >        return true;
> >    }
>
> >   �...@override
> >    public int getCount()
> >    {
> >   

[android-developers] Re: Inflate layouts with different density

2010-10-21 Thread Weeds
Hi Daniel, thanks for your answer.
Sorry, scaling may have been misleading a little bit, the best
solution for me would be inflating that layout with high density.
Maybe I should specify the layout a little more (actually I was wrong
before, there is only one default layout, which is "scaled up" on the
Galaxy Tab)

It is a simple RealtiveLayout for a Game Menu, with an ImageView
horizontally centered and below that are four ImageButtons in a 2x2
group.
So of course I could change the layout (or the resources it will use),
but this will probably break the layout for default HVGA screens (as I
would need larger images for the medium density version).

So my current setup looks like that:
/res/layout/screen.xml
/res/drawable-mdpi/
/res/drawable-hdpi/

And I really don't like the idea to create something like res/layout-
mdpi-1024x600 or res/drawable-mdpi-1024x600 (which would include the
same graphics as the hdpi directory).

Andre

-- 
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


Re: [android-developers] Memory Leak with a ListView revisited

2010-10-21 Thread Mark Murphy
Move your ListAdapter to a public class or a static inner class of
your Activity, and see if that helps. A ListView being its own adapter
is not a well-trod path.

On Thu, Oct 21, 2010 at 8:04 PM, John Gaby  wrote:
> I am still struggling with a memory leak associated with a ListView.
> I have created the following small program which exhibits this
> behavior.
>
> What I do is create 2 LinearLayouts.  The first has a Button and a
> GListView control.  The code for GListView is below, but it just sub-
> classes ListView, and implements the ListAdapter interface.  When the
> GListView is created, it sets it's adapter to itself.
>
> Now when you press the button I switch to the second LinearLayout.
> This layout has only a single button.  When you press this button, I
> create a new 1st layout with a new GListView and set it as the active
> view.
>
> Run the program, and switch between the two views 20 times.  Then
> bring up the DDMS and force a garbage collection.  Then Dump the heap,
> and use the Memory Analyzer and you will find 21 GListView objects
> remaining.  That is, the 20 GListViews that are not longer connected
> to anything have NOT been freed.
>
> Now if I comment out the 'setAdapter(this)' function in the GListView
> constructor and repeat the above, I find that there is only 1
> GListView that remains.  That is, in this case, all of the unused
> GListViews have been properly recycled.
>
> Someone suggested that I create a private class within my GListView to
> handle the ListAdapter interface, and I tried that, but it did not
> help.
>
> Surely there is some way to make these objects go away when they are
> no longer used anywhere.  (Isn't that what garbage collection is all
> about?)
>
> Any help would be appreciated.  I am really pulling my hair out on
> this one.
>
> Thanks.
>
>
> /*
>  * Activity
>  */
>
> package com.gabysoft.memoryleak;
>
> import android.app.Activity;
> import android.os.Bundle;
> import android.view.View;
> import android.widget.Button;
> import android.widget.LinearLayout;
> import android.widget.ListView;
>
> public class MemoryLeak extends Activity implements
> android.view.View.OnClickListener
> {
>    LinearLayout ll2;
>    boolean page2 = false;
>
>    private LinearLayout CreateLayout()
>    {
>        LinearLayout ll = new LinearLayout(this);
>
>        Button btn1 = new Button(this);
>        ListView    lv    = new GListView(this);
>
>        btn1.setText("Press");
>        btn1.setLayoutParams(new LinearLayout.LayoutParams(100, 40));
>        btn1.setOnClickListener(this);
>
>        ll.addView(btn1);
>        ll.addView(lv);
>
>        return(ll);
>    }
>
>    /** Called when the activity is first created. */
>   �...@override
>    public void onCreate(Bundle savedInstanceState)
>    {
>        super.onCreate(savedInstanceState);
>
>        CreateLayout();
>
>        LinearLayout ll = CreateLayout();
>        ll2 = new LinearLayout(this);
>
>        Button btn2 = new Button(this);
>
>        btn2.setText("Back");
>        btn2.setLayoutParams(new LinearLayout.LayoutParams(100, 40));
>        btn2.setOnClickListener(this);
>
>        ll2.addView(btn2);
>
>        setContentView(ll);
>    }
>
>   �...@override
>    public void onClick(View v)
>    {
>        if (page2)
>        {
>            LinearLayout ll = CreateLayout();
>
>            setContentView(ll);
>
>            page2 = false;
>        }
>        else
>        {
>            setContentView(ll2);
>            page2 = true;
>        }
>    }
>
> }
>
> /*
>  * GListView
>  */
> package com.gabysoft.memoryleak;
>
> import android.content.Context;
> import android.database.DataSetObserver;
> import android.view.View;
> import android.view.ViewGroup;
> import android.widget.AdapterView;
> import android.widget.ListAdapter;
> import android.widget.ListView;
> import android.widget.TextView;
>
> public class GListView extends ListView implements ListAdapter
> {
>    Context m_context;
>    DataSetObserver m_observer = null;
>
>    public GListView(Context context)
>    {
>        super(context);
>
>        m_context    = context;
>
>        setAdapter(this);
>
>        setChoiceMode(CHOICE_MODE_SINGLE);
>    }
>
>    /*
>     * ListAdapter
>     */
>
>
>   �...@override
>    public boolean areAllItemsEnabled()
>    {
>        return true;
>    }
>
>   �...@override
>    public boolean isEnabled(int position)
>    {
>        return true;
>    }
>
>   �...@override
>    public int getCount()
>    {
>        return(0);
>    }
>
>   �...@override
>    public Object getItem(int position)
>    {
>        return null;
>    }
>
>   �...@override
>    public long getItemId(int position)
>    {
>        return(position);
>    }
>
>   �...@override
>    public int getItemViewType(int position)
>    {
>        return 0;
>    }
>
>   �...@override
>    public View getView(int position, View convertView, ViewGroup
> parent)
>    {
>        TextView tv = new TextView(m_context);
>
>        tv.setText("Item");
>
>    

Re: [android-developers] Issue with Catch Handler

2010-10-21 Thread Brad Gies
I have had the same problem... It's not the Exception that is null, it's 
that getMessage() returns null.


In some catch blocks (I think mainly or only to do with HTTPClient, but 
it may happen also with JSON Exceptions... I can't remember) calling 
e.getMessage() returns null since I updated my SDK to 2.2, and it caused 
major issues because I normally wrote that to a log file, which meant 
that my catch block was creating an exception


Would love to know the reason... And would be even better if it got fixed.

In the meantime, I'm doing this in my catch block if I use the message 
for ANYTHING:


String message = ex.getMessage();
if (message == null)
message = "null";

Then I write the message... It's a major pain...

I don't have an answer for you either... just letting you know it's not 
just you :)


Sincerely,

Brad Gies
---
Bistro Bot - Bistro Blurb
http://bgies.comhttp://nocrappyapps.com
http://bistroblurb.com  http://forcethetruth.com
http://ihottonight.com
---
Everything in moderation, including abstinence (paraphrased)

Every person is born with a brain... Those who use it well are the successful 
happy ones - Brad Gies

Adversity can make or break you... It's your choice... Choose wisely - Brad Gies

Never doubt that a small group of thoughtful, committed people can
change the world. Indeed. It is the only thing that ever has - Margaret Mead


On 19/10/2010 9:35 PM, Johnny Molina wrote:

Hello,

I have recently hit a snag using the Android plugin to Eclipse. For
some reason, ALL of my errors being thrown don't initialize and show
me the error. Has anyone ever seen this issue before and if so, what
did you do to correct it?

In particular, I am seeing it when I try to invoke the HTTPGet in a
HTTPClient object. If I have no connectivity, then I should get an
error. The Catch block does fire when this occurs...however, when I
check my general Exception object, the object is NULL (NULL Pointer).
Why would this happen if the catch is grabbing the exception?

My exceptions used to be workingand I was able to see the stack
trace. However, I can no longer see any stack trace regardless of the
Exception class I am using. Can someone please help me understand what
the heck is wrong with Eclipse, Android, or both? Is there something I
am missing on the configuration side?...is this a bug?

Mind you, I have already used Stack Overflow for this question. It has
been viewed 40 times but no answer yet. I hope anybody on here can
help me understand why this is occurring.

Thanks in advance,

John



--
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


Re: [android-developers] Type Conversion to Dalvik format failed: Unable to execute dex: null

2010-10-21 Thread Daniel Drozdzewski
On Thu, Oct 21, 2010 at 11:29 AM, shuchi  wrote:
> I am trying to create an Android maps project. Everything was working
> fine until i added Salesforce classes into it. Now it doesn't even
> compile. It gives me: Type Conversion to Dalvik format failed: Unable
> to execute dex: null error.

Shuchi,

The culprits are most likely among Salesforce classes you imported.
What are you trying to do is to have SOAP consuming client, since
SForce is accessible through SOAP/WSDL, is this right?
If it is, you have to be careful when importing various jar files
precompiled for you to ease the pain of building the stubs yourself.
Many of those will rely on classes that Android has zero knowledge of
like RMI (java.rmi.*) or XML RPC (java.xml.rpc.*), which are present
in Java SE and EE.

You will probably have to bite the bullet and import some SOAP
library, that could be compiled for Android.
I am not SOAP user myself, but some people rave about ksoap2 library,
and luckily for you, it has been adjusted to work with Android:

http://code.google.com/p/ksoap2-android/


--
Daniel

-- 
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


[android-developers] Re: Detecting area code

2010-10-21 Thread Denis Souza
GPS position is a bit overkill and I don't think my users would really
be happy with my app doing that. I do like the idea of running in the
background and using the last-known (cell tower) coordinates. I'm just
affraid many users might not have a data plan and so the coordinates
can get easily outdated if they don't connect to wi-fi with a certain
frequency. The whole point of having this feature is for the users
that travel a lot and there is a good chance that they won't have open
wi-fi available just anywhere.

The app is actually for use in Brazil but I think it might not be so
hard to get hold of a database of cities and their area codes.

On Oct 20, 5:59 pm, Kostya Vasilyev  wrote:
>   Right, there is only less than a thousand area codes in the US,
> actually much less because they can't start with "0", "1", or "2" (if I
> remember right).
>
> So having a predefined mapping from GPS coordinates in the application
> seems feasible.
>
> Now getting area code coordinates for the mapping is another issue
> entirely. Maybe this info is available somewhere?
>
> -- Kostya
>
> 20.10.2010 23:40, Miguel Morales пишет:
>
>
>
>
>
>
>
>
>
> > Ah my mistake, I didn't read the last part.  You could also just do
> > the network operation in the background and when the user is about to
> > make a call just use the last-known co-ordinates.
>
> > On Wed, Oct 20, 2010 at 12:36 PM, Miguel Morales
> >   wrote:
> >> Perhaps by using GPS position and some sort of area code database you
> >> might be able to conjure up something.
>
> >> On Wed, Oct 20, 2010 at 11:37 AM, Denis Souza  
> >> wrote:
>  Is that really possible?
> >>> Frankly I don't think so... but not 100% sure either. Just wanted to
> >>> see if there are any ideas out there that could solve the problem.
>
> >>> On Oct 20, 12:42 pm, Julie Andrews  wrote:
>
>  On Wed, Oct 20, 2010 at 6:29 PM, Denis Souza  
>  wrote:
> > Hi
> > I'm trying to find out if the user is still within range of his own
> > area code. Detecting roaming doesn't solve the problem since the user
> > may still be in the same network with a different area code. I thought
> > about getting the user's coarse location to find the city he's is in
> > but this approach needs Internet access and might not be fast enough
> > (this is done as the user is making a call and needs to finish before
> > the call is made).
> > Is there any way I can do this with just the info from the cellular
> > network?
> > Denis Souza
> > --
> > 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 >  cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>  --
>  Juliehttp://tradinglogically.blogspot.comhttp://vikitionary.blogspot.comhttp://gandhi-the-man-of-millenium.blo...
> >>> --
> >>> 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
>
> >> --
> >> ~ Jeremiah:9:23-24
> >> Android 2D MMORPG:http://developingthedream.blogspot.com/,
> >>http://www.youtube.com/user/revoltingx
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
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


[android-developers] Memory Leak with a ListView revisited

2010-10-21 Thread John Gaby
I am still struggling with a memory leak associated with a ListView.
I have created the following small program which exhibits this
behavior.

What I do is create 2 LinearLayouts.  The first has a Button and a
GListView control.  The code for GListView is below, but it just sub-
classes ListView, and implements the ListAdapter interface.  When the
GListView is created, it sets it's adapter to itself.

Now when you press the button I switch to the second LinearLayout.
This layout has only a single button.  When you press this button, I
create a new 1st layout with a new GListView and set it as the active
view.

Run the program, and switch between the two views 20 times.  Then
bring up the DDMS and force a garbage collection.  Then Dump the heap,
and use the Memory Analyzer and you will find 21 GListView objects
remaining.  That is, the 20 GListViews that are not longer connected
to anything have NOT been freed.

Now if I comment out the 'setAdapter(this)' function in the GListView
constructor and repeat the above, I find that there is only 1
GListView that remains.  That is, in this case, all of the unused
GListViews have been properly recycled.

Someone suggested that I create a private class within my GListView to
handle the ListAdapter interface, and I tried that, but it did not
help.

Surely there is some way to make these objects go away when they are
no longer used anywhere.  (Isn't that what garbage collection is all
about?)

Any help would be appreciated.  I am really pulling my hair out on
this one.

Thanks.


/*
 * Activity
 */

package com.gabysoft.memoryleak;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;

public class MemoryLeak extends Activity implements
android.view.View.OnClickListener
{
LinearLayout ll2;
boolean page2 = false;

private LinearLayout CreateLayout()
{
LinearLayout ll = new LinearLayout(this);

Button btn1 = new Button(this);
ListViewlv= new GListView(this);

btn1.setText("Press");
btn1.setLayoutParams(new LinearLayout.LayoutParams(100, 40));
btn1.setOnClickListener(this);

ll.addView(btn1);
ll.addView(lv);

return(ll);
}

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);

CreateLayout();

LinearLayout ll = CreateLayout();
ll2 = new LinearLayout(this);

Button btn2 = new Button(this);

btn2.setText("Back");
btn2.setLayoutParams(new LinearLayout.LayoutParams(100, 40));
btn2.setOnClickListener(this);

ll2.addView(btn2);

setContentView(ll);
}

@Override
public void onClick(View v)
{
if (page2)
{
LinearLayout ll = CreateLayout();

setContentView(ll);

page2 = false;
}
else
{
setContentView(ll2);
page2 = true;
}
}

}

/*
 * GListView
 */
package com.gabysoft.memoryleak;

import android.content.Context;
import android.database.DataSetObserver;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class GListView extends ListView implements ListAdapter
{
Context m_context;
DataSetObserver m_observer = null;

public GListView(Context context)
{
super(context);

m_context= context;

setAdapter(this);

setChoiceMode(CHOICE_MODE_SINGLE);
}

/*
 * ListAdapter
 */


@Override
public boolean areAllItemsEnabled()
{
return true;
}

@Override
public boolean isEnabled(int position)
{
return true;
}

@Override
public int getCount()
{
return(0);
}

@Override
public Object getItem(int position)
{
return null;
}

@Override
public long getItemId(int position)
{
return(position);
}

@Override
public int getItemViewType(int position)
{
return 0;
}

@Override
public View getView(int position, View convertView, ViewGroup
parent)
{
TextView tv = new TextView(m_context);

tv.setText("Item");

return(tv);
}

@Override
public int getViewTypeCount()
{
return 1;
}

@Override
public boolean hasStableIds()
{
return false;
}

@Override
public boolean isEmpty()
{
return false;
}

@Override
public void registerDataSetObserver(DataSetObserver observer)
{
m_observer= observer;
}

@Override
public void unregisterDataSetObserver(DataSetObserver observer)
{
m_observer 

Re: [android-developers] Inflate layouts with different density

2010-10-21 Thread Daniel Drozdzewski
On Thu, Oct 21, 2010 at 11:58 PM, Weeds  wrote:
> I'm wondering if it is possible to inflate a layout using a different
> density value than the default system density.
>
> I have a high density layout, which looks good on the Galaxy Tab
> (1024x600px, hdpi) and I like to use the same layout on another tablet
> with the same pixel resolution but medium density. The mdpi layout
> which is used works on the device but the screen just looks really
> empty and I would prefer to scale things up.
>
> So is there a xml argument for scaling the layout, maybe something
> similar to Bitmap.Options.targetDensity.
> Or could this be done with a new LayoutInflater class?
>
> Thanks

Weeds,

You cannot scale layout.
I am not even sure what would that mean?
Layout is resolution independent anyway.

I think that you would you like for your UI elements to occupy bigger
or smaller proportion of the screen,
As you know, Android 'knows' the density of the platform it sits on
and this gets classified into 1 of 3 brackets.

Since your 2nd tablet has medium screen density, all you have to do,
is to provide a mdpi layout that reflects your desired UI sizes and
proportions.
In other words, simply go and modify your current mdpi layout to make
it 'less empty'.
And don't forget that images used in your layouts have to be scaled as
well in order to achieve the best results.

--
Daniel







>
> --
> 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



-- 
Daniel Drozdzewski

-- 
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


[android-developers] Re: ResourceNotFound occurs sometimes during layout inflation

2010-10-21 Thread Doug Gordon
Yes. It occurred to me at the time that my technique was a bit of a
kludge to avoid writing some additional routines, so I'm going to take
TreKing's suggestion and put it into onCreate.

On Oct 21, 6:55 pm, William Ferguson 
wrote:
> In ActivityA's #onCreate are you invoking super#onCreate before you do
> any other work like starting ActivityB?
>

-- 
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


Re: [android-developers] Google Navigation Intent Filter

2010-10-21 Thread Mark Murphy
On Thu, Oct 21, 2010 at 7:05 PM, DuoCentillion  wrote:
> I would like to launch a background service whenever a user launches
> Google Turn-by-Turn Navigation where the service is aware of the
> parameters (such as destination) of the Navigation Intent.  Does
> anyone have a clue how to create an intent filter to accomplish this
> feat?

Your specific request would be a substantial privacy violation. Your
general request would be a substantial security hole.

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

Android App Developer Books: http://commonsware.com/books

-- 
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


Re: [android-developers] Problem with List View while scrolling

2010-10-21 Thread TreKing
On Mon, Oct 18, 2010 at 3:16 AM, umakantpatil wrote:

> Is there a way to fix this issue?


Sounds like you're a victim of View recycling. How are handing getView in
your adapter?

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

[android-developers] Google Navigation Intent Filter

2010-10-21 Thread DuoCentillion
I would like to launch a background service whenever a user launches
Google Turn-by-Turn Navigation where the service is aware of the
parameters (such as destination) of the Navigation Intent.  Does
anyone have a clue how to create an intent filter to accomplish this
feat?

Thank You 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


[android-developers] Re: Shared Memory

2010-10-21 Thread William Ferguson
You haven't described why need to share data between these 2
applications.
You could create a service that both applications interact with and
make the service responsible for holding the shared data.


On Oct 20, 11:14 pm, chazz  wrote:
> Hi, I am new in android development. i was wondering if i could share
> some data between two applications in android. One way is to place the
> text file on SdCard but i dont want to do this... second way is to
> place in data folder, and i dont know how to 3rd way is to place
> the data in shared memory so both applications can see it... also i
> dont want the user to see or delete this file, only my two
> applications can change this file or data.
> Please help me... i've been wondering on this for 2 days
>
> regards,

-- 
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


[android-developers] Inflate layouts with different density

2010-10-21 Thread Weeds
I'm wondering if it is possible to inflate a layout using a different
density value than the default system density.

I have a high density layout, which looks good on the Galaxy Tab
(1024x600px, hdpi) and I like to use the same layout on another tablet
with the same pixel resolution but medium density. The mdpi layout
which is used works on the device but the screen just looks really
empty and I would prefer to scale things up.

So is there a xml argument for scaling the layout, maybe something
similar to Bitmap.Options.targetDensity.
Or could this be done with a new LayoutInflater class?

Thanks

-- 
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


[android-developers] Re: ResourceNotFound occurs sometimes during layout inflation

2010-10-21 Thread William Ferguson
In ActivityA's #onCreate are you invoking super#onCreate before you do
any other work like starting ActivityB?

On Oct 22, 6:43 am, Doug Gordon  wrote:
>   My app may launch a sub-activity for a specific purpose. When that
> activity finishes, I get the results in onActivityResult. These results
> are then processed in the subsequent onResume. This consists of a
> setContentView and also starting an AsyncTask that puts up a ProgressDialog.
>
> This all works well when initiated the normal way, which is via a user
> request (i.e., menu selection) after the app is up and running. However,
> under some conditions I need to do this right as the app is starting up,
> so I initiate this sequence right from my onCreate. What then happens is
> that I get fatal ResourceNotFound errors within any o/s call that
> implicitly calls the layout inflater. I got around this with
> setContentView by pre-inflating the view in my onCreate method, but the
> AsyncTask's onPreExecute still fails on ProgressDialog.show() as it
> "fails to find" Android's own progress_dialog.xml!
>
> Anyone know what's happening here?
>
> I suspect it's something to do with the timing, where this is occurring
> before the main activity has even had a chance to display its screen.
> These calls are all being made on the main UI thread, but maybe
> something hasn't completed within the o/s under these conditions.
>
>    Doug Gordon
>    GHCS Software

-- 
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


[android-developers] Re: Looking for android dev (2-10 yrs) Bangalore

2010-10-21 Thread William Ferguson
I think he meant 2-10 years old.
Ie somewhere between just out of nappies and no pubes yet.
Child labour, its all the rage in IT these days.

On Oct 22, 8:07 am, Kostya Vasilyev  wrote:
> Is that 10 years of Android experience? :)
>
> --
> Kostya Vasilyev --http://kmansoft.wordpress.com
>
> 22.10.2010 1:32 пользователь "Amit Bihari"  написал:
>
> Please send your resume at saswati.peop...@gmail.com
>
> Location : Bangalore
> Salary : Best in Industry
>
> --
> 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 
> athttp://groups.google.com/group/android-developers?hl=en

-- 
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


Re: [android-developers] Question on Shelves example

2010-10-21 Thread Romain Guy
This was useful before the JIT was added in Android 2.2. It's a bit
faster, though in this particular case it doesn't really matter, I did
it out of habit :)

On Thu, Oct 21, 2010 at 3:45 PM, Prakash Iyer  wrote:
> The reference article on Painless Threading pointed me to the Shelves
> example as a place to understand AsyncTask. So I was reading that example.
> One question popped into my head while I was going thru ShelvesActivity. The
> onPause code calls stopBooksUpdater. That code snippet is as follows,
> private void stopBooksUpdater() {
>         final BooksUpdater booksUpdater = mBooksUpdater;
>         booksUpdater.clear();
>         booksUpdater.stop();
> }
> What's the reason for a local final variable which is manipulated as opposed
> to the member variable? This happens in one more place but in others the
> member variable is directly accessed, e.g. in onResume.
> Thanks!
>
> --
> 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



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

-- 
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


[android-developers] Question on Shelves example

2010-10-21 Thread Prakash Iyer
The reference article on Painless Threading pointed me to the Shelves
example as a place to understand AsyncTask. So I was reading that example.
One question popped into my head while I was going thru ShelvesActivity. The
onPause code calls stopBooksUpdater. That code snippet is as follows,

private void stopBooksUpdater() {
final BooksUpdater booksUpdater = mBooksUpdater;
booksUpdater.clear();
booksUpdater.stop();
}

What's the reason for a local final variable which is manipulated as opposed
to the member variable? This happens in one more place but in others the
member variable is directly accessed, e.g. in onResume.

Thanks!

-- 
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

Re: [android-developers] Why doesn't the screen ever time out with the Android Emulator

2010-10-21 Thread TreKing
On Sat, Oct 16, 2010 at 4:40 PM, pprochamp  wrote:

> How do I accomplish this?
>

Can't you just manually press the power button, or does it have to be on
time out?

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

Re: [android-developers] problem in Importing Packages

2010-10-21 Thread TreKing
On Sun, Oct 17, 2010 at 2:33 PM, Dliswa  wrote:

> IDE give me Error like Can not resolve .
>
> What should i do.
>

You should not try to import a file you don't have access to.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

Re: [android-developers] RelativeLayout and getTextBounds

2010-10-21 Thread TreKing
On Sun, Oct 17, 2010 at 10:45 AM, Sharon  wrote:

> I want to add a RelativeLayout and set its height according to size of a
> font.
>

Why bother measuring the text? If you set the params to wrap_content, it
should just work.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

Re: [android-developers] Switch between profile

2010-10-21 Thread TreKing
On Sat, Oct 16, 2010 at 1:59 PM, Gaurav Gupta <1989.gau...@googlemail.com>wrote:

> Can you please help me how to do this using android SDK.
>

There is no concept of "profiles" in Android, AFAIK. This is something you'd
have to implement yourself. Start here perhaps:
http://developer.android.com/reference/android/provider/Settings.System.html

It would be great if someone can tell me a step by step procedure to do
> that.
>

It would be great, wouldn't it? Unfortunately, you'll have to do your own
work. Sorry.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

[android-developers] Re: Always getting java.lang.VerifyError on 1.6 but fine on 2.1 and 2.2

2010-10-21 Thread fadden
On Oct 20, 11:10 am, DanH  wrote:
> The wrapper class example is defective if the verifier is
> "conventional" -- doesn't have the  swizzle you describe since 1.6.

It works because the code does something like:

  if (version is 2.0 or later)
use wrapped stuff
  else
feature not available, do nothing

The wrapper class would fail verification and not be usable, but
references *to* the wrapped class would be okay.  Verification happens
between loading and initialization.  If class C refers to class D, the
VM needs to be able to load D and examine it, but does not need to
initialize and verify D in order to verify C.  This is still true in
older versions of Android.

-- 
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


Re: [android-developers] Add a third-party to the emulator ?

2010-10-21 Thread Mark Murphy
On Sat, Oct 16, 2010 at 8:18 AM, Ferro Francesco
 wrote:
> i have added that line too in the manifest:
> 

Do not do this. Just put the JAR in your project's libs/ directory. If
you are using Eclipse, also add it to your build path.

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

Android App Developer Books: http://commonsware.com/books

-- 
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


Re: [android-developers] Add a third-party to the emulator ?

2010-10-21 Thread Marcin Orlowski
On 16 October 2010 14:18, Ferro Francesco  wrote:

> it's a .jar that i have added in my project.
[...]
> i have added that line too in the manifest:
> 

this is NOT a shared library and it does not exists
on your device, so error you get is correct. Library
gets linked with your app and is already a part of it.
Remove this from Manifest.

BTW: http://en.wikipedia.org/wiki/Library_(computing)
to get the difference.

-- 
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


Re: [android-developers] Distributing free licenses to paid apps

2010-10-21 Thread Marcin Orlowski
> I'd like to authorize certain people to use my app without buying it.
> Is there a way to do this?  Am I running into issues with my own phone
> because my Google Apps account is not considered a Gmail address?
>
> If I tell them to buy the app, then I immediately issue a refund in
> Google Checkout, will this somehow affect my standing as a developer
> or merchant?  Does it cost me anything to issue a refund?

Unless I miss the point of LVL, issuing refund would cancel license
for the users so they won't be able to use it anywy. Google needs
to add coupons as this is quite common problem with paid apps

-- 
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


Re: [android-developers] Add a third-party to the emulator ?

2010-10-21 Thread TreKing
On Sat, Oct 16, 2010 at 7:18 AM, Ferro Francesco
wrote:

> Is there any solution to that?


The uses-library tag is for using libraries that already exist on the
device, like the Google Maps api. If you want to use a third party Jar in
your project, you add it to your Eclipse project and build against it there,
and that's it. Don't add anything to your manifest for this.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

Re: [android-developers] Android Tablet (2.2) Recommendations for Development

2010-10-21 Thread Marcin Orlowski
On 18 October 2010 01:12, Bertram Moshier  wrote:
> Yet, I'm not willing to use my phone (at this time).

Because?

> I would appreciate Android Tablet recommendations.  I'm not looking
> for those with phones (e.g. 3G/4G), but everything else is fair game.
> I would like it to come with 2.2 (at a minimum it must be upgradeable
> to 2.2).

No need for 3G. Do you plan OpenGL dev? If no, what's wrong with
simulator? It works quite fine for what you plan to do.

-- 
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


Re: [android-developers] ResourceNotFound occurs sometimes during layout inflation

2010-10-21 Thread TreKing
On Thu, Oct 21, 2010 at 3:43 PM, Doug Gordon  wrote:

> Anyone know what's happening here?
>
> I suspect it's something to do with the timing, where this is occurring
> before the main activity has even had a chance to display its screen. These
> calls are all being made on the main UI thread, but maybe something hasn't
> completed within the o/s under these conditions.
>

That's basically it, from what I recall. I forget where I saw it now, but if
you call startActivity right in onCreate, I think the first activity isn't
shown to prevent a flicker effect. Presumably this also means it's resources
and other bits are not initialized. Maybe?

I would put the stuff you need to do in onCreate in a runOnUiThread() call
(perhaps delayed a few milliseconds) and see if that helps.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

Re: [android-developers] [Attn: Moderators] Message not getting posted

2010-10-21 Thread Marcin Orlowski
On 19 October 2010 01:44, Ray  wrote:
> Hello Moderators,
>
> I have been trying to send the message below since yesterday and I
> have tried posting it two times. I am not able to see it getting
> posted to the group. Can you please let me know why?

If you post via gmail web frontend you won't see your own posts.
Didn't bother to find out why and if there's a work around though.

-- 
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


[android-developers] Re: Message not getting posted

2010-10-21 Thread DanH
Because this BBS sucks.  Google has a serious "shoemaker's children"
problem.

On Oct 18, 6:44 pm, Ray  wrote:
> Hello Moderators,
>
> I have been trying to send the message below since yesterday and I
> have tried posting it two times. I am not able to see it getting
> posted to the group. Can you please let me know why?
>
> Thanks,
> -Ray
>
> Posting the following e-mail:
>
> -- Forwarded message --
> From: Ray 
> Date: Mon, Oct 18, 2010 at 1:01 PM
> Subject: App design question for multiple "data" connections
> To: Android Developers 
>
> Hello,
>
> I am working on developing an application that requires me to
> establish multiple client-server based connections. Connection can be
> of two types where the Android device can be a server or a client. I
> can have up to 6 - 8 connections. Once the connections are set-up they
> need to be running in the background and are not typically affected by
> UI actions.
>
> Since each connection can be blocking, I am wondering what is a good
> way to design this app. Should I have two services for handling the
> server and client connections? Each service could have a "connection
> manager" that can spawn new threads when necessary. Or does creating
> two services even help? I presume spawning new processes would not be
> good as they will be expensive.
>
> I would appreciate any suggestions. Also, if this use case is not
> typical please let me know if you need more information to make any
> recommendation.
>
> Thanks,
> -Balaji

-- 
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


Re: [android-developers] Question on versioning and localization of an android app

2010-10-21 Thread Marcin Orlowski
On 19 October 2010 02:34, GIMMESHELTER  wrote:

> So, exact same app but localized for four new locales. How should I
> release it? Version 1.1? Version 1.01?

Does not really matter (and FYI 1 = 01), so it's just cosmetical. Just bump the
revision and that's it. If confused go for 1.1

> Or leave it as 1.0 but call it an upgrade.

You won't be able to release it to Market.

-- 
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


Re: [android-developers] how to get device orientation at runtime

2010-10-21 Thread Mark Murphy
On Tue, Oct 19, 2010 at 1:54 AM, simmy  wrote:
> I have set my deveiec property to landscape in manifest file
> android:screenOrientation="landscape"
>
> No at runtime when I am trying to get the current orientaion of device
> using Configuration and ActivityInfo classes. Its always giving me
> landscape mode even my device is in portrait mode.

Because that is how you configured it. If you do not want it that way,
get rid of the android:screenOrientation attribute.

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

Android App Developer Books: http://commonsware.com/books

-- 
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


Re: 答复: [android-developers] Re: How to connect to a remote MySQL DB without webservices... ?

2010-10-21 Thread DanH
The first thing you should do is write an application on a desktop PC
to do the DB accesses you want (without using interfaces unavailable
on Android).  Work it out there, and then figure out how to map it to
Android.

On Oct 19, 4:58 am, "goodwin"  wrote:
> Hi Kumar
>
> I don’t think google will let people lay any other .jar file , unless you 
> rebuild the source code of android.
>
> /
>
> i will try using sqldroid library to my needs, i will try to connect
> to a remote mysql dabatabase, not sqlite and not local
>
> but im having some problems, plz can someone help me?
>
> - how can i add  sqldroid-0.1.jar  to my project (sorry but i am
> newbie and i can't find nothing about adding this to a project)
>
> - where i have to put these two lines?
> Class.forName("SQLite.JDBCDriver");
> DriverManager.getConnection("jdbc:sqlite:/data/data/your-package/
> db.sqlite");
>
> - in the connection code, wich lines i have to change to connect to my
> remote database? my database is on 81.111.190.170:3306
>
> thanks
>
> On 19 oct, 11:33, Kumar Bibek  wrote:
>
>
>
> > As far as I can imagine, the whole concept of having a library that could
> > connect to a remote DB is not worth for a mobile platform. You are not
> > writing a desktop app anyway, which would require the whole DB with all it's
> > features exposed through a remote DB connection. It too much for a mobile
> > app I would say. Apart from the security issues, if at all you get a direct
> > connection to a remote DB, then there is no point in keeping a local DB,
> > which is bad in various situations (no network connectivity). In case you
> > are having a local DB as well, don't you think it's redundant duplication of
> > data, and also, don't you think that your code will also be more? Well, if
> > you have a webservice over your DB on your servers, you still have to write
> > extra bit of code, but then, you will only deal with functions that the
> > webservice exposes, and thus, you would be handling a subset of all possible
> > situations, if it would have been a direct DB connection.
>
> > Another issue I might think can come up very soon, is that you are looking
> > for a MySQL version library. If at all there are any for Android, I am sure,
> > they are not yet matured enough to use in an enterprise level setup. You
> > might want to change the DB to Oracle, or SQL server, are you sure that
> > these libraries can really handle that well? I personally don't think so.
> > May be in the future, they will be available,
>
> > BUT RIGHT NOW, Use a webservice and SQLite, I would suggest.
>
> > On Tue, Oct 19, 2010 at 2:50 PM, saex  wrote:
> > > i check that library and it's for LOCAL SQLITE databases!
>
> > > i am talking about remote mysql dabatabases, not sqlite and not local
>
> > > greets
>
> > > On 19 oct, 08:36, Miguel Morales  wrote:
> > > > There is nothing implemented into the standard SDK to directly connect
> > > > to a MySQL database.
> > > > Your best bet might be to use something like an external library such
> > > > as:http://code.google.com/p/sqldroid/
> > > > I've never used this myself though.
>
> > > > On Mon, Oct 18, 2010 at 11:29 PM, JonFHancock 
> > > wrote:
> > > > > Not that I'm aware of, but remember that any code executed on a
> > > > > machine you do not control is untrusted.  It would be all too easy for
> > > > > someone to modify your code in a way that can make calls to your db
> > > > > that corrupt the db.
>
> > > > > Making a php or java server-side application that you can just send
> > > > > http post data to is way too easy to justify the risk.
>
> > > > > On Oct 18, 2:29 pm, saex  wrote:
> > > > >> Hi
>
> > > > >> can i do it? I just wanna make SELECT/INSERT into a remote database
> > > > >> with my android phone application, i think it have to be easy but i
> > > > >> can't find the way. I only find people that tell i have to make a
> > > > >> webservice os romething like that, but that is another world for me,
> > > > >> and i can't put a webservice in the database host...
>
> > > > >> ¿there is not a normal way to do it without a webservice?
>
> > > > >> thanks
>
> > > > > --
> > > > > 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
>
> > > > --
> > > > ~ Jeremiah:9:23-24
> > > > Android 2D MMORPG:
> > >http://developingthedream.blogspot.com/,http://www.youtube.com/user/r...
>
> > > --
> > > 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@googlegro

Re: [android-developers] MapView in android emulator white screen

2010-10-21 Thread Mark Murphy
Test the Maps application on the emulator. If that fails, you have a
problem accessing the maps server. If that works, then check LogCat
for error messages (use adb logcat, DDMS, or the DDMS perspective in
Eclipse).

On Tue, Oct 19, 2010 at 1:04 PM, jamz_mar...@yahoo.co.jp
 wrote:
> Hi Android Developers,
>
> I tried to use map view to load google map, i have generated the
> keystore, and put in the mapview, below is my MapView, and also I have
> changed the Custom debug keystore equal to default debug keystore but
> still showing me a empty screen. please advise which on i am wrong. I
> use google api 2.2
>
>          android:layout_width="fill_parent"
>        android:layout_height="fill_parent"
>        android:enabled="true"
>        android:clickable="true"
>        android:apiKey="07WVUg-srWUbhpkGj1mi0w56xD9nMEu0NhqJeYg"
>        />
>
> Thanks,
> James
>
> --
> 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
>



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

Android App Developer Books: http://commonsware.com/books

-- 
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


Re: [android-developers] Looking for android dev (2-10 yrs) Bangalore

2010-10-21 Thread Kostya Vasilyev
Is that 10 years of Android experience? :)

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

22.10.2010 1:32 пользователь "Amit Bihari"  написал:

Please send your resume at saswati.peop...@gmail.com

Location : Bangalore
Salary : Best in Industry

--
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

-- 
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

Re: [android-developers] re-prompt user to choose default activity

2010-10-21 Thread Mark Murphy
On Tue, Oct 19, 2010 at 2:35 PM, BigTocSoob  wrote:
> is there a way to re-prompt the user to choose a default activity for
> an intent? For example, user selects his default home apk and I want
> him to reconsider his choice once again.
>
> I know how to do that on 2.1 and before, but is there a way to do that
> now on 2.2?

Only if yours was the current default activity. Then you can call
clearPackagePreferredActivities() to wipe out all of your activities
from being defaults.

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

Android App Developer Books: http://commonsware.com/books

-- 
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


Re: [android-developers] Multiple layout xml files for one activity

2010-10-21 Thread Marcin Orlowski
> Also, how do you handle the activity configuration in the onCreate?

http://www.curious-creature.org/2009/02/25/android-layout-trick-2-include-to-reuse/

and google for more

-- 
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


Re: [android-developers] Re: How to use appt --rename-manifest-package during ant build?

2010-10-21 Thread Steve Novack
Thanks -- I've come to the same conclusion.  I was too quick to try out the
library project when it was first released and stopped using it due to too
many problems.  But, it looks like the current support is pretty good, so I
will switch back to it.

Cheers,
Steve


On Sun, Oct 17, 2010 at 6:04 PM, miniondev  wrote:

> The ant rules in the latest version of the sdk tools seems to have
> disallowed the usage of this.  I believe the method that you're
> intended to use for producing two versions of the same app is an
> android library project.  The idea being that you put nearly all of
> your application code in a library project and include that library
> project from two different application projects; one for the free
> version, one for the paid version.  Each of these application projects
> need only contain the bare minimum of code required to differentiate
> the free from the paid version.
>
> Note that the latest version of the sdk tools also allow android
> library projects that depend on other library projects, so even if
> your library project containing the bulk of your app code has another
> dependency (such as the license verification code), you're good to go.
>
> That's how i've done it for my app anyway.
>
> On Oct 17, 1:02 pm, Flying Coder  wrote:
> > I have an app with both a free & paid version.  I have been using appt
> > --rename-manifest-package from the command line to rename the package
> > from one version to another.  But, I would like to using ant to do
> > builds.
> >
> > Anyone know how to use the rename-manifest-package option in an ant
> > build?  Sorry if this is a stupid question, but I am a complete novice
> > when it comes to ant.
> >
> > Thanks a bunch!
> >
> > Steve
>
> --
> 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




-- 
www.appventive.com

-- 
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

Re: [android-developers] service that log all events

2010-10-21 Thread Mark Murphy
On Tue, Oct 19, 2010 at 12:41 PM, J. Siedentopp
 wrote:
> I need to make a service that capture all events, not in a specific
> view or when an specific activity is open.
> I want to make a App for Usability-Testing. Therefor i need to log
> every Event the User does. I tried to do this with an App-Launcher. To
> log the Touch Events i used "onInterceptTouchEvent()" in a extended
> FrameLayout. So i can log every touch event in my App. Thats works
> fine. Now i launch a App witch "mainAct.startActivity(intent);" the
> secound App launches but i can't log a Event.
>
> I knows that Android launches every Activity in a separate Task and i
> also knows that this App sounds like a Virus, but it is for the Labor
> of my University and not for "bad things".
>
> Can I do this?

By modifying the firmware, yes. Via the SDK, I hope not -- anything
that leaks this information is a possible security hole.

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

Android App Developer Books: http://commonsware.com/books

-- 
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


Re: [android-developers] Shared Memory

2010-10-21 Thread Mark Murphy
On Wed, Oct 20, 2010 at 9:14 AM, chazz  wrote:
> Hi, I am new in android development. i was wondering if i could share
> some data between two applications in android. One way is to place the
> text file on SdCard but i dont want to do this... second way is to
> place in data folder, and i dont know how to 3rd way is to place
> the data in shared memory so both applications can see it... also i
> dont want the user to see or delete this file, only my two
> applications can change this file or data.
> Please help me... i've been wondering on this for 2 days

First, users who root their devices can "see or delete" any files.

Second, there is no shared memory construct available in the Android
SDK that I can think of.

If these two apps are both written by you, you can use
android:sharedUserId in the manifest and sign them with the same
signing key. Then they will have read/write access to each other's
app-local file store (the /data/data/your.package.name/files spot).

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

Android App Developer Books: http://commonsware.com/books

-- 
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


Re: [android-developers] Viewflipper issue

2010-10-21 Thread Mark Murphy
You cannot safely modify the UI from a non-UI thread. Be sure to call
showNext() on the main application thread. For example, if you are
using AsyncTask, you could use publishProgress() and
onProgressUpdate() for your showNext() calls.

On Wed, Oct 20, 2010 at 4:40 AM, Ouael Mouelhi  wrote:
> Hi all,
>
> I have an issue with a view flipper.
>
> When I test my flipper in a separate application (activity), showNext
> and show previous work fine.
> But the issue is when the code is executed in a thread, the call of
> showNext() methods blocks and there's no error message.
> In fact I want to flip the view every time a step of my thread code is
> executed.
>
> Does someone knows how can I resolve this ?
>
> Thank you.
>
> --
> 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
>



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

Android App Developer Books: http://commonsware.com/books

-- 
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


[android-developers] Need help with an app with a lot of videos

2010-10-21 Thread Greg W
I'm writing an application that contains a lot of videos (~ 600 Mb).
Obviously, this is too much to store in the device's application space
and these videos need to be stored on the device's sdcard.  However,
I'm trying to decide what is the best way to do this.

I could put the videos on a web server and let the user download them
as he views them or in the background as he's watching other videos.
But ideally I'd like for the videos to be included in the application
download from the market.  I'm not even sure if that's possible.

One option would be to store the entire application on the sdcard,
videos and all, but that would make the application only work on
Android 2.2 and higher.

Is there a way to specify resources in your Android project that will
not be stored in the application space but instead stored on the
sdcard?

-- 
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


[android-developers] why the audio file recorded through simulator is slower than input

2010-10-21 Thread cindy
Hi,

I am using following code to record Audio:

mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);

mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.setOutputFile(Common.speechFile.getAbsolutePath());
mRecorder.setMaxDuration(15000);
mRecorder.setOnInfoListener(new
MediaInforListener(activity));
mRecorder.prepare();
mRecorder.start();

The Audio file record is slower than really input.

The same code works fine on really phone.

Does anyone has same experience? Or I miss some parameters?

Thanks!

Cindy

-- 
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


[android-developers] Re: Type Conversion to Dalvik format failed: Unable to execute dex: null

2010-10-21 Thread DanH
This is a failure on build, right, not a failure of the installed app
or a failure to install?

Have you tried building a "toy" app, to verify that your development
setup hasn't gotten corrupted?

On Oct 21, 5:29 am, shuchi  wrote:
> I am trying to create an Android maps project. Everything was working
> fine until i added Salesforce classes into it. Now it doesn't even
> compile. It gives me: Type Conversion to Dalvik format failed: Unable
> to execute dex: null error.
>
> I tried
> 1) Increasing memory in the .ini file. That didn't help.
> 2) Project -> Clean option. It cleans, builds again and then gives me
> the same error.
>
> I am using Snow Leopard and i have the latest version of Android on my
> system. I just installed it last week. Plus, my eclipse is Ganymede. I
> even tried it with Galileo.
>
> Nothing seems to work. Did anyone face similar issues?
> Any help will be highly appreciated.
>
> Regards
> Shuchi

-- 
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


Re: [android-developers] Using or not the Google Maps external library

2010-10-21 Thread Mark Murphy
On Wed, Oct 20, 2010 at 5:16 AM, horatzica  wrote:
> My second one: Is there a nicer way to address this issue other than
> have 2 builds/apks, one that uses the library, with  android:name="com.google.android.maps" /> added in the manifest, and
> the other one, without the use of the library?

There is an undocumented android:required attribute on .
If you set that to false, it should allow your app to load even if the
Maps are not available. You would use Class.forName() or something to
determine if you have Maps capability, so you could disable the UI
that leads to a map (e.g., disable a menu option).

As I mention, this is undocumented, and ordinarily I don't encourage
that. However, Dianne Hackborn (Google engineer) is the one who
pointed it out, and I consider her to be a veritable extension to the
docs... :-)

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

Android App Developer Books: http://commonsware.com/books

-- 
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


Re: [android-developers] Remove TTS for test

2010-10-21 Thread Marcin Orlowski
On 21 October 2010 10:37, Fred J  wrote:
> Hello All !
>
> I would like to test my code which check the availability of the Text
> To Speech lib on the device before using it. For this I need to remove
> the TTS service which is already installed on my device (HTC Legend).
> Do you know how to do this ? (I only found to stop the service not to
> remove it) ...

Root your device

-- 
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


Re: [android-developers] Using Hide

2010-10-21 Thread Mark Murphy
On Wed, Oct 20, 2010 at 12:09 PM, Artem Kalachev  wrote:
> I want to use tag hide (@hide) for hiding some api in my code (add-on
> for sdk).
> Is it possibly to do that?

I believe this is a custom annotation used by the tools that create
the Android SDK. AFAIK, this is not a standard feature of Java.

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

Android App Developer Books: http://commonsware.com/books

-- 
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


Re: [android-developers] Query audio and video codecs

2010-10-21 Thread Mark Murphy
On Wed, Oct 20, 2010 at 12:52 PM, Simon MacDonald
 wrote:
> This may be a very dumb question but is there anyway to determine
> programatically through the API the data that is in the table:
>
> http://developer.android.com/guide/appendix/media-formats.html

Not that I know of -- sorry!

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

Android App Developer Books: http://commonsware.com/books

-- 
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


Re: [android-developers] Android ListView Large Number Of Items Best Practices

2010-10-21 Thread Mark Murphy
On Wed, Oct 20, 2010 at 10:09 PM, Aaron  wrote:
> I am working with a ListView, custom adapter and a large number of
> items.  I read in a book for Android that is was more efficient to use
> what it called the holder pattern.  That is to create a wrapper class
> for each view in the list view that cached the objects in the view so
> as to avoid calls to findViewById because those are supposed to be
> expensive.  Well anyway I tried this and I saw a lot, I mean, A LOT of
> garbage collection happening.  This is obviously no real surprise.

It's surprising to me. Part of the point is to avoid allocations.

> My
> question is what is better?  To have 50,000 objects GC'd every time
> the user scrolls or to make the 4 or five calls to findViewById per
> view?

The better answer is "neither".

> Below is my implementation of what the book suggested.
>
>       �...@override
>        public View getView(int position, View convertView, ViewGroup parent)
> {
>                View view = convertView;
>                if (view == null) {
>                        final LayoutInflater inflater = (LayoutInflater)
> context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
>                        view = inflater.inflate(R.layout.survey_item, null);
>                        view.setTag(new SurveyItemWrapper(view));
>                }
>                bindView((SurveyItemWrapper) view.getTag(), position);
>                return view;
>        }
>
>        private void bindView(SurveyItemWrapper surveyItemWrapper, int
> position) {
>                final SurveyedItem surveyedItem = surveyedItems.get(position);
>
> surveyItemWrapper.getDescription().setText(surveyedItem.getItemName());
>                surveyItemWrapper.getCube().setText(String.format("%9.2f",
> surveyedItem.getCube()));
>                surveyItemWrapper.getShipping().setText(String.format("%d",
> surveyedItem.getShipping()));
>                surveyItemWrapper.getNotShipping().setText(String.format("%d",
> surveyedItem.getNotShipping()));
>        }
>
>
>        private class SurveyItemWrapper {
>
>                private TextView description;
>                private TextView cube;
>                private TextView shipping;
>                private TextView notShipping;
>                private View view;
>
>                public SurveyItemWrapper(View view) {
>                        this.view = view;
>                }
>
>                public TextView getDescription() {
>                        if (description == null) {
>                                description = (TextView)
> view.findViewById(R.id.SurveyItemDescription);
>                        }
>                        return description;
>                }
>
>                public TextView getCube() {
>                        if (cube == null) {
>                                cube = (TextView) 
> view.findViewById(R.id.SurveyItemCube);
>                        }
>                        return cube;
>                }
>
>                public TextView getShipping() {
>                        if (shipping == null) {
>                                shipping = (TextView) 
> view.findViewById(R.id.SurveyItemShipping);
>                        }
>                        return shipping;
>                }
>
>                public TextView getNotShipping() {
>                        if (notShipping == null) {
>                                notShipping = (TextView)
> view.findViewById(R.id.SurveyItemNotShipping);
>                        }
>                        return notShipping;
>                }
>
>        }

I strongly suspect that your GC problem is in String.format(), not in
the findViewById() caching. There are no allocations being done in the
row recycling case, other than simple setText() calls and
String.format() (plus anything that might be in your model getters).

FWIW, the next edition of the book you have will use a simpler holder class.

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

Android App Developer Books: http://commonsware.com/books

-- 
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


[android-developers] Creating a listActivity with a button on the bottom

2010-10-21 Thread Gabriel Huie
Hi so I just posted this recently Iono if it got deleted but sorry if
this is a repost
basically im trying to create a list and have a button at the bottom
of the screen stay there through the whole app. Basically i tried to
do a merge but that made it so theres a button for each object in the
list? but i just want one standard button on the bottom that doesnt
move.

-- 
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


Re: [android-developers] Catching "button" behavior

2010-10-21 Thread Kostya Vasilyev
Sure, there is a better way: use a button with a custom background, which
should be a state-based drawable, pointing to individual images for various
states: default, selected, disabled, etc...

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

22.10.2010 1:36 пользователь "Bill C"  написал:

I need to specify the full button images for both the up and down
positions.  My impression is that the most probable choice is to use
an custom button based on the ImageView and specify the image for up
and down positions.  I am using the OnTouchEvent method to capture the
ACTION_DOWN, but I'm not getting the ACTION_UP event.

Is there a better choice for creating a button that controls the full
button image, catches the Down/Up and can subdivide the down time into
time slices?  If not, how do I catch the up event.

My application expects a screen touch on the "button" and not a
keyboard action.

Thx,
Bill

--
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

-- 
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

Re: [android-developers] Install-time Extraction of .apk files

2010-10-21 Thread Mark Murphy
FWIW, that approach scares the bejeezus out of me. That is so
undocumented and implementation-dependent that I wouldn't touch it
with a 10-meter pole.

On Thu, Oct 21, 2010 at 11:10 AM, Jonathan Pryor  wrote:
> I'm writing an application and would like to have some files extracted
> from the .apk during _installation_ time, as the files can be quite
> large and extracting them from the .apk during the first run results in
> a noticeable slowdown which I would prefer to avoid.
>
> After lots of experimentation, I have found one way to make this work,
> but I'm unsure about the "long-term" ramifications of this approach,
> specifically: will this actually work in android-9 and later?
>
> The approach is to name the files I want extracted at installation time
> as "lib*.so", and place them into the appropriate lib/ABI folder within
> the apk file, e.g. the .apk contains:
>
>        lib/armeabi/libMyLargeFile.dat.so
>
> and at installation time this is (nicely) installed as:
>
>        $APPDIR/lib/libMyLargeFile.dat.so
>
> My concern is that 'libMyLargeFile.dat.so' is NOT an ELF shared library.
> This approach only works because PackageManagerService only checks for
> files matching the `lib/ABI/lib*.so` pattern (which is followed) and
> does not check the contents of the extracted file.
>
> This approach works for Android 1.6 through Android 2.2.  I'm wondering
> if this will continue to work in the future, or if I need to investigate
> an alternate mechanism.

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

Android App Developer Books: http://commonsware.com/books

-- 
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


Re: [android-developers] How to handle frequent database upgrades

2010-10-21 Thread Kostya Vasilyev
Database version code is independent of application version code.

As for upgrading, you SqlOpenHelper.onUpgrade is passed both old (existing)
and new (desired) version codes, so it knows just what columns to add.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

22.10.2010 1:36 пользователь "Fabio"  написал:

Hi, here is my doubt:

Time 1)
Application version code 1 and database version 1: creates database
structure. Published without errors.

Time 2)
Application version code 2 and database version 2: some ALTER TABLE
(added some columns). Published without errors, and application
upgrades without errors.

Time 3) very close to Time 2)
Application version code 3 and database version 3: some other ALTER
TABLE (added columns).

If I publish version 3, what does it happen to a user that did not
upgrade from version 1 to version 2? What happens to their database?
In other words, is there a way the market has to keep track of the
application versions and install the right version for the specific
user? If not, how can I know if all my "version 1 users" had already
upgraded to version 2?

Thanks in advance,

Fabio

--
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

-- 
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

Re: [android-developers] Set button's coordinates in AbsoluteLayout

2010-10-21 Thread Kostya Vasilyev
AbsoluteLayout is deprecated. You should take a look at RelativeLayout.

To set absolute position, use RelativeLayout.LayoutParams with
setLayoutParameters.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

22.10.2010 1:36 пользователь "Mike Wasawsky" 
написал:

Hello.
Can you help me with this?
I'm making a android aplication, and I need creates buttons in the
java files because the amount of buttons is variable and the
coordinate of each button too. So, I don't know how set the
coordinates x,y in java. Do you know what method i can use to set this
values?

Thanks for your answers.

PD: Sorry my english. I hope that you can help me

--
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

-- 
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

Re: [android-developers] My apps aren't listed

2010-10-21 Thread TreKing
On Mon, Oct 18, 2010 at 5:01 AM, Ray  wrote:

> Hello, if you search for  pub:"Moorhen Apps"  only 4 apps are listed,
> however I have released 20, all of which were available 3 days ago.
> None of the hard links work anymore. Any ideas?
>

I found 20 searching for "Moorhen" on Nexus with 2.2 in the US.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

Re: [android-developers] google API with android

2010-10-21 Thread TreKing
On Sun, Oct 17, 2010 at 6:54 PM, skyline  wrote:

> please share this with me if you have some experience with this,


http://www.catb.org/esr/faqs/smart-questions.html

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

[android-developers] Re: How to develop an mp3 player on android platform

2010-10-21 Thread Dimitris
Read and study how MP3s work and how to read them. There is an MP3
header which consists of info about the song (like IDv3 etc) and it is
followed by a bunch of MP3 frames.

That should give u a good start.

On Oct 20, 7:17 pm, zamesking  wrote:
> Hi,
>
> I am just getting into android development, can anyone guide me how I
> can write an mp3 player?

-- 
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


Re: [android-developers] How to work System.out.println log in Android

2010-10-21 Thread TreKing
On Mon, Oct 18, 2010 at 3:35 AM, munhoney  wrote:

> Could you tell me how adb logcat print the (I/System.out(xxx):)  just once
> time?
>

http://developer.android.com/reference/android/util/Log.html

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

Re: [android-developers] AppWidget + Custom Views

2010-10-21 Thread Kostya Vasilyev
Only a subset of Android view classes can be used in a widget (supported by
RemoteViews). I believe the list is somewhere in widgets chapter in the
development guide. That subset is fixed, you can't extend it by adding your
own views.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

22.10.2010 1:36 пользователь "sergio"  написал:

Hi all.

I have built an empty custom view as follows:

public class MyView extends View {

   public MyView(Context context, AttributeSet attrs) {
   super(context, attrs);
   }

   @Override
   protected void onDraw(Canvas canvas) {
   super.onDraw(canvas);
   }
}

I would like to use my custom view to create a home application widget
(i.e. a class extending AppWidgetProvider), which will ultimately
consist of some buttons, a text field and my custom view.

In the main layout of my app I call it as follows, i.e.

   

but when placing the widget on the home screen I get the following
error:

Error inflating AppWidget
AppWidgetProviderInfo(provider=ComponentInfo{com.example.widget/
com.example.widget.MyWidget}

Could anyone shed some light on this?

Cheers,

SegioL

--
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

-- 
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

Re: [android-developers] Application still Running After Exit

2010-10-21 Thread TreKing
On Sun, Oct 17, 2010 at 8:09 PM, rsnider19  wrote:

> I notice that my application continues to run in the background after I hit
> the home or back button.
>

Hitting Home will only pause then stop your application, not finish it
(unless it's hidden long enough).
Regardless, Android will keep your process alive as long as it wants in case
the user comes back to it, so it doesn't have to recreate everything from
scratch.


> I tried calling the finish() method and it still says its running.
>

finish() ends your current Activity, it doesn't terminate the process it's
running in.


> On another note, how do I setup the keyListener to respond to the user
> hitting the back or home button.
>

You can handle the back key but not the Home key. There's a new
onBackKeyPressed function (I think, look for it) you can use for this.


> I tried implementing OnKeyListener and using
> findViewById(R.Layout.main).setOnKeyListener(this) to call finish().
>

Calling finish() on the back key press is the default behavior so there's
zero reason to do this.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

[android-developers] Install-time Extraction of .apk files

2010-10-21 Thread Jonathan Pryor
I'm writing an application and would like to have some files extracted
from the .apk during _installation_ time, as the files can be quite
large and extracting them from the .apk during the first run results in
a noticeable slowdown which I would prefer to avoid.

After lots of experimentation, I have found one way to make this work,
but I'm unsure about the "long-term" ramifications of this approach,
specifically: will this actually work in android-9 and later?

The approach is to name the files I want extracted at installation time
as "lib*.so", and place them into the appropriate lib/ABI folder within
the apk file, e.g. the .apk contains:

lib/armeabi/libMyLargeFile.dat.so

and at installation time this is (nicely) installed as:

$APPDIR/lib/libMyLargeFile.dat.so

My concern is that 'libMyLargeFile.dat.so' is NOT an ELF shared library.
This approach only works because PackageManagerService only checks for
files matching the `lib/ABI/lib*.so` pattern (which is followed) and
does not check the contents of the extracted file.

This approach works for Android 1.6 through Android 2.2.  I'm wondering
if this will continue to work in the future, or if I need to investigate
an alternate mechanism.

Thanks,

 - Jon

P.S. On a related note, I did see android.app.backup.BackupAgent, which
says "Restore operations are typically performed only when applications
are first installed on a device."  Unfortunately, this type is only
supported in Android 2.2, and even when I
specify /manifest/application/@android:backupAgent my BackupAgent isn't
ever instantiated, never mind "when...first installed on a device," so
the docs appear to be misleading or I'm missing some other crucial
undocumented step.


-- 
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


[android-developers] My tracks navigation overlay?

2010-10-21 Thread dweinand
Hello,

can somebody point me to the right direction how the navigation
overlays for My Tracks are implemented? I'm talking about the
"buttons" for navigating appearing on the left and right side if you
tap on the screen. Any pointers?

thx a lot

-- 
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


[android-developers] How to develop an mp3 player on android platform

2010-10-21 Thread zamesking
Hi,

I am just getting into android development, can anyone guide me how I
can write an mp3 player?

-- 
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


[android-developers] setResult of an activity

2010-10-21 Thread Josyula Gayathri Devi
Hi,

For example i hav some 3 activities.. activity 1 is the main screen
and iam in activity 2.. another activity is started by handler and the
result of activity3 ahould go bak to activity 1.. but since 2 is on
top of stack, activity 1 is not getting the result of 3... how to
solve this

-- 
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


[android-developers] AppWidget + Custom Views

2010-10-21 Thread sergio
Hi all.

I have built an empty custom view as follows:

public class MyView extends View {

public MyView(Context context, AttributeSet attrs) {
super(context, attrs);
}

@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
}
}

I would like to use my custom view to create a home application widget
(i.e. a class extending AppWidgetProvider), which will ultimately
consist of some buttons, a text field and my custom view.

In the main layout of my app I call it as follows, i.e.



but when placing the widget on the home screen I get the following
error:

Error inflating AppWidget
AppWidgetProviderInfo(provider=ComponentInfo{com.example.widget/
com.example.widget.MyWidget}

Could anyone shed some light on this?

Cheers,

SegioL

-- 
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


[android-developers] Send a bookmarkable link via MMS

2010-10-21 Thread cranz
Hi!

I've had a hunt around through various forums and dev guides for
Android, and I'm fairly sure this is not possible but it never hurts
to ask!

I know you can send a link to a web page via MMS, but is it possible
on Android to bookmark the link automatically if the user clicks the
link?

i.e
User receives a MMS with a link to example.com and a link saying
"Bookmark now!"
User clicks "Bookmark now!" and a bookmark is created in the browser
(or on the home screen)

I'm fairly certain this behavior would be allowed, but does anyone
know for sure?

Thanks,
Cranz

-- 
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


[android-developers] How could I get raw touch screen data

2010-10-21 Thread askzy
RT
Actually I wanna detect the shape of touch point, i.e. the shape of
finger touch on the screen

Seems that the only information I can get in touch event is the size
of the touch point(by event.getSize())

By the implementation of the screen,
the shape(and pressure of each point in the shape) of the touching
finger should be the first raw data that the hardware can detect

So, how could I get these raw data?

thx very much for any help~~

-- 
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


  1   2   3   4   >