[android-developers] Re: Confused about Timezones and Sqlite3

2010-08-09 Thread Sarwar Erfan
Hi,
Conversion is a Java question, not related to Android though.

Anyways, here is a catch --- in Java, the date is ALWAYS stored as UTC
in "Date" object. You CANNOT convert its timezone (stored value will
be always in UTC).
However, you can print it in different timezones, that is here
formatters come in.

EXAMPLE:
//
String dateStr = "8-8-2010 11:00 AM EST";
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-
hh:mm a zzz");
try {
Date d = formatter.parse(dateStr);
System.out.println(d.toGMTString());

} catch (Exception e) {
e.printStackTrace();
}
//==


Now, System.out.println(d.toGMTString()); --- this will output:
8 Aug 2010 16:00:00 GMT
Which is correct (as I came to know that EST is GMT-5)


If you want to do some more on date and time in Java, then you better
ask in Java language related groups.


Regards
Sarwar Erfan



On Aug 10, 10:25 am, Bara  wrote:
> Ahh, that makes a lot more sense.
>
> Now, when you say "always use UTC" (which makes more sense to me), how
> exactly would I convert a time to a different timezone?  In my
> original question I asked "How would I go about converting a string
> like "8-8-2010
> 11:00 AM EST" into the proper format for sqlite3?"  Can you provide
> some sample code or a page that would show how to do this?
>
> I come from a .NET background and usually dealing with datetime stuff
> is simple, so excuse me for asking so many questions :)
>
> Bara

-- 
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: Yet another Droid OpenGL texture problem

2010-08-09 Thread Mike
Well that wasn't it but you were on the right path. It is something to
do with my texture selection. I took a break down at the local pub and
after a few beers I saw much clearer. :)

I'll post an update sometime tomorrow after I get everything nailed
down completely. Thanks everyone for the help.


On Aug 9, 11:47 pm, Robert Green  wrote:
> Heh, I think I see your problem.
>
> Replace  this.textureMap.put(new Integer(textureFiles[i]), new
> Integer(i));
> With  this.textureMap.put(new Integer(textureFiles[i]), new
> Integer(tmp_tex[i]));
>
> Droids don't number textures incrementally like qualcomms do.  It was
> working because your texture ids happened to align with i.
>
> On Aug 9, 11:35 pm, Nightwolf  wrote:
>
>
>
> > Why do you set GL_TEXTURE_MIN_FILTER twice? Replace one of the calls
> > with GL_TEXTURE_MAG_FILTER.
>
> > On Aug 10, 5:22 am, Mike  wrote:
>
> > > Welp, I did even better. I went out and bought a Droid from
> > > Craigslist.
>
> > > I logged the height and width of the bitmaps at each of the mipmap
> > > levels and here's the output:
>
> > > DEBUG/Texture(1558): Texture image loaded at 256 x 256
> > > DEBUG/MMTexture(1558): Texture image loaded at 128 x 128
> > > DEBUG/MMTexture(1558): Texture image loaded at 64 x 64
> > > DEBUG/MMTexture(1558): Texture image loaded at 32 x 32
> > > DEBUG/MMTexture(1558): Texture image loaded at 16 x 16
> > > DEBUG/MMTexture(1558): Texture image loaded at 8 x 8
> > > DEBUG/MMTexture(1558): Texture image loaded at 4 x 4
> > > DEBUG/MMTexture(1558): Texture image loaded at 2 x 2
> > > DEBUG/MMTexture(1558): Texture image loaded at 1 x 1
>
> > > So, if it's not the size that's the problem, something with the format
> > > of the bitmaps themselves? Well at least now I have a phone to test
> > > on.
>
> > > On Aug 9, 7:35 pm, String  wrote:
>
> > > > Can I suggest you stick a Log call in with your actual loaded texture
> > > > sizes? Something like the following:
>
> > > >     Log.i(TAG, "Texture image loaded at " + mapImage.getWidth() + " x
> > > > " + mapImage.getHeight());
>
> > > > Then get one of the Droid/Milestone users to shoot you a logcat
> > > > output... xda-devs folks ought to be able to handle that. That'll at
> > > > least tell you if the images are loading at the size you expect, or if
> > > > it's a different problem.
>
> > > > String
>
> > > > On Aug 9, 10:11 pm, Mike  wrote:
>
> > > > > I am. That's what's so perplexing.
>
> > > > > On Aug 9, 3:56 pm, Tom  wrote:
>
> > > > > > Make sure that you are loading your textures from the drawable-nodpi
> > > > > > resource 
> > > > > > directory:http://www.anddev.org/opengl_textures_-_motorola_droid-t10930.html
>
> > > > > > On Aug 9, 1:07 pm, Mike  wrote:
>
> > > > > > > I'm getting white (blank) textures on everything when running on 
> > > > > > > the
> > > > > > > Droid and Galaxy S devices.
> > > > > > > My textures are all power-of-two PNGs and they're in the 
> > > > > > > /res/drawable-
> > > > > > > nodpi folder.
>
> > > > > > > Here's my code:
>
> > > > > > > public GLTextures(GL10 gl, Context context) {
> > > > > > >                 if(gl==null)return;
> > > > > > >                 this.gl = gl;
> > > > > > >                 this.context = context;
> > > > > > >                 this.textureMap = new java.util.HashMap > > > > > > Integer>();
> > > > > > >                 sBitmapOptions.inPreferredConfig = 
> > > > > > > Bitmap.Config.RGB_565;
>
> > > > > > >         }
>
> > > > > > >         public void freeTexs(){
> > > > > > >                 gl.glDeleteTextures(textures.length, textures,0);
> > > > > > >                 textureFiles = null;
> > > > > > >         }
>
> > > > > > >         public void loadTextures() {
> > > > > > >                 if(gl==null)return;
> > > > > > >                 int[] tmp_tex = new int[textureFiles.length];
> > > > > > >                 gl.glGenTextures(textureFiles.length, tmp_tex, 0);
> > > > > > >                 textures = tmp_tex;
> > > > > > >                 for (int i = 0; i < textureFiles.length; i++) {
>
> > > > > > >                         this.textureMap.put(new 
> > > > > > > Integer(textureFiles[i]), new Integer(i));
> > > > > > >                         int tex = tmp_tex[i];
>
> > > > > > >             gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);
> > > > > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > > > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
> > > > > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > > > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST);
>
> > > > > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > > > > GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
> > > > > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > > > > GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
> > > > > > >             gl.glTexEnvf(GL10.GL_TEXTURE_ENV,
> > > > > > > GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE);
>
> > > > > > >             InputStream is =
> > > > > > > context.getResources().

[android-developers] Re: Monkey Test

2010-08-09 Thread KVR
Thanks Naseer
Is there any option for excluding ??

On Aug 9, 10:27 pm, Naseer  wrote:
> Exclude packages on an all packages run instead of including so many.
>
> On Aug 9, 2:09 pm, KVR  wrote:
>
> > Hi All,
> > I want to include about 40 packages in monkey command.But when I tried
> > to include 40 packages using -p option, adb shell returned me "Service
> > name too long " error .This seems to be limitation of adb shell. Is
> > there any way to  overcome this??
>
> > Thanks&Regards
> > KVR

-- 
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 know the home launcher app packagename through programming?

2010-08-09 Thread manoj
I am getting the correct result if I have the only one home app
(default home) is installed. If i have more than 1 home apps, I am
getting the result w.r.t ResolveActivity. Now how can I resolve this?

say, for example,
1. Android Home (action=MAIN, cat=LAUNCHER,HOME...etc).
2. MyHome(action=MAIN, cat = LAUNCHER,HOME...etc).

current home set is MyHome.

Now If I follow the above code, the result displayed is
ResolverActivity. Now how can I resolve this.

Thanks,
Manoj.

manoj wrote:
> I mean the package name of the launcher. finally got it.
>
> ActivityInfo ai = ri.activityInfo;
> ai.packageName will give the package name.
>
> Thanks for the help.
>
> On Aug 8, 7:11 pm, Mark Murphy  wrote:
> > Please define "didn't get the result".
> >
> >
> >
> >
> >
> > On Sun, Aug 8, 2010 at 9:57 AM, manoj  wrote:
> > > Hi Mark,
> >
> > > could you please alobrate it? I have used the following code. but
> > > didn't get the result.
> >
> > > Intent i = new Intent();
> > >        i.setAction(Intent.ACTION_MAIN);
> > >        i.addCategory(Intent.CATEGORY_HOME);
> > >        PackageManager pm = this.getPackageManager();
> > >        ResolveInfo ri = pm.resolveActivity(i, 0);
> > >        System.out.print("HOME PKG NAME + "+ri.resolvePackageName);
> >
> > > Could you please tell me?
> >
> > > On Aug 7, 10:22 pm, Mark Murphy  wrote:
> > >> Create an Intent that brings up the HOME screen, then use
> > >> PackageManager and resolveActivity().
> >
> > >> On Sat, Aug 7, 2010 at 9:40 AM, manoj  wrote:
> > >> > Hi all,
> >
> > >> > I have a some strange issue. I would like to get the package name of
> > >> > the current home screen.
> >
> > >> > lets say we have two home screens : 1. default android home theme
> > >> >                                                       2. 3rd party
> > >> > home theme.
> >
> > >> > Assume both are installed and current home theme is 3rd party home
> > >> > theme.
> >
> > >> > Now I would like to get the package package name of the current home
> > >> > theme (3rd party). Is there any api which can give the current home
> > >> > screen package name?
> >
> > >> > I can get the package name in ddms. But I want it programmatically.
> >
> > >> > Regards,
> > >> > Manoj.
> >
> > >> > --
> > >> > 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/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
> >
> > >> _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
> > >> Available!- 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
> >
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
> >
> > _The Busy Coder's Guide to Android Development_ Version 3.1 Available!- 
> > 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: AppWidget multiple sizes

2010-08-09 Thread kaundinya
Hi,
How can i give an option for the user to select 3 options(news only,
weather only, News and weather) in the dialog on load of the widget?


On Aug 10, 3:23 am, mboehmer  wrote:
> How is this done for the News and Weather widget? After selecting it a
> dialog opens and asks for which content (i.e. size) the user wants to
> have.
>
> On 10 Aug., 00:04, Mark Murphy  wrote:
>
>
>
> > Have two  elements with two separate metadata files with the
> > two sizes, presumably.
>
> > On Mon, Aug 9, 2010 at 5:30 PM, Fernando T  wrote:
> > > I'm looking at creating an AppWidget and want to have the user select
> > > which size they want before adding it. Thus, the user can choose 1x1,
> > > 2x2, etc. The Calendar widget in Android 2.2 (and possibly earlier,
> > > but not in 1.6) does this. How is this done?
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> > _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
> > Available!

-- 
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: on sdcard, File.canRead() = true, File.canWrite() = false

2010-08-09 Thread Bob Kerns
Ah, yes, of course. That critical fact slipped my mind -- thanks
Dianne!

This is, of course, a major reason why ability to write to the SD card
is controlled by an application permission.

Even without the limitations of FAT, file ownership is a tenuous
concept with removable media. I have scripts to set up EC2 instances,
and I have to force user UIDs in each created, so that the filesystems
I mount on those instances can be consistent. And that's using the
ext3 filesystem.

On Aug 9, 3:25 pm, Dianne Hackborn  wrote:
> You can't change the permissions on stuff in external storage.  That uses a
> FAT filesystem, which doesn't have permissions, so all files there simply
> immutably use the permissions of the mount point.

-- 
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] Wifi-UPnP

2010-08-09 Thread msnkm
Hi,

Im trying to Wifi UPnP(which comes along with froyo source code) but
the build is failing.
Has anybody tried building wpa_supplicant_6.

Any help in this matter is appreciated

Thanks & Regards
msnkm

-- 
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] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE

2010-08-09 Thread sunrises
Hi,
I have got the solution please refer the link
http://groups.google.com/group/android-developers/browse_thread/thread/41852900bd603070/583943d91dc9f754?lnk=gst&q=insufficient+memory#583943d91dc9f754
, but I added the option "-partition-size 1024" in "run
configurations"->"target"->"Additional Emulator Command Line Options"
Thanks to All

-- 
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] Build ID , Build Host

2010-08-09 Thread parag
hi all,

What is the difference between
build version
build ID
build Host
android hardware version.

the documentation does not clearly specify its usage.

thanks in advance.

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


[android-developers] Can I freely use the Android source?

2010-08-09 Thread kevin0228ca
Can I freely use the Android source?
i.e: Can I take one of the bulit-in apps, then with no or minimal
modifications to the oringinal contents, enhance it with new features,
and publish as a new app?
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: how to get the screen size in inches...

2010-08-09 Thread Rob
Hopefully, when they fix the Droid it won't report 240.  That's what
the emulator reports with a screen size of 3.7 (diagonal) and
WVGA854.  I tried 240 on my Droid, and it's definitely not as accurate
as 264.  At 240 pixels/inch, the Droid would have a 2 inch wide
screen.  The actual width is 1.8 inches.

On Aug 10, 12:41 am, Rob  wrote:
> Thanks, Mark.  That seems to work.  I'm using this:
>
>         float pixels_per_X_inch = displayMetrics.xdpi;
>         float pixels_per_Y_inch = displayMetrics.ydpi;
>
>         if(Build.DEVICE.equals("sholes") && Build.MODEL.equals("Droid"))
>         {
>                 pixels_per_X_inch = 264; // 480/(9*3.7/sqrt(337)) = 264.613474
>                 pixels_per_Y_inch = 264; // 854/(16*3.7/sqrt(337)) = 
> 264.820203
>         }
>
> The 3.7 is the diagonal of the screen in inches (from the device
> specification).  It's supposed to be a 16:9 display with a resolution
> of 480x854.  If somebody knows for certain what the device should
> return for the xdpi/ydpi, please, post it.  I'm sure that 3.7 inches
> is not exact, so maybe I'm off by a few pixels, but for sizing my
> tiles to 1 cm it works quite well.
>
> On Aug 9, 4:48 pm, Mark Murphy  wrote:
>
> > On Mon, Aug 9, 2010 at 7:24 AM, Rob  wrote:
> > > How do I detect what hardware my app is running on?  I mean the
> > > specific brand and model.
>
> > android.os.Build has that information.
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> > _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
> > Available!
>
>

-- 
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: Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE

2010-08-09 Thread William Ferguson
I can't imagine why you care whether its on an external storage card
embedded or inserted in the phone versus inside the platform storage
space.
As far as your app in concerned it is irrelevant.

If you are worried about security of your images then excrypt them.


On Aug 10, 2:05 pm, sunrises  wrote:
> Hi, thanks for your reply,but I should need to store them as phone
> memory,I did not get appropriate answer even I googled for the maximum
> project size for android and .apk file , I did lot of projects by
> downloading from net..I need alternative solution..
>
> On Aug 10, 3:56 am, William Ferguson 
> wrote:
>
> > Don't include them with your application.
> > When the application first starts, if the external storage contains
> > enough space, download your images and store them there.
> > For what its worth, I wouldn't download an mobile app that was 30MB,
>
> > On Aug 9, 10:03 pm, Rahul  wrote:
>
> > > Hi,
>
> > > I have the same problem too... Can anyone tell me how to insert huge
> > > amount of data(say 30-40 mb of images) on my application...
>
> > > On Aug 9, 3:54 pm, sunrises  wrote:
>
> > > > Hi,
> > > > I am working with android2.2 and I have large no.of Image files and
> > > > total size of those files more than 30 MB and I have stored them in
> > > > asset folder, while Im trying to run the emulator,it shows the "
> > > > Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE"  in console
> > > > and It does not show any thing regarding my application even launcher
> > > > icon also..
> > > > how shall we put all the 30 MB data in android project?

-- 
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 get different device Version

2010-08-09 Thread parag
hi all,

when i check the settings--> about phone

i can c the firmware information etc.
i need to know  a way to find those numbers.

thanks in advance.

On Aug 9, 4:21 pm, parag  wrote:
> hi DevDroid,
>
> Thanks for the quick response,
>
> i have tried that but it dosnt give me the versions that i have
> mentione above.
>
> On Aug 9, 4:15 pm, "{ Devdroid }"  wrote:
>
>
>
> > On 9 August 2010 13:11, parag  wrote:
>
> > > how can i get the followinfg versions regarding an android device,
>
> >http://developer.android.com/reference/android/os/Build.VERSION.html
> > Build.MODEL, Build.DEVICE, Build.VERSION.RELEASE- 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] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE

2010-08-09 Thread sunrises
HI,
I have a lot of images which are approximately 30 MB,I had put them in
assets folder but while try to run the emulator it shows the
"Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE" in
console,please me how to I need to use them for android application
and I have tried by increasing heap size but no use,please tell me the
solution.. what is maximum file size for android project.

-- 
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 set data in google maps and further access that data

2010-08-09 Thread Jitesh mishra
Okay that means user does'nt need to know the geocode of the location.
Thanks a lot.

On Tue, Aug 10, 2010 at 10:27 AM, Frank Weiss  wrote:

> The user can either enter an address and your app can geocode it or
> the user can tap on the map and your app can get the lat long
> coordinates of where the user tapped.
>
> --
> 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: Confused about Timezones and Sqlite3

2010-08-09 Thread Frank Weiss
Chances are you can google for ways to convert text to date data types.

-- 
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 set data in google maps and further access that data

2010-08-09 Thread Frank Weiss
The user can either enter an address and your app can geocode it or
the user can tap on the map and your app can get the lat long
coordinates of where the user tapped.

-- 
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 handle OutofMemoryError in a service?

2010-08-09 Thread Soumya
I would investigate the "root cause" of out of memory error instead of
finding a way to restart your service/activity.


On Aug 10, 12:34 am, doug  wrote:
> Hello,
>
> If my service encounters an OutofMemoryError when creating new
> objects, what can I do to tell Android to restart my service later?  I
> thought about Alarm but then I can't create a pending intent in the
> OutofMemoryError situation...
>
> Thanks,
> doug

-- 
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: Yet another Droid OpenGL texture problem

2010-08-09 Thread Robert Green
Heh, I think I see your problem.

Replace  this.textureMap.put(new Integer(textureFiles[i]), new
Integer(i));
With  this.textureMap.put(new Integer(textureFiles[i]), new
Integer(tmp_tex[i]));

Droids don't number textures incrementally like qualcomms do.  It was
working because your texture ids happened to align with i.

On Aug 9, 11:35 pm, Nightwolf  wrote:
> Why do you set GL_TEXTURE_MIN_FILTER twice? Replace one of the calls
> with GL_TEXTURE_MAG_FILTER.
>
> On Aug 10, 5:22 am, Mike  wrote:
>
>
>
> > Welp, I did even better. I went out and bought a Droid from
> > Craigslist.
>
> > I logged the height and width of the bitmaps at each of the mipmap
> > levels and here's the output:
>
> > DEBUG/Texture(1558): Texture image loaded at 256 x 256
> > DEBUG/MMTexture(1558): Texture image loaded at 128 x 128
> > DEBUG/MMTexture(1558): Texture image loaded at 64 x 64
> > DEBUG/MMTexture(1558): Texture image loaded at 32 x 32
> > DEBUG/MMTexture(1558): Texture image loaded at 16 x 16
> > DEBUG/MMTexture(1558): Texture image loaded at 8 x 8
> > DEBUG/MMTexture(1558): Texture image loaded at 4 x 4
> > DEBUG/MMTexture(1558): Texture image loaded at 2 x 2
> > DEBUG/MMTexture(1558): Texture image loaded at 1 x 1
>
> > So, if it's not the size that's the problem, something with the format
> > of the bitmaps themselves? Well at least now I have a phone to test
> > on.
>
> > On Aug 9, 7:35 pm, String  wrote:
>
> > > Can I suggest you stick a Log call in with your actual loaded texture
> > > sizes? Something like the following:
>
> > >     Log.i(TAG, "Texture image loaded at " + mapImage.getWidth() + " x
> > > " + mapImage.getHeight());
>
> > > Then get one of the Droid/Milestone users to shoot you a logcat
> > > output... xda-devs folks ought to be able to handle that. That'll at
> > > least tell you if the images are loading at the size you expect, or if
> > > it's a different problem.
>
> > > String
>
> > > On Aug 9, 10:11 pm, Mike  wrote:
>
> > > > I am. That's what's so perplexing.
>
> > > > On Aug 9, 3:56 pm, Tom  wrote:
>
> > > > > Make sure that you are loading your textures from the drawable-nodpi
> > > > > resource 
> > > > > directory:http://www.anddev.org/opengl_textures_-_motorola_droid-t10930.html
>
> > > > > On Aug 9, 1:07 pm, Mike  wrote:
>
> > > > > > I'm getting white (blank) textures on everything when running on the
> > > > > > Droid and Galaxy S devices.
> > > > > > My textures are all power-of-two PNGs and they're in the 
> > > > > > /res/drawable-
> > > > > > nodpi folder.
>
> > > > > > Here's my code:
>
> > > > > > public GLTextures(GL10 gl, Context context) {
> > > > > >                 if(gl==null)return;
> > > > > >                 this.gl = gl;
> > > > > >                 this.context = context;
> > > > > >                 this.textureMap = new java.util.HashMap > > > > > Integer>();
> > > > > >                 sBitmapOptions.inPreferredConfig = 
> > > > > > Bitmap.Config.RGB_565;
>
> > > > > >         }
>
> > > > > >         public void freeTexs(){
> > > > > >                 gl.glDeleteTextures(textures.length, textures,0);
> > > > > >                 textureFiles = null;
> > > > > >         }
>
> > > > > >         public void loadTextures() {
> > > > > >                 if(gl==null)return;
> > > > > >                 int[] tmp_tex = new int[textureFiles.length];
> > > > > >                 gl.glGenTextures(textureFiles.length, tmp_tex, 0);
> > > > > >                 textures = tmp_tex;
> > > > > >                 for (int i = 0; i < textureFiles.length; i++) {
>
> > > > > >                         this.textureMap.put(new 
> > > > > > Integer(textureFiles[i]), new Integer(i));
> > > > > >                         int tex = tmp_tex[i];
>
> > > > > >             gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);
> > > > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
> > > > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST);
>
> > > > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > > > GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
> > > > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > > > GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
> > > > > >             gl.glTexEnvf(GL10.GL_TEXTURE_ENV,
> > > > > > GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE);
>
> > > > > >             InputStream is =
> > > > > > context.getResources().openRawResource(textureFiles[i]);
> > > > > >             Bitmap bitmap;
> > > > > >             try {
> > > > > >                 bitmap = BitmapFactory.decodeStream(is, null,
> > > > > > sBitmapOptions);
> > > > > >             } finally {
> > > > > >                 try {
> > > > > >                     is.close();
> > > > > >                 } catch (IOException e) {
> > > > > >                     // Ignore.
> > > > > >                 }
> > > > > >             }
>
> > > > > >             buildMipmap(gl, bitmap, tex);
> >

[android-developers] Re: Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE

2010-08-09 Thread sunrises
Hi, thanks for your reply,but I should need to store them as phone
memory,I did not get appropriate answer even I googled for the maximum
project size for android and .apk file , I did lot of projects by
downloading from net..I need alternative solution..

On Aug 10, 3:56 am, William Ferguson 
wrote:
> Don't include them with your application.
> When the application first starts, if the external storage contains
> enough space, download your images and store them there.
> For what its worth, I wouldn't download an mobile app that was 30MB,
>
> On Aug 9, 10:03 pm, Rahul  wrote:
>
> > Hi,
>
> > I have the same problem too... Can anyone tell me how to insert huge
> > amount of data(say 30-40 mb of images) on my application...
>
> > On Aug 9, 3:54 pm, sunrises  wrote:
>
> > > Hi,
> > > I am working with android2.2 and I have large no.of Image files and
> > > total size of those files more than 30 MB and I have stored them in
> > > asset folder, while Im trying to run the emulator,it shows the "
> > > Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE"  in console
> > > and It does not show any thing regarding my application even launcher
> > > icon also..
> > > how shall we put all the 30 MB data in android project?

-- 
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 get the screen size in inches...

2010-08-09 Thread Rob
Thanks, Mark.  That seems to work.  I'm using this:

float pixels_per_X_inch = displayMetrics.xdpi;
float pixels_per_Y_inch = displayMetrics.ydpi;

if(Build.DEVICE.equals("sholes") && Build.MODEL.equals("Droid"))
{
pixels_per_X_inch = 264; // 480/(9*3.7/sqrt(337)) = 264.613474
pixels_per_Y_inch = 264; // 854/(16*3.7/sqrt(337)) = 264.820203
}

The 3.7 is the diagonal of the screen in inches (from the device
specification).  It's supposed to be a 16:9 display with a resolution
of 480x854.  If somebody knows for certain what the device should
return for the xdpi/ydpi, please, post it.  I'm sure that 3.7 inches
is not exact, so maybe I'm off by a few pixels, but for sizing my
tiles to 1 cm it works quite well.


On Aug 9, 4:48 pm, Mark Murphy  wrote:
> On Mon, Aug 9, 2010 at 7:24 AM, Rob  wrote:
> > How do I detect what hardware my app is running on?  I mean the
> > specific brand and model.
>
> android.os.Build has that information.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
> Available!

-- 
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] Microsphone cannot be recorded on android emulator

2010-08-09 Thread aftershock
Hi,


A small program that I wrote cannot record the microphone. One api
call, getminbuffersize keeps returning -2 which is not correct. The
program works on a real android one.

I use 11025Hz, 16bit pcm,mono recording..
Can you give me a suggestion what can be wrong?

Thank you.


aftershock

-- 
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: ERROR IN "C:\Users\lenovo\Desktop\android-sdk_r06-windows\android-sdk-windows>>SDK Setup.exe"

2010-08-09 Thread Alex Xin
Try http, it works for me

On Tue, Aug 10, 2010 at 12:25 PM, Bob Kerns  wrote:

> Has this (https) ever worked for anyone, ever?
>
> On Aug 9, 4:05 pm, Kwan Cheng  wrote:
> > I think you can fix it by turning "force http" its on the getting started
> > page
> >
> > On Aug 9, 2010 4:46 PM, "izzet.ulas"  wrote:> I've
> been taking "Failed to fetch URL
> >
> > https://dl-ssl.google.com/android/repository/repository.xml,
> >
> >
> >
> > > reason: Connection timed out: connect" error for 2 weeks. I am getting
> > > crazy.. =(( What shoul I do? Please 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 cr...@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
>

-- 
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: Yet another Droid OpenGL texture problem

2010-08-09 Thread Nightwolf
Why do you set GL_TEXTURE_MIN_FILTER twice? Replace one of the calls
with GL_TEXTURE_MAG_FILTER.

On Aug 10, 5:22 am, Mike  wrote:
> Welp, I did even better. I went out and bought a Droid from
> Craigslist.
>
> I logged the height and width of the bitmaps at each of the mipmap
> levels and here's the output:
>
> DEBUG/Texture(1558): Texture image loaded at 256 x 256
> DEBUG/MMTexture(1558): Texture image loaded at 128 x 128
> DEBUG/MMTexture(1558): Texture image loaded at 64 x 64
> DEBUG/MMTexture(1558): Texture image loaded at 32 x 32
> DEBUG/MMTexture(1558): Texture image loaded at 16 x 16
> DEBUG/MMTexture(1558): Texture image loaded at 8 x 8
> DEBUG/MMTexture(1558): Texture image loaded at 4 x 4
> DEBUG/MMTexture(1558): Texture image loaded at 2 x 2
> DEBUG/MMTexture(1558): Texture image loaded at 1 x 1
>
> So, if it's not the size that's the problem, something with the format
> of the bitmaps themselves? Well at least now I have a phone to test
> on.
>
> On Aug 9, 7:35 pm, String  wrote:
>
>
>
> > Can I suggest you stick a Log call in with your actual loaded texture
> > sizes? Something like the following:
>
> >     Log.i(TAG, "Texture image loaded at " + mapImage.getWidth() + " x
> > " + mapImage.getHeight());
>
> > Then get one of the Droid/Milestone users to shoot you a logcat
> > output... xda-devs folks ought to be able to handle that. That'll at
> > least tell you if the images are loading at the size you expect, or if
> > it's a different problem.
>
> > String
>
> > On Aug 9, 10:11 pm, Mike  wrote:
>
> > > I am. That's what's so perplexing.
>
> > > On Aug 9, 3:56 pm, Tom  wrote:
>
> > > > Make sure that you are loading your textures from the drawable-nodpi
> > > > resource 
> > > > directory:http://www.anddev.org/opengl_textures_-_motorola_droid-t10930.html
>
> > > > On Aug 9, 1:07 pm, Mike  wrote:
>
> > > > > I'm getting white (blank) textures on everything when running on the
> > > > > Droid and Galaxy S devices.
> > > > > My textures are all power-of-two PNGs and they're in the 
> > > > > /res/drawable-
> > > > > nodpi folder.
>
> > > > > Here's my code:
>
> > > > > public GLTextures(GL10 gl, Context context) {
> > > > >                 if(gl==null)return;
> > > > >                 this.gl = gl;
> > > > >                 this.context = context;
> > > > >                 this.textureMap = new java.util.HashMap > > > > Integer>();
> > > > >                 sBitmapOptions.inPreferredConfig = 
> > > > > Bitmap.Config.RGB_565;
>
> > > > >         }
>
> > > > >         public void freeTexs(){
> > > > >                 gl.glDeleteTextures(textures.length, textures,0);
> > > > >                 textureFiles = null;
> > > > >         }
>
> > > > >         public void loadTextures() {
> > > > >                 if(gl==null)return;
> > > > >                 int[] tmp_tex = new int[textureFiles.length];
> > > > >                 gl.glGenTextures(textureFiles.length, tmp_tex, 0);
> > > > >                 textures = tmp_tex;
> > > > >                 for (int i = 0; i < textureFiles.length; i++) {
>
> > > > >                         this.textureMap.put(new 
> > > > > Integer(textureFiles[i]), new Integer(i));
> > > > >                         int tex = tmp_tex[i];
>
> > > > >             gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);
> > > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
> > > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST);
>
> > > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > > GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
> > > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > > GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
> > > > >             gl.glTexEnvf(GL10.GL_TEXTURE_ENV,
> > > > > GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE);
>
> > > > >             InputStream is =
> > > > > context.getResources().openRawResource(textureFiles[i]);
> > > > >             Bitmap bitmap;
> > > > >             try {
> > > > >                 bitmap = BitmapFactory.decodeStream(is, null,
> > > > > sBitmapOptions);
> > > > >             } finally {
> > > > >                 try {
> > > > >                     is.close();
> > > > >                 } catch (IOException e) {
> > > > >                     // Ignore.
> > > > >                 }
> > > > >             }
>
> > > > >             buildMipmap(gl, bitmap, tex);
> > > > >             bitmap.recycle();
>
> > > > >                 }
> > > > >         }
>
> > > > > private void buildMipmap(GL10 gl, Bitmap bmp, int tex) {
> > > > >                 //
> > > > >                 int level = 0;
> > > > >                 //
> > > > >                 int height = bmp.getHeight();
> > > > >                 int width = bmp.getWidth();
>
> > > > >                 while (height >= 1 || width >= 1) {
> > > > >                         GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, 
> > > > > bmp, 0);
>
> > > > >  

[android-developers] Re: Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE

2010-08-09 Thread sunrises
Hi, thanks for your reply,but I should need to store them as phone
memory,I did not get appropriate answer even I googled for the maximum
project size for android and .apk file , I did lot of projects by
downloading from net..I need alternative solution..

On Aug 10, 3:56 am, William Ferguson 
wrote:
> Don't include them with your application.
> When the application first starts, if the external storage contains
> enough space, download your images and store them there.
> For what its worth, I wouldn't download an mobile app that was 30MB,
>
> On Aug 9, 10:03 pm, Rahul  wrote:
>
> > Hi,
>
> > I have the same problem too... Can anyone tell me how to insert huge
> > amount of data(say 30-40 mb of images) on my application...
>
> > On Aug 9, 3:54 pm, sunrises  wrote:
>
> > > Hi,
> > > I am working with android2.2 and I have large no.of Image files and
> > > total size of those files more than 30 MB and I have stored them in
> > > asset folder, while Im trying to run the emulator,it shows the "
> > > Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE"  in console
> > > and It does not show any thing regarding my application even launcher
> > > icon also..
> > > how shall we put all the 30 MB data in android project?

-- 
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: ERROR IN "C:\Users\lenovo\Desktop\android-sdk_r06-windows\android-sdk-windows>>SDK Setup.exe"

2010-08-09 Thread Bob Kerns
Has this (https) ever worked for anyone, ever?

On Aug 9, 4:05 pm, Kwan Cheng  wrote:
> I think you can fix it by turning "force http" its on the getting started
> page
>
> On Aug 9, 2010 4:46 PM, "izzet.ulas"  wrote:> I've been 
> taking "Failed to fetch URL
>
> https://dl-ssl.google.com/android/repository/repository.xml,
>
>
>
> > reason: Connection timed out: connect" error for 2 weeks. I am getting
> > crazy.. =(( What shoul I do? Please 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 > cr...@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: Confused about Timezones and Sqlite3

2010-08-09 Thread Bara
Ahh, that makes a lot more sense.

Now, when you say "always use UTC" (which makes more sense to me), how
exactly would I convert a time to a different timezone?  In my
original question I asked "How would I go about converting a string
like "8-8-2010
11:00 AM EST" into the proper format for sqlite3?"  Can you provide
some sample code or a page that would show how to do this?

I come from a .NET background and usually dealing with datetime stuff
is simple, so excuse me for asking so many questions :)

Bara

On Aug 9, 12:03 am, Sarwar Erfan  wrote:
> In my previous reply, by 'current time' I meant your local time (your
> time zone seems to be GMT-4)
>
> So, when you are getting UTC (GMT) using select DATETIME('NOW') -- it
> is 4 hours advanced.
> To get the time in your own timezone (the timezone set in the device),
> you need to use the extra parameter 'localtime'
>
> If you are planning to save time in database for later use, you better
> save the timezone also. Or, always use UTC. Because, if for some
> reason the user changes the timezone of the device, then all your
> saved time (without timezone) will become wrong. If your app does
> something based on current time and some other time record previously
> saved in database --- it will be a problem.
>
> Once you have the time in your application, you can change the
> timezone (if required) in code.
>
> Regards
> Sarwar Erfan
>
> On Aug 9, 9:51 am, Sarwar Erfan  wrote:
>
>
>
> > select DATETIME('NOW') returns UTC or Coordinated Universal Time
>
> > select datetime('now','localtime') returns the current time.
>
> > Regards
> > Sarwar Erfan
>
> > On Aug 9, 9:08 am, Bara  wrote:
>
> > > Hello all,
>
> > > I'm a bit confused as to how to handle different timezones when saving
> > > datetimes to the local database in Android.
>
> > > When I do a SELECT DateTime('now') in the sqlite3 database created by
> > > Android, it says "2010-08-09 03:07:19" but my current time is actually
> > > "2010-08-08 23:07:19" (eg: 4 hours earlier).  Why is that?  Does that
> > > mean I need to add 4 hours to all datetimes so they match the sqlite3
> > > timezone?
>
> > > For example: How would I go about converting a string like "8-8-2010
> > > 11:00 AM EST" into the proper format for sqlite3?
>
> > > Bara

-- 
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: Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE

2010-08-09 Thread sunrises
Hi, thanks for your reply,but I should need to store them as phone
memory,I did not get appropriate answer even I googled for the maximum
project size for android and .apk file , I did lot of projects by
downloading from net..I need alternative solution..

On Aug 10, 3:56 am, William Ferguson 
wrote:
> Don't include them with your application.
> When the application first starts, if the external storage contains
> enough space, download your images and store them there.
> For what its worth, I wouldn't download an mobile app that was 30MB,
>
> On Aug 9, 10:03 pm, Rahul  wrote:
>
> > Hi,
>
> > I have the same problem too... Can anyone tell me how to insert huge
> > amount of data(say 30-40 mb of images) on my application...
>
> > On Aug 9, 3:54 pm, sunrises  wrote:
>
> > > Hi,
> > > I am working with android2.2 and I have large no.of Image files and
> > > total size of those files more than 30 MB and I have stored them in
> > > asset folder, while Im trying to run the emulator,it shows the "
> > > Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE"  in console
> > > and It does not show any thing regarding my application even launcher
> > > icon also..
> > > how shall we put all the 30 MB data in android project?

-- 
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] Do we need to call System.gc() ?

2010-08-09 Thread Alex Xin
Hi,

Do we need to call System.gc() to indicate that system should do a garbage
collection or just let system to choose when to collect garbage and free it?

Because my app will random FCs on certain phones, but if I add some calls to
System.gc(), then there were no FCs.

Thanks & BRs,

Alex

-- 
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] Opening a context menu in the onCreate of an activity

2010-08-09 Thread Chris Stewart
I should also say that I'm kind of searching for a best practice here as
well.  I get the vibe that opening the context menu in this way may not be
the most sound way of doing it, but hey, if it works and it's not
troublesome for the user, that works for me.

Regards,
Chris Stewart

Fantasy 
Football-
Android app for fantasy football fanatics and MFL owners
Social Updater-
An easy way to send your status blast to multiple social networks



On Tue, Aug 10, 2010 at 12:04 AM, Chris Stewart wrote:

> I have tried variations of that but getting the View is where I'm falling
> short.  Something like:
>
> registerForContextMenu(this.getCurrentFocus());
> openContextMenu(this.getCurrentFocus());
>
> I'm not sure what View I should be passing in as right now this Activity
> doesn't really have any UI components laid out in the XML file.
>
> Regards,
> Chris Stewart
>
> Fantasy 
> Football- 
> Android app for fantasy football fanatics and MFL owners
> Social 
> Updater- An 
> easy way to send your status blast to multiple social networks
>
>
>
> On Mon, Aug 9, 2010 at 11:49 PM, TreKing  wrote:
>
>> On Mon, Aug 9, 2010 at 10:44 PM, Chris Stewart wrote:
>>
>>> I'm not finding a way to do what I'm after and was wondering if anyone
>>> has run into this before and how they solved it.
>>
>>
>> I'm sure you tried this already, yes?
>>
>> http://developer.android.com/reference/android/app/Activity.html#openContextMenu(android.view.View)
>> 
>>
>> -
>> 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
>
>
>

-- 
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 set data in google maps and further access that data

2010-08-09 Thread Jitesh mishra
Sorry may be I am not clear to you, actually suppose a client want to set
the location of a place in the app's map then does he need to know the
geocode or he can directly set it in the map only.
thanks for all your help and assistance.

On Tue, Aug 10, 2010 at 9:13 AM, Frank Weiss  wrote:

> Well, it's not clear what you mean by "all locations". Most of us map
> builders already have a database of the points of interest that are to
> be displayed on the map.
>
> --
> 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: Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE

2010-08-09 Thread sunrises
Hi, thanks for your reply,but I should need to store them as phone
memory,I did not get appropriate answer even I googled for the maximum
project size for android and .apk file , I did lot of projects by
downloading from net..I need alternative solution..

On Aug 10, 3:56 am, William Ferguson 
wrote:
> Don't include them with your application.
> When the application first starts, if the external storage contains
> enough space, download your images and store them there.
> For what its worth, I wouldn't download an mobile app that was 30MB,
>
> On Aug 9, 10:03 pm, Rahul  wrote:
>
> > Hi,
>
> > I have the same problem too... Can anyone tell me how to insert huge
> > amount of data(say 30-40 mb of images) on my application...
>
> > On Aug 9, 3:54 pm, sunrises  wrote:
>
> > > Hi,
> > > I am working with android2.2 and I have large no.of Image files and
> > > total size of those files more than 30 MB and I have stored them in
> > > asset folder, while Im trying to run the emulator,it shows the "
> > > Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE"  in console
> > > and It does not show any thing regarding my application even launcher
> > > icon also..
> > > how shall we put all the 30 MB data in android project?

-- 
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] Opening a context menu in the onCreate of an activity

2010-08-09 Thread Chris Stewart
I have tried variations of that but getting the View is where I'm falling
short.  Something like:

registerForContextMenu(this.getCurrentFocus());
openContextMenu(this.getCurrentFocus());

I'm not sure what View I should be passing in as right now this Activity
doesn't really have any UI components laid out in the XML file.

Regards,
Chris Stewart

Fantasy 
Football-
Android app for fantasy football fanatics and MFL owners
Social Updater-
An easy way to send your status blast to multiple social networks



On Mon, Aug 9, 2010 at 11:49 PM, TreKing  wrote:

> On Mon, Aug 9, 2010 at 10:44 PM, Chris Stewart wrote:
>
>> I'm not finding a way to do what I'm after and was wondering if anyone has
>> run into this before and how they solved it.
>
>
> I'm sure you tried this already, yes?
>
> http://developer.android.com/reference/android/app/Activity.html#openContextMenu(android.view.View)
> 
>
> -
> 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

-- 
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] Opening a context menu in the onCreate of an activity

2010-08-09 Thread TreKing
On Mon, Aug 9, 2010 at 10:44 PM, Chris Stewart wrote:

> I'm not finding a way to do what I'm after and was wondering if anyone has
> run into this before and how they solved it.


I'm sure you tried this already, yes?
http://developer.android.com/reference/android/app/Activity.html#openContextMenu(android.view.View)

-
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: Has anyone gotten Point Sprites to work?

2010-08-09 Thread iconnary
Ok, good to know that they are supported.   The Galaxy wallpaper even
runs on my phone.

Are there any source code examples showing how to use point sprites in
Android?  I've found a number of helpful iPhone sample projects
demonstrating GL_POINT_SPRITE_OES and GL_POINT_SIZE_ARRAY_OES usage,
but they all throw UnsupportedOperationException when I duplicate them
in Android.

Specifically, the call to glPointSizePointerOES is where things go off
into the weeds.  I call
glEnableClientState(GL11.GL_POINT_SIZE_ARRAY_OES), then
glPointSizePointerOES(), and the exception is thrown.   If I disable
GL_POINT_SIZE_ARRAY_OES and just call glPointSizef/x, then the entire
GL driver .so dumps core, and with no useful error.

Thanks
Iven






On Aug 9, 6:40 pm, Romain Guy  wrote:
> The Galaxy live wallpaper is implemented with point sprites :) So yes,
> they work and they are supported.
>
>
>
>
>
> On Mon, Aug 9, 2010 at 2:37 PM, iconnary  wrote:
> > I'm developing on a Droid, version 2.1update.  My supported GL
> > extensions include GL_OES_point_sprite and GL_OES_point_size_array.
>
> > I am unable to get point sprites to render.    The code below throws
> > UnsupportedOperationException from GLWrapperBase at the glTexEnvi
> > call.    If I disable textures and comment out the glTexEnvi all, it
> > throws the same exception further down, at glPointSizePointerOES().
>
> > Are point sprites properly supported in Android?   Has anyone gotten
> > them working?    Or is there an issue with my code below?
>
> > gl.glEnable(GL11.GL_TEXTURE_2D);
> > gl.glEnable(GL11.GL_BLEND);
> > gl.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
> > gl.glDepthMask(false);
> > gl.glEnable(GL11.GL_POINT_SPRITE_OES);
> > gl.glTexEnvi( GL11.GL_POINT_SPRITE_OES, GL11.GL_COORD_REPLACE_OES,
> > GL11.GL_TRUE );
> > gl.glEnableClientState(GL11.GL_VERTEX_ARRAY);
> > gl.glVertexPointer(2, GL11.GL_SHORT, 0, .vertBuffer);
> > gl.glEnableClientState(GL11.GL_POINT_SIZE_ARRAY_OES);
> > gl.glPointSizePointerOES(GL11.GL_FLOAT, 0, pointSizeBuffer);
>
> > 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


Re: [android-developers] How to determine that an activity was brought to the foreground from the home screen vs. another activity

2010-08-09 Thread TreKing
That should be "how your app functions".

On Mon, Aug 9, 2010 at 10:41 PM, TreKing  wrote:

> On Mon, Aug 9, 2010 at 7:25 PM, jsera  wrote:
>
>> Other than some convoluted hacks, I don't know how to make this
>> determination.
>>
>
> Convoluted hacks are basically your option. This really shouldn't matter in
> general and I'd recommend you rethink you your app functions.
>
> Giving the user the option to manually refresh while in your activity while
> periodically using a Service in the background to refresh otherwise seems
> like a better idea IMO.
>
>
> -
>  TreKing  - Chicago
> transit tracking app for Android-powered devices
>
>


-- 

-
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: AsyncTask and UI activity

2010-08-09 Thread Bob Kerns
I recommend you display a great big message saying "do not disturb!"
while the restore occurs. You can't actually block the user, for
example, from the home key, or the power key...

So I'd suggest transactionalizing things as much as possible. Read a
set of related files (e.g. for one app) all at once to temporary
names, then
quickly rename the old ones, rename the temporary ones with their
permanent names, and delete the old.

Then, if you receive a Pause event, delete your temporary files.

If you ever encounter renamed old files, you have a partial update.
That should be very rare, but you can roll back by restoring the old
files to their original names, deleting any new files in their place
-- or renaming them to a recovery name inn case the application has
done something with the partial update in the meantime.

You can minimize the chances of that by checking for the restore
progress on reboot, and verifying consistency at that point.

On Aug 9, 1:25 pm, Kim Damevin  wrote:
> Well, I saw several posts saying that the activity app should "not be
> blocked" while the async task is running in background. But definitely I do
> not see other choices :)
>
>
>
> On Mon, Aug 9, 2010 at 10:12 PM, TreKing  wrote:
> > On Mon, Aug 9, 2010 at 3:00 PM, Kim D.  wrote:
>
> >> I understand that having the user blocked while restoring (or maybe with a
> >> progress bar) is not a best pratice but I do not see any other possibility
> >> in this context.
>
> > Who said that's not best "pratice"? Showing a dialog while you do this is
> > pretty much exactly what I would expect.
>
> > --- 
> > --
> > 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 > cr...@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] Opening a context menu in the onCreate of an activity

2010-08-09 Thread Chris Stewart
I have a need to capture some user input when an activity opens for the
first time.  I'm hoping to give the user a list of options to select from,
which will be pulled in dynamically.  I'll then store the selected value
locally for future use.  I'm not finding a way to do what I'm after and was
wondering if anyone has run into this before and how they solved it.

Regards,
Chris Stewart

Fantasy 
Football-
Android app for fantasy football fanatics and MFL owners
Social Updater-
An easy way to send your status blast to multiple social networks

-- 
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 set data in google maps and further access that data

2010-08-09 Thread Frank Weiss
Well, it's not clear what you mean by "all locations". Most of us map
builders already have a database of the points of interest that are to
be displayed on the map.

-- 
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 determine that an activity was brought to the foreground from the home screen vs. another activity

2010-08-09 Thread TreKing
On Mon, Aug 9, 2010 at 7:25 PM, jsera  wrote:

> Other than some convoluted hacks, I don't know how to make this
> determination.
>

Convoluted hacks are basically your option. This really shouldn't matter in
general and I'd recommend you rethink you your app functions.

Giving the user the option to manually refresh while in your activity while
periodically using a Service in the background to refresh otherwise seems
like a better idea IMO.

-
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] How to set data in google maps and further access that data

2010-08-09 Thread Jitesh mishra
First difficulty I am facing is That where can we get geocode of all
locations and another thing if there is any other way to set the location
with the help of Location name only.

On Tue, Aug 10, 2010 at 2:22 AM, TreKing  wrote:

> On Mon, Aug 9, 2010 at 12:15 PM, Jitesh mishra wrote:
>
>> I am new to android development, and i want to develop an app in which u
>> can set some data and location in google map and at a later time we can
>> retrieve it also.
>> Please help me out with it I am not able to set data in maps.
>>
>
> Your question is so horribly generic you're never going to get a decent
> answer. Explain, in detail, what you're trying to do.
>
>
> -
> 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
>

-- 
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 set data in google maps and further access that data

2010-08-09 Thread Anthon Bob
Okay I moved it and less errors are present now. However, ArrayList is
underlined. Am I supposed to declare that as a variable?

On Mon, Aug 9, 2010 at 9:33 PM, Frank Weiss  wrote:

> Thanks for getting down to the brass tacks.
>
> First, that field (aka member) declaration and initialization should
> go inside the class declaration, not before it.
>
> Next is Java Generics, a powerful Java language feature that takes
> some time getting used to. Here's the official story:
> http://www.oracle.com/technetwork/articles/javase/generics-136597.html.
>
> I can summarize how it's applied to HelloItemizedOverlay. The
>  notation tells the compiler that you want this list to
> only contain instances of OverlayItem (or its subclasses). This helps
> to avoid programming errors, because now your code can only add that
> type of object and the rest of the Android map API is gauranteed that
> the list will only have objects of that type (or subtype). Also note
> I'm using the terms type and class interchangably for this discussion.
>
> After the Activity lifecycle, I think the use of Java Generics is the
> most difficult concept for Android newbies, so don't feel bad. But do
> study these two concepts thoroughly to make your Android development
> life easier.
>
> --
> 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 set data in google maps and further access that data

2010-08-09 Thread Frank Weiss
Thanks for getting down to the brass tacks.

First, that field (aka member) declaration and initialization should
go inside the class declaration, not before it.

Next is Java Generics, a powerful Java language feature that takes
some time getting used to. Here's the official story:
http://www.oracle.com/technetwork/articles/javase/generics-136597.html.

I can summarize how it's applied to HelloItemizedOverlay. The
 notation tells the compiler that you want this list to
only contain instances of OverlayItem (or its subclasses). This helps
to avoid programming errors, because now your code can only add that
type of object and the rest of the Android map API is gauranteed that
the list will only have objects of that type (or subtype). Also note
I'm using the terms type and class interchangably for this discussion.

After the Activity lifecycle, I think the use of Java Generics is the
most difficult concept for Android newbies, so don't feel bad. But do
study these two concepts thoroughly to make your Android development
life easier.

-- 
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 can I check my app stopped by which home key or other apps

2010-08-09 Thread optimusgeek
Thank you all.
Here is what I'm doing.
I'd like to register a notification as 'ongoing' when my app being
invisible by only Home key.
but on second thought, It's meaningless as your opinions.
There's not different one app between home screen from application
aspect.
I do not notice that It's all about home key eventually...
and I know I can't control home key.
I think it's unnecessary worry.

thanks guys.




On 8월9일, 오후10시57분, TreKing  wrote:
> 2010/8/8 optimusgeek 
>
> > I mean I want to do something when my app going to be stopped.
>
> Yes, I understand that. The question is why do you care HOW you're stopped?
> Why does being stopped by one app versus the Home screen (which as Bob
> explains is really the same thing) make a difference to you?
> Why do you think you need two different code paths for these cases?
>
> Explain this and you'll probably get more 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: Yet another Droid OpenGL texture problem

2010-08-09 Thread Mike
Welp, I did even better. I went out and bought a Droid from
Craigslist.

I logged the height and width of the bitmaps at each of the mipmap
levels and here's the output:

DEBUG/Texture(1558): Texture image loaded at 256 x 256
DEBUG/MMTexture(1558): Texture image loaded at 128 x 128
DEBUG/MMTexture(1558): Texture image loaded at 64 x 64
DEBUG/MMTexture(1558): Texture image loaded at 32 x 32
DEBUG/MMTexture(1558): Texture image loaded at 16 x 16
DEBUG/MMTexture(1558): Texture image loaded at 8 x 8
DEBUG/MMTexture(1558): Texture image loaded at 4 x 4
DEBUG/MMTexture(1558): Texture image loaded at 2 x 2
DEBUG/MMTexture(1558): Texture image loaded at 1 x 1


So, if it's not the size that's the problem, something with the format
of the bitmaps themselves? Well at least now I have a phone to test
on.



On Aug 9, 7:35 pm, String  wrote:
> Can I suggest you stick a Log call in with your actual loaded texture
> sizes? Something like the following:
>
>     Log.i(TAG, "Texture image loaded at " + mapImage.getWidth() + " x
> " + mapImage.getHeight());
>
> Then get one of the Droid/Milestone users to shoot you a logcat
> output... xda-devs folks ought to be able to handle that. That'll at
> least tell you if the images are loading at the size you expect, or if
> it's a different problem.
>
> String
>
> On Aug 9, 10:11 pm, Mike  wrote:
>
>
>
> > I am. That's what's so perplexing.
>
> > On Aug 9, 3:56 pm, Tom  wrote:
>
> > > Make sure that you are loading your textures from the drawable-nodpi
> > > resource 
> > > directory:http://www.anddev.org/opengl_textures_-_motorola_droid-t10930.html
>
> > > On Aug 9, 1:07 pm, Mike  wrote:
>
> > > > I'm getting white (blank) textures on everything when running on the
> > > > Droid and Galaxy S devices.
> > > > My textures are all power-of-two PNGs and they're in the /res/drawable-
> > > > nodpi folder.
>
> > > > Here's my code:
>
> > > > public GLTextures(GL10 gl, Context context) {
> > > >                 if(gl==null)return;
> > > >                 this.gl = gl;
> > > >                 this.context = context;
> > > >                 this.textureMap = new java.util.HashMap > > > Integer>();
> > > >                 sBitmapOptions.inPreferredConfig = 
> > > > Bitmap.Config.RGB_565;
>
> > > >         }
>
> > > >         public void freeTexs(){
> > > >                 gl.glDeleteTextures(textures.length, textures,0);
> > > >                 textureFiles = null;
> > > >         }
>
> > > >         public void loadTextures() {
> > > >                 if(gl==null)return;
> > > >                 int[] tmp_tex = new int[textureFiles.length];
> > > >                 gl.glGenTextures(textureFiles.length, tmp_tex, 0);
> > > >                 textures = tmp_tex;
> > > >                 for (int i = 0; i < textureFiles.length; i++) {
>
> > > >                         this.textureMap.put(new 
> > > > Integer(textureFiles[i]), new Integer(i));
> > > >                         int tex = tmp_tex[i];
>
> > > >             gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);
> > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
> > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST);
>
> > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
> > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
> > > >             gl.glTexEnvf(GL10.GL_TEXTURE_ENV,
> > > > GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE);
>
> > > >             InputStream is =
> > > > context.getResources().openRawResource(textureFiles[i]);
> > > >             Bitmap bitmap;
> > > >             try {
> > > >                 bitmap = BitmapFactory.decodeStream(is, null,
> > > > sBitmapOptions);
> > > >             } finally {
> > > >                 try {
> > > >                     is.close();
> > > >                 } catch (IOException e) {
> > > >                     // Ignore.
> > > >                 }
> > > >             }
>
> > > >             buildMipmap(gl, bitmap, tex);
> > > >             bitmap.recycle();
>
> > > >                 }
> > > >         }
>
> > > > private void buildMipmap(GL10 gl, Bitmap bmp, int tex) {
> > > >                 //
> > > >                 int level = 0;
> > > >                 //
> > > >                 int height = bmp.getHeight();
> > > >                 int width = bmp.getWidth();
>
> > > >                 while (height >= 1 || width >= 1) {
> > > >                         GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, 
> > > > bmp, 0);
>
> > > >                         if (height == 1 || width == 1) {
> > > >                                 break;
> > > >                         }
> > > >                         // Increase the mipmap level
> > > >                         level++;
> > > >                         //
> > > >                         height /= 2;
> > > >               

Re: [android-developers] How to handle OutofMemoryError in a service?

2010-08-09 Thread Jenus Dong
Service is bound to acrtivity, this kind of service you can control. So if
service has encounted an OutofMemoryError, the OS could restart your
activity, you can restart your service in the activity, eg, OnCreate,
OnRestart.

On Tue, Aug 10, 2010 at 7:34 AM, doug  wrote:

> Hello,
>
> If my service encounters an OutofMemoryError when creating new
> objects, what can I do to tell Android to restart my service later?  I
> thought about Alarm but then I can't create a pending intent in the
> OutofMemoryError situation...
>
> Thanks,
> doug
>
> --
> 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 set data in google maps and further access that data

2010-08-09 Thread Anthon Bob
This part:

Part 2: Adding Overlay Item

I'll elaborate. first of all, they say to put this line "private
ArrayList mOverlays = new ArrayList();" before
HelloItemizedOverlay class. I did that. Is something supposed to go into
 parameter or is it supposed to say like that?

Secondly, mOverlays is giving an error (red lined)

By the way, thanks again. I appreciate it!

On Mon, Aug 9, 2010 at 8:54 PM, Frank Weiss  wrote:

> What part of the Hello, MapView tutorial are you having trouble with?
>
>
> http://developer.android.com/intl/de/guide/tutorials/views/hello-mapview.html
>
> --
> 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 set data in google maps and further access that data

2010-08-09 Thread Frank Weiss
What part of the Hello, MapView tutorial are you having trouble with?

http://developer.android.com/intl/de/guide/tutorials/views/hello-mapview.html

-- 
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 set data in google maps and further access that data

2010-08-09 Thread Anthon Bob
I really need the help since I have been stuck at this phase for a lng
time. Please do help if you can! I'll truly appreciate it!!

On Mon, Aug 9, 2010 at 8:45 PM, Anthon Bob  wrote:

> I have gone through it. I am reading it as we speak. Still, I'm getting
> some trouble. Do you think you can assist?
>
>
> On Mon, Aug 9, 2010 at 8:43 PM, Frank Weiss  wrote:
>
>> Anthon, if you had gone through and studied the MapView tutorial, I
>> think you wouldn't be asking those kind of basic questions.
>>
>> --
>> 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 set data in google maps and further access that data

2010-08-09 Thread Anthon Bob
I have gone through it. I am reading it as we speak. Still, I'm getting some
trouble. Do you think you can assist?

On Mon, Aug 9, 2010 at 8:43 PM, Frank Weiss  wrote:

> Anthon, if you had gone through and studied the MapView tutorial, I
> think you wouldn't be asking those kind of basic questions.
>
> --
> 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 set data in google maps and further access that data

2010-08-09 Thread Frank Weiss
Anthon, if you had gone through and studied the MapView tutorial, I
think you wouldn't be asking those kind of basic questions.

-- 
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: Yet another Droid OpenGL texture problem

2010-08-09 Thread String
Can I suggest you stick a Log call in with your actual loaded texture
sizes? Something like the following:

Log.i(TAG, "Texture image loaded at " + mapImage.getWidth() + " x
" + mapImage.getHeight());

Then get one of the Droid/Milestone users to shoot you a logcat
output... xda-devs folks ought to be able to handle that. That'll at
least tell you if the images are loading at the size you expect, or if
it's a different problem.

String

On Aug 9, 10:11 pm, Mike  wrote:
> I am. That's what's so perplexing.
>
> On Aug 9, 3:56 pm, Tom  wrote:
>
>
>
> > Make sure that you are loading your textures from the drawable-nodpi
> > resource 
> > directory:http://www.anddev.org/opengl_textures_-_motorola_droid-t10930.html
>
> > On Aug 9, 1:07 pm, Mike  wrote:
>
> > > I'm getting white (blank) textures on everything when running on the
> > > Droid and Galaxy S devices.
> > > My textures are all power-of-two PNGs and they're in the /res/drawable-
> > > nodpi folder.
>
> > > Here's my code:
>
> > > public GLTextures(GL10 gl, Context context) {
> > >                 if(gl==null)return;
> > >                 this.gl = gl;
> > >                 this.context = context;
> > >                 this.textureMap = new java.util.HashMap > > Integer>();
> > >                 sBitmapOptions.inPreferredConfig = Bitmap.Config.RGB_565;
>
> > >         }
>
> > >         public void freeTexs(){
> > >                 gl.glDeleteTextures(textures.length, textures,0);
> > >                 textureFiles = null;
> > >         }
>
> > >         public void loadTextures() {
> > >                 if(gl==null)return;
> > >                 int[] tmp_tex = new int[textureFiles.length];
> > >                 gl.glGenTextures(textureFiles.length, tmp_tex, 0);
> > >                 textures = tmp_tex;
> > >                 for (int i = 0; i < textureFiles.length; i++) {
>
> > >                         this.textureMap.put(new Integer(textureFiles[i]), 
> > > new Integer(i));
> > >                         int tex = tmp_tex[i];
>
> > >             gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);
> > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
> > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST);
>
> > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
> > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
> > >             gl.glTexEnvf(GL10.GL_TEXTURE_ENV,
> > > GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE);
>
> > >             InputStream is =
> > > context.getResources().openRawResource(textureFiles[i]);
> > >             Bitmap bitmap;
> > >             try {
> > >                 bitmap = BitmapFactory.decodeStream(is, null,
> > > sBitmapOptions);
> > >             } finally {
> > >                 try {
> > >                     is.close();
> > >                 } catch (IOException e) {
> > >                     // Ignore.
> > >                 }
> > >             }
>
> > >             buildMipmap(gl, bitmap, tex);
> > >             bitmap.recycle();
>
> > >                 }
> > >         }
>
> > > private void buildMipmap(GL10 gl, Bitmap bmp, int tex) {
> > >                 //
> > >                 int level = 0;
> > >                 //
> > >                 int height = bmp.getHeight();
> > >                 int width = bmp.getWidth();
>
> > >                 while (height >= 1 || width >= 1) {
> > >                         GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, 
> > > bmp, 0);
>
> > >                         if (height == 1 || width == 1) {
> > >                                 break;
> > >                         }
> > >                         // Increase the mipmap level
> > >                         level++;
> > >                         //
> > >                         height /= 2;
> > >                         width /= 2;
> > >                         Bitmap bitmap2 = Bitmap.createScaledBitmap(bmp, 
> > > width, height,
> > > true);
> > >                         // Clean up
> > >                         bmp.recycle();
> > >                         bmp = bitmap2;
> > >                 }
> > >         }
>
> > > Here's my setup code in my renderer's onSurfaceCreated method:
>
> > >                                 // Define the lighting
> > >                 float lightAmbient[] = new float[] { 1f, 1f, 1f, 1 };
> > >                 float lightDiffuse[] = new float[] { 1, 1, 1, 1 };
> > >                 float[] lightPos = new float[] { 0, 0, 0, 1};
> > >                 gl.glEnable(GL10.GL_LIGHTING);
> > >                 gl.glEnable(GL10.GL_LIGHT0);
> > >                 gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, 
> > > lightAmbient, 0);
> > >                 gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, 
> > > lightDiffuse, 0);
> > >                 gl.glLightf(GL10.GL_LIGHT0, GL10.GL_CONSTANT_ATTENUATION, 
> 

[android-developers] How to determine that an activity was brought to the foreground from the home screen vs. another activity

2010-08-09 Thread jsera
So I'm writing a news app that has to periodically refresh it's
database of articles.

I want to refresh after a certain amount of time has passed. I could
check in the onStart of every activity, but then I'd wind up
refreshing, and preventing user interaction in the middle of an app
"session".

If I need to refresh, I'd like to refresh when coming back from the
home screen, but I don't want to refresh when coming back from another
activity within the same app. Other than some convoluted hacks, I
don't know how to make this determination.

-- 
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] WifiInfo. getLinkSpeed : uplink or downlink?

2010-08-09 Thread j
I need the Wifi link speed for the smaller of uplink speed and
downlink speed.

What does WifiInfo's getLinkSpeed return?  The documentation doesn't
say.  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: AppWidget multiple sizes

2010-08-09 Thread String
On Aug 9, 11:23 pm, mboehmer  wrote:

> How is this done for the News and Weather widget? After selecting it a
> dialog opens and asks for which content (i.e. size) the user wants to
> have.

Is that on HTC's Sense UI? If so, their widgets are "baked in" to the
home screen and don't have to follow the same rules as the rest of
us.

Mark's right, you need to supply multiple providers, one for each
size. Not a great UX, but that's how it works.

String

-- 
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: Website for your app, how important do you feel it is?

2010-08-09 Thread Doug
In case people don't know this, you can create a "product web site"
with facebook that you don't have to be a facebook member to see.  You
do have to have a facebook account yourself, and if someone wants to
post or discuss, they have to have accounts.  It's a perfectly usable
place to share general information about your product.

-- 
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: Yet another Droid OpenGL texture problem

2010-08-09 Thread Mike
Yep I ran into that as well. My textures are all 128x128 and 256x256

On Aug 9, 6:43 pm, Robert Green  wrote:
> Let me add that when mipmapping, the textures must not only be power-
> of-two but also square, meaning 256x256, not 128x256 like you can
> normally do.
>
> On Aug 9, 4:11 pm, Mike  wrote:
>
>
>
> > I am. That's what's so perplexing.
>
> > On Aug 9, 3:56 pm, Tom  wrote:
>
> > > Make sure that you are loading your textures from the drawable-nodpi
> > > resource 
> > > directory:http://www.anddev.org/opengl_textures_-_motorola_droid-t10930.html
>
> > > On Aug 9, 1:07 pm, Mike  wrote:
>
> > > > I'm getting white (blank) textures on everything when running on the
> > > > Droid and Galaxy S devices.
> > > > My textures are all power-of-two PNGs and they're in the /res/drawable-
> > > > nodpi folder.
>
> > > > Here's my code:
>
> > > > public GLTextures(GL10 gl, Context context) {
> > > >                 if(gl==null)return;
> > > >                 this.gl = gl;
> > > >                 this.context = context;
> > > >                 this.textureMap = new java.util.HashMap > > > Integer>();
> > > >                 sBitmapOptions.inPreferredConfig = 
> > > > Bitmap.Config.RGB_565;
>
> > > >         }
>
> > > >         public void freeTexs(){
> > > >                 gl.glDeleteTextures(textures.length, textures,0);
> > > >                 textureFiles = null;
> > > >         }
>
> > > >         public void loadTextures() {
> > > >                 if(gl==null)return;
> > > >                 int[] tmp_tex = new int[textureFiles.length];
> > > >                 gl.glGenTextures(textureFiles.length, tmp_tex, 0);
> > > >                 textures = tmp_tex;
> > > >                 for (int i = 0; i < textureFiles.length; i++) {
>
> > > >                         this.textureMap.put(new 
> > > > Integer(textureFiles[i]), new Integer(i));
> > > >                         int tex = tmp_tex[i];
>
> > > >             gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);
> > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
> > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST);
>
> > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
> > > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > > GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
> > > >             gl.glTexEnvf(GL10.GL_TEXTURE_ENV,
> > > > GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE);
>
> > > >             InputStream is =
> > > > context.getResources().openRawResource(textureFiles[i]);
> > > >             Bitmap bitmap;
> > > >             try {
> > > >                 bitmap = BitmapFactory.decodeStream(is, null,
> > > > sBitmapOptions);
> > > >             } finally {
> > > >                 try {
> > > >                     is.close();
> > > >                 } catch (IOException e) {
> > > >                     // Ignore.
> > > >                 }
> > > >             }
>
> > > >             buildMipmap(gl, bitmap, tex);
> > > >             bitmap.recycle();
>
> > > >                 }
> > > >         }
>
> > > > private void buildMipmap(GL10 gl, Bitmap bmp, int tex) {
> > > >                 //
> > > >                 int level = 0;
> > > >                 //
> > > >                 int height = bmp.getHeight();
> > > >                 int width = bmp.getWidth();
>
> > > >                 while (height >= 1 || width >= 1) {
> > > >                         GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, 
> > > > bmp, 0);
>
> > > >                         if (height == 1 || width == 1) {
> > > >                                 break;
> > > >                         }
> > > >                         // Increase the mipmap level
> > > >                         level++;
> > > >                         //
> > > >                         height /= 2;
> > > >                         width /= 2;
> > > >                         Bitmap bitmap2 = Bitmap.createScaledBitmap(bmp, 
> > > > width, height,
> > > > true);
> > > >                         // Clean up
> > > >                         bmp.recycle();
> > > >                         bmp = bitmap2;
> > > >                 }
> > > >         }
>
> > > > Here's my setup code in my renderer's onSurfaceCreated method:
>
> > > >                                 // Define the lighting
> > > >                 float lightAmbient[] = new float[] { 1f, 1f, 1f, 1 };
> > > >                 float lightDiffuse[] = new float[] { 1, 1, 1, 1 };
> > > >                 float[] lightPos = new float[] { 0, 0, 0, 1};
> > > >                 gl.glEnable(GL10.GL_LIGHTING);
> > > >                 gl.glEnable(GL10.GL_LIGHT0);
> > > >                 gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, 
> > > > lightAmbient, 0);
> > > >                 gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, 
> > > > lightDiffuse, 0);
> > > >                 gl.glLightf(GL10.GL_LIGHT0, 
> > 

[android-developers] Re: Yet another Droid OpenGL texture problem

2010-08-09 Thread Robert Green
Let me add that when mipmapping, the textures must not only be power-
of-two but also square, meaning 256x256, not 128x256 like you can
normally do.

On Aug 9, 4:11 pm, Mike  wrote:
> I am. That's what's so perplexing.
>
> On Aug 9, 3:56 pm, Tom  wrote:
>
>
>
> > Make sure that you are loading your textures from the drawable-nodpi
> > resource 
> > directory:http://www.anddev.org/opengl_textures_-_motorola_droid-t10930.html
>
> > On Aug 9, 1:07 pm, Mike  wrote:
>
> > > I'm getting white (blank) textures on everything when running on the
> > > Droid and Galaxy S devices.
> > > My textures are all power-of-two PNGs and they're in the /res/drawable-
> > > nodpi folder.
>
> > > Here's my code:
>
> > > public GLTextures(GL10 gl, Context context) {
> > >                 if(gl==null)return;
> > >                 this.gl = gl;
> > >                 this.context = context;
> > >                 this.textureMap = new java.util.HashMap > > Integer>();
> > >                 sBitmapOptions.inPreferredConfig = Bitmap.Config.RGB_565;
>
> > >         }
>
> > >         public void freeTexs(){
> > >                 gl.glDeleteTextures(textures.length, textures,0);
> > >                 textureFiles = null;
> > >         }
>
> > >         public void loadTextures() {
> > >                 if(gl==null)return;
> > >                 int[] tmp_tex = new int[textureFiles.length];
> > >                 gl.glGenTextures(textureFiles.length, tmp_tex, 0);
> > >                 textures = tmp_tex;
> > >                 for (int i = 0; i < textureFiles.length; i++) {
>
> > >                         this.textureMap.put(new Integer(textureFiles[i]), 
> > > new Integer(i));
> > >                         int tex = tmp_tex[i];
>
> > >             gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);
> > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
> > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST);
>
> > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
> > >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > > GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
> > >             gl.glTexEnvf(GL10.GL_TEXTURE_ENV,
> > > GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE);
>
> > >             InputStream is =
> > > context.getResources().openRawResource(textureFiles[i]);
> > >             Bitmap bitmap;
> > >             try {
> > >                 bitmap = BitmapFactory.decodeStream(is, null,
> > > sBitmapOptions);
> > >             } finally {
> > >                 try {
> > >                     is.close();
> > >                 } catch (IOException e) {
> > >                     // Ignore.
> > >                 }
> > >             }
>
> > >             buildMipmap(gl, bitmap, tex);
> > >             bitmap.recycle();
>
> > >                 }
> > >         }
>
> > > private void buildMipmap(GL10 gl, Bitmap bmp, int tex) {
> > >                 //
> > >                 int level = 0;
> > >                 //
> > >                 int height = bmp.getHeight();
> > >                 int width = bmp.getWidth();
>
> > >                 while (height >= 1 || width >= 1) {
> > >                         GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, 
> > > bmp, 0);
>
> > >                         if (height == 1 || width == 1) {
> > >                                 break;
> > >                         }
> > >                         // Increase the mipmap level
> > >                         level++;
> > >                         //
> > >                         height /= 2;
> > >                         width /= 2;
> > >                         Bitmap bitmap2 = Bitmap.createScaledBitmap(bmp, 
> > > width, height,
> > > true);
> > >                         // Clean up
> > >                         bmp.recycle();
> > >                         bmp = bitmap2;
> > >                 }
> > >         }
>
> > > Here's my setup code in my renderer's onSurfaceCreated method:
>
> > >                                 // Define the lighting
> > >                 float lightAmbient[] = new float[] { 1f, 1f, 1f, 1 };
> > >                 float lightDiffuse[] = new float[] { 1, 1, 1, 1 };
> > >                 float[] lightPos = new float[] { 0, 0, 0, 1};
> > >                 gl.glEnable(GL10.GL_LIGHTING);
> > >                 gl.glEnable(GL10.GL_LIGHT0);
> > >                 gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, 
> > > lightAmbient, 0);
> > >                 gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, 
> > > lightDiffuse, 0);
> > >                 gl.glLightf(GL10.GL_LIGHT0, GL10.GL_CONSTANT_ATTENUATION, 
> > > 1.0f);
> > >                 gl.glLightf(GL10.GL_LIGHT0, GL10.GL_LINEAR_ATTENUATION, 
> > > 0.01f);
> > >                 gl.glLightf(GL10.GL_LIGHT0, 
> > > GL10.GL_QUADRATIC_ATTENUATION, .1f);
> > >                 gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPos, 
> > > 0);
>
> > > 

[android-developers] Re: POJO junit test in an Android project

2010-08-09 Thread doug
Oh well, It doesn't seem that the Eclipse plug-in would even run a
test case subclassed directly from junit.framework.TestCase.  How do
folks test POJOs in Android then?

Thanks,
doug

-- 
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 handle OutofMemoryError in a service?

2010-08-09 Thread doug
Hello,

If my service encounters an OutofMemoryError when creating new
objects, what can I do to tell Android to restart my service later?  I
thought about Alarm but then I can't create a pending intent in the
OutofMemoryError situation...

Thanks,
doug

-- 
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] AsyncTask and UI activity

2010-08-09 Thread TreKing
On Mon, Aug 9, 2010 at 3:25 PM, Kim Damevin  wrote:

> Well, I saw several posts saying that the activity app should "not be
> blocked" while the async task is running in background.


I've never seen that. You may be confusing "do not block the UI thread"
which is a different matter.

-
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] Webview of local webpage shows cluttered/repeated text

2010-08-09 Thread Mark Murphy
On Mon, Aug 9, 2010 at 7:03 PM, jb  wrote:
> I display a local webpage (located in my 'assets' directory) within a
> Webview.

Try using:

mWebView.loadUrl("file:///android_asset/signPostContent.html");

instead.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

-- 
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] POJO junit test in an Android project

2010-08-09 Thread doug
Hello,

If I create a "tests" directory in my Eclipse Android project to hold
POJO junit test cases derived from junit.framework.TestCase, will the
Eclipse plug-in exclude those test classes when packaging the apk?

Thanks,
doug


-- 
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: Does a contact have a phone number?

2010-08-09 Thread William Ferguson
http://developer.android.com/reference/android/provider/ContactsContract.Contacts.html

See Contacts#HAS_PHONE_NUMBER


On Aug 7, 10:24 pm, Kanodi  wrote:
> Hi all,
>
>    I am trying to write a simple function that determines if a contact
> has a phone number or not. And am not having any luck what so ever. I
> have tried several ways of achieving this all found online. At present
> I have the following:
>
> public boolean hasPhone() {
>         Cursor phones = getContentResolver().query(
>                 ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
>                 null,
>                 ContactsContract.CommonDataKinds.Phone.CONTACT_ID + "=" +
> this.getId(),
>                 null,
>                 null
>         );
>         boolean has = false;
>         if(phones.getCount() > 0) {
>              has = true;
>         }
>         if(!phones.isClosed()) {
>               phones.close();
>         }
>         return has;
>
> }
>
> The function above always returns false, I know the 'getId()' method
> returns the contacts actual id, as the class has other similar
> functions that return the correct contacts data.
>
> Any advice would be greatly appreciated.
>
> Thanks,
> Lee.

-- 
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] ERROR IN "C:\Users\lenovo\Desktop\android-sdk_r06-windows\android-sdk-windows>>SDK Setup.exe"

2010-08-09 Thread Kwan Cheng
I think you can fix it by turning "force http" its on the getting started
page

On Aug 9, 2010 4:46 PM, "izzet.ulas"  wrote:
> I've been taking "Failed to fetch URL
https://dl-ssl.google.com/android/repository/repository.xml,
> reason: Connection timed out: connect" error for 2 weeks. I am getting
> crazy.. =(( What shoul I do? Please 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

-- 
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: Error after publishing

2010-08-09 Thread Kwan Cheng
This is a tricky error.  I've seen this a lot on my own programs.

There is no way to help you unless the source  is available.  Try to  run
the program in debug mode on the device.  It will usually break at the point
of the null pointer exception.

It is most likely because the acidity thread got executed before you had a
chance to initialize the object that is being used.

On Aug 9, 2010 6:30 PM, "HIRAK"  wrote:
> This is the stacktrace I received, when I published the app.
> Now, nowhere in the stacktrace, my classes are mentioned.
> So I am not able to understand, where the code is breaking.
> So I thought, if anybody can give me some hint, about how to go
> forward with solving this issue.
>
>
>
> On Aug 8, 2:52 am, TreKing  wrote:
>> On Sat, Aug 7, 2010 at 5:22 PM, HIRAK  wrote:
>> > Could somebody please help me?
>>
>> I'm sorry, but how exactly do you expect people to help you?
>> That stack trace you posted shows nothing other than the obvious fact
that
>> you have a NullPointer somewhere.
>> We know nothing about your app or what is causing your error. If you
don't
>> know what the problem is, how would we?
>>
>>
---
--
>> 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

-- 
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] Webview of local webpage shows cluttered/repeated text

2010-08-09 Thread jb
Hi,

I display a local webpage (located in my 'assets' directory) within a
Webview. The webpage is almost exclusively text.
When displayed, the middle third of the body of text appears to be
repeated multiple times, and makes the text appear very cluttered.

I ran the webpage through the W3C html validator and it passed without
any errors.

Displaying it on regular browsers work perfectly.

Here's my code:

setContentView(R.layout.signpost);
mWebView = (WebView) findViewById(R.id.webview);
mWebView.setBackgroundColor(0); // make the background transparent
mWebView.setBackgroundResource(R.drawable.background);
InputStreamReader is = null;
try {
is = new
InputStreamReader(getApplicationContext().getAssets().open("signPostContent.html"));
BufferedReader buff = new BufferedReader(is, 8192);
StringBuffer out = new StringBuffer();
String strLine = null;
while ((strLine = buff.readLine()) != null) {
out.append(strLine);
}
is.close();
String mimeType = "text/html";
String encoding = "utf-8";
String fin = new String(out.toString());
mWebView.loadDataWithBaseURL("file:///sdcard/data/data/
com.this.that/", fin, mimeType, encoding, "");
} catch (IOException e) {
e.printStackTrace();
}

Any ideas?

jb

-- 
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: BitmapFactory.decodeResource, Multiple Resolution Support and SurfaceViews

2010-08-09 Thread Greg
Anyone?  Still horribly stuck and confused...

On Aug 7, 2:06 pm, Greg  wrote:
> I am having an issue understanding how to get Bitmaps from resources
> in density specific directories to scale properly when drawing them to
> a Surface View.  If I have a resource in folder "drawable" I expect it
> to be scaled up when run on hdpi screens and scaled down on ldpi
> screens and left as is on mdpi or 1.5 screens.  Likewise I expect
> anything found in hdpi when run on an hdpi screen to remain unscaled.
>
> However, there is some combination of settings that I am not getting
> right to do this seemingly simple thing.  I am not running
> compatibility mode so my manifest supports all screen sizes with
> anydensity=true.  I do not understand the BitmapFactory.Options fields
> of inScaled, inTargetDensity, and inDensity that I am thinking have to
> be set appropriately and slightly different for each resource decoded
> depending on which directory they were found in and what screen they
> are currently run on.
>
> All I have been able to find is that if either inTargetDensity and
> inDensity are 0, no scaling occurs, but if not, scaling occurs such
> that inDensity matches inTargetDensity.  Is this correct?  I have no
> idea what valid settings are for these fields from the documentation
> other than ints.  What are the integer values for LDPI, MDPI, and
> HDPI?  And how do I determine the density of a resource in order to
> set this before I decode it?  Am I way off base in my approach for
> drawing bitmaps from various resource directories on various screen
> sizes?
>
> Any help would be much appreciated!
> Thanks,
> -Greg

-- 
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: Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE

2010-08-09 Thread William Ferguson
Don't include them with your application.
When the application first starts, if the external storage contains
enough space, download your images and store them there.
For what its worth, I wouldn't download an mobile app that was 30MB,

On Aug 9, 10:03 pm, Rahul  wrote:
> Hi,
>
> I have the same problem too... Can anyone tell me how to insert huge
> amount of data(say 30-40 mb of images) on my application...
>
> On Aug 9, 3:54 pm, sunrises  wrote:
>
> > Hi,
> > I am working with android2.2 and I have large no.of Image files and
> > total size of those files more than 30 MB and I have stored them in
> > asset folder, while Im trying to run the emulator,it shows the "
> > Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE"  in console
> > and It does not show any thing regarding my application even launcher
> > icon also..
> > how shall we put all the 30 MB data in android project?

-- 
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 set data in google maps and further access that data

2010-08-09 Thread Anthon Bob
Is geocode lat/long or the micro degrees? Also, if I have all the geocodes
typed up, how do I utilize that? Do I have to create a new class to create
itemized overlay with arrays?

On Mon, Aug 9, 2010 at 6:11 PM, Frank Weiss  wrote:

> I'm assuming that the data you want to save includes a geocode
> (lat/long) and some additional data, such as title. The answer to your
> question can get quite elaborate, depending on the details. However, I
> suggest you start with the simplest thing that work. That would
> probably be see the marker and data after the activity is resumed.
> Using Shared Preferences, in the onPause method save the data and in
> onResume, resote the data.
>
> --
> 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] An alternative for android-market-api

2010-08-09 Thread Shane Isbell
I'm not aware of any alternative but I've found the API works very well. The
thing is Android Market itself doesn't play nice so you just need to make
sure that your use of the API is robust to failures (sometimes Android
Market logs you out, or throttles you or you gives an invalid result...).

On Mon, Aug 9, 2010 at 3:20 PM, mboehmer  wrote:

> So far I have been using the android-market-api as provided at
> http://code.google.com/p/android-market-api/ to retrieve information
> on apps from the Market. But this client does not work very well and
> not every request returns a result. Does anybody know, if there is any
> good alternative to query the market for app information?
>
> --
> 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




-- 
Shane Isbell (Founder of ZappMarket)
http://apps.facebook.com/zappmarket/

-- 
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 set data in google maps and further access that data

2010-08-09 Thread Frank Weiss
I'm assuming that the data you want to save includes a geocode
(lat/long) and some additional data, such as title. The answer to your
question can get quite elaborate, depending on the details. However, I
suggest you start with the simplest thing that work. That would
probably be see the marker and data after the activity is resumed.
Using Shared Preferences, in the onPause method save the data and in
onResume, resote the data.

-- 
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] Has anyone gotten Point Sprites to work?

2010-08-09 Thread Romain Guy
The Galaxy live wallpaper is implemented with point sprites :) So yes,
they work and they are supported.

On Mon, Aug 9, 2010 at 2:37 PM, iconnary  wrote:
> I'm developing on a Droid, version 2.1update.  My supported GL
> extensions include GL_OES_point_sprite and GL_OES_point_size_array.
>
> I am unable to get point sprites to render.    The code below throws
> UnsupportedOperationException from GLWrapperBase at the glTexEnvi
> call.    If I disable textures and comment out the glTexEnvi all, it
> throws the same exception further down, at glPointSizePointerOES().
>
> Are point sprites properly supported in Android?   Has anyone gotten
> them working?    Or is there an issue with my code below?
>
> gl.glEnable(GL11.GL_TEXTURE_2D);
> gl.glEnable(GL11.GL_BLEND);
> gl.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
> gl.glDepthMask(false);
> gl.glEnable(GL11.GL_POINT_SPRITE_OES);
> gl.glTexEnvi( GL11.GL_POINT_SPRITE_OES, GL11.GL_COORD_REPLACE_OES,
> GL11.GL_TRUE );
> gl.glEnableClientState(GL11.GL_VERTEX_ARRAY);
> gl.glVertexPointer(2, GL11.GL_SHORT, 0, .vertBuffer);
> gl.glEnableClientState(GL11.GL_POINT_SIZE_ARRAY_OES);
> gl.glPointSizePointerOES(GL11.GL_FLOAT, 0, pointSizeBuffer);
>
>
>
>
>
> 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


Re: [android-developers] Re: AppWidget multiple sizes

2010-08-09 Thread Mark Murphy
On Mon, Aug 9, 2010 at 6:23 PM, mboehmer  wrote:
> How is this done for the News and Weather widget? After selecting it a
> dialog opens and asks for which content (i.e. size) the user wants to
> have.

It doesn't do that on my Nexus One. It asks what content I want, but
the size is the same.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

-- 
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: Error after publishing

2010-08-09 Thread HIRAK
This is the stacktrace I received, when I published the app.
Now, nowhere in the stacktrace, my classes are mentioned.
So I am not able to understand, where the code is breaking.
So I thought, if anybody can give me some hint, about how to go
forward with solving this issue.



On Aug 8, 2:52 am, TreKing  wrote:
> On Sat, Aug 7, 2010 at 5:22 PM, HIRAK  wrote:
> > Could somebody please help me?
>
> I'm sorry, but how exactly do you expect people to help you?
> That stack trace you posted shows nothing other than the obvious fact that
> you have a NullPointer somewhere.
> We know nothing about your app or what is causing your error. If you don't
> know what the problem is, how would we?
>
> --- 
> --
> 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] Re: on sdcard, File.canRead() = true, File.canWrite() = false

2010-08-09 Thread Dianne Hackborn
You can't change the permissions on stuff in external storage.  That uses a
FAT filesystem, which doesn't have permissions, so all files there simply
immutably use the permissions of the mount point.

On Mon, Aug 9, 2010 at 11:46 AM, Bob Kerns  wrote:

> Kostya and Mark answered your main question; I'll address your ps.
>
> Applications are indeed 'other' in the permissions you list below, but
> applications do have their own uids, so an Application's directory
> will be owned by its uid.
>
> An application with the right permission I'm guessing is put into the
> sdcard_rw group, and thus would come in under the group permissions
> instead.
>
> I believe chmod command doesn't take the symbolic arguments -- you'll
> have to use the numeric arguments like we did back in the 1970's.
>
> I'm not sure why you were trying to remove the 'other' permissions on
> that file, but let's say you did ls -l on it, and the permissions were
> -rw-r--r--. You'd convert this to the numeric form: 644. Your o-rwx
> would mean 'turn off all the bits in the last digit', so you'd want
> chmod 640 ...
>
> I'd love to have a document on the command-line commands!
>
> You can install the busybox toolkit, and get much improved versions of
> many commands, such as this. I find a rooted device without busybox to
> be very disconcerting. Busybox puts a large number of commands in one
> executable to make it quite small, and then symlinks to it under each
> command name. It looks at the name to figure which command you're
> asking for.
>
> On Aug 9, 10:59 am, john brown  wrote:
>
> > P.S.
> > I got a command prompt via c:\Program Files\Android-SDK\tools> adb
> > shell
> >
> > # ls -l /sdcard/Android/data/lms
> > rwxr-x systemsdcard_rw63   2010-07-19 15:17
> > mpReadAbDdx201006.txt
> > rwxr-x systemsdcard_rw 45211   2010-07-19 15:17
> > mpTranAbDdx201006.txt
> >
> > The way I read this is that the owner's rights are ---, group is rwx,
> > others is r-x. I'm just guessing, the application is others?
> >
> > But I cannot get chmod to change the attributes, i.e.:
> >
> > # chmode o-rwx /sdcard/Android/data/lms/mpReadAbDdx201006.txt
> > Bad mode
> >
> > (I get the same file attributes when I copy file to sdcard via  DDMS
> > File Explorer.)
> >
> > Where can I find documentation to the Android linux (?) commands? (I
> > mean the command line commands)
>
> --
> 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

[android-developers] Re: AppWidget multiple sizes

2010-08-09 Thread mboehmer
How is this done for the News and Weather widget? After selecting it a
dialog opens and asks for which content (i.e. size) the user wants to
have.

On 10 Aug., 00:04, Mark Murphy  wrote:
> Have two  elements with two separate metadata files with the
> two sizes, presumably.
>
> On Mon, Aug 9, 2010 at 5:30 PM, Fernando T  wrote:
> > I'm looking at creating an AppWidget and want to have the user select
> > which size they want before adding it. Thus, the user can choose 1x1,
> > 2x2, etc. The Calendar widget in Android 2.2 (and possibly earlier,
> > but not in 1.6) does this. How is this done?
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
> Available!

-- 
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: is there any API available to receive the broadcast receiver for app started.

2010-08-09 Thread Frank Weiss
Indicator, I don't understand why you repeat the erroneous "launching
another app". Correct me if I'm wrong, when you tap an icon on the
home screen what's happening is that an intent is being sent which
starts an activity in a particular package. That package's application
context may already be "launched" (such as if an activity in it was
recently used), in which case there's no need to either create a new
process for it, nor to reload the package into a process. "Launching"
an activity only occurs if the Andorid system has garbage collected it
or if it was force closed.

This can be easily demonstrated with the Maps application. The first
time, the tiles take a while to load, subsequently, they are displayed
immediately when bringing it to foreground. After a force close, the
tiles again take a while to load.

-- 
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] An alternative for android-market-api

2010-08-09 Thread mboehmer
So far I have been using the android-market-api as provided at
http://code.google.com/p/android-market-api/ to retrieve information
on apps from the Market. But this client does not work very well and
not every request returns a result. Does anybody know, if there is any
good alternative to query the market for app information?

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

2010-08-09 Thread Mark Murphy
Have two  elements with two separate metadata files with the
two sizes, presumably.

On Mon, Aug 9, 2010 at 5:30 PM, Fernando T  wrote:
> I'm looking at creating an AppWidget and want to have the user select
> which size they want before adding it. Thus, the user can choose 1x1,
> 2x2, etc. The Calendar widget in Android 2.2 (and possibly earlier,
> but not in 1.6) does this. How is this done?

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

-- 
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: Populating custom layout from xml resource.

2010-08-09 Thread gnugu
Here is the solution. Thank you Mark Murphy for you guidance and for
the excerpt from your book (found on the link you provided above).

The purpose of this exercise is to use ListView for app navigation
instead of a menu.

In /res/layout create menu_list_item.xml:

http://schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip">









In /res/xml create file main_screen_actions.xml that looks like this:


http://schemas.android.com/apk/res/android";>






Create class:
public class ListMenuDescriptor {
public int iconId;
public String title;
public String summary;

/**
 * Constructor
 *
 * @param iconId Id of the icon resource.
 * @param title Menu item title.
 * @param summary Short menu description.
 */
public ListMenuDescriptor(int iconId, String title, String summary) {
this.iconId = iconId;
this.title = title;
this.summary = summary;
}
}


Create class:
public class ListMenuArrayAdapter extends
ArrayAdapter {
private LayoutInflater _inflater;

/**
 * Item tag for list menu items describing xml resource file.
 */
public static final String ITEM_TAG = "item";
/**
 * Icon resource attribute.
 */
public static final String ICON_ATTR = "icon";
/**
 * Title attribute.
 */
public static final String TITLE_ATTR = "title";
/**
 * Summary attribute.
 */
public static final String SUMMARY_ATTR = "summary";

/**
 * Constructor
 *
 * @param context
 *The current context.
 * @param items
 *List menu items.
 */
public ListMenuArrayAdapter(Context context,
ArrayList items) {
super(context, R.layout.menu_list_item, items);

_inflater = (LayoutInflater) context

.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}

/**
 * Creates ListMenuArrayAdapter from xml resource.
 *
 * @param context
 *The context.
 * @param listMenuItemsResId
 *Id of the resource describing list menu items.
 * @return ListMenuArrayAdapter
 */
public static ListMenuArrayAdapter createFromResource(Context
context,
int listMenuItemsResId) {

ArrayList items = new
ArrayList();

// inflate and create the list
XmlResourceParser parser = context.getResources().getXml(
listMenuItemsResId);
try {
while (parser.getEventType() != 
XmlResourceParser.END_DOCUMENT) {
if (parser.getEventType() == 
XmlResourceParser.START_TAG) {
String tag = parser.getName();
if (tag.equals(ITEM_TAG)) {
items.add(new
ListMenuDescriptor(parser.getAttributeResourceValue(null, ICON_ATTR,
0),

parser.getAttributeValue(null, TITLE_ATTR),

parser.getAttributeValue(null, SUMMARY_ATTR)));
}
}
parser.next();
}
} catch (XmlPullParserException xpe) {
Log.e(ListMenuArrayAdapter.class.getName(),
Log.getStackTraceString(xpe));
throw new RuntimeException(xpe);
} catch (IOException ioe) {
Log.e(ListMenuArrayAdapter.class.getName(),
Log.getStackTraceString(ioe));
throw new RuntimeException(ioe);
} finally {
parser.close();
}

return new ListMenuArrayAdapter(context, items);
}

@Override
public View getView(int position, View convertView, ViewGroup parent)
{
View row = convertView;

if (row == null) {
row = _inflater.inflate(R.layout.menu_list_item, 
parent, false);
}

ListMenuDescriptor descriptor = this.getItem(position);

TextView txt = (TextView) row.findViewById(R.id.title);
txt.setText(descriptor.title);

txt = (TextView) row.findViewById(R.id.summary);
txt.setText(descriptor.summary);

ImageView ico = (ImageView) row.findViewById(R.id.icon);
ico.setI

Re: [android-developers] Re: developing with htc aria

2010-08-09 Thread Kostya Vasilyev
FWIW - I only have experience with an HTC Hero, not Aria. It is necessary to
select HTC Sync *in the phone* for it to connect with the ADB driver. Having
HTC Sync installed in Windows is not necessary, and I suspect might even be
detrimental.

The phone never finds the Sync app in Windows, and displays an error
message, but shows up in adb/Eclipse.

Now, I wonder why there is no special connect mode just for debugging in any
Android phone I've used, and why adb doesn't use a class driver. But I
guess that's like asking who shot Kennedy...

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

10.08.2010 1:38 пользователь "Joseph Earl" 
написал:

Providing a driver for the HTC Aria is probably up to HTC and not
Google, though I could be wrong. Try contacting HTC support and
searching Google to see if others have had the same issue.
HTC Sync works fine for me with various HTC devices on Windows 7
Professional (though I do not have the Aria I am afraid).

If you can get hold of a computer running Windows 7 or Linux, you
could try testing with that; it is however more likely the specific
drivers for the Aria that are the issue - the core of Windows 7 and
Vista are much the same (Windows Vista = NT6, Windows 7 = NT6.1) so I
do not think the OS is the most likely cause.


On Aug 9, 1:47 pm, mhuman1  wrote:
> I have a couple of apps working using ...

-- 
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 activity' fresh start

2010-08-09 Thread Pinheiro
Thanks a lot, 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-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: developing with htc aria

2010-08-09 Thread Joseph Earl
Providing a driver for the HTC Aria is probably up to HTC and not
Google, though I could be wrong. Try contacting HTC support and
searching Google to see if others have had the same issue.
HTC Sync works fine for me with various HTC devices on Windows 7
Professional (though I do not have the Aria I am afraid).

If you can get hold of a computer running Windows 7 or Linux, you
could try testing with that; it is however more likely the specific
drivers for the Aria that are the issue - the core of Windows 7 and
Vista are much the same (Windows Vista = NT6, Windows 7 = NT6.1) so I
do not think the OS is the most likely cause.

On Aug 9, 1:47 pm, mhuman1  wrote:
> I have a couple of apps working using eclipse and the emulator. I now
> want to try the apps on my htc aria. I went through downloading the
> usb driver as the Android Developers documentations sans and a  usb
> driver folder now shows up in my sdk folder. However, apparently there
> isn't a driver for the HTC aria in the folder.
>
> After research some people suggested using htc sync. I donwloaded htc
> sync and  let windows check that I had the latest version. However, my
> phone keeps saying that it can't find htc sync on my computer.
>
> When I plug in my HTC aria, the device manager on my lap top
> recognizes two devices as listed below:  My HTc under Android USB
> devices and a HTC Android Phone USB Device. I clicked on “update
> driver” for both devices, Windows found them on-line and verified that
> they were the latest.
> I don’t understand why there are two drivers, but “My HTc” seems to
> have a problem as listed below.  One thing that I should mention is
> that I am using the dreaded VISTA.
>
> Device Manager:
> Android USB Devices: My HTC
> Device status: Windows cannot initialize the device driver for this
> hardware. (Code 37)
> Click 'Check for solutions' to send data about this device to
> Microsoft and to see if there is a solution available.
> Description:
>   Windows was able to successfully install device driver software, but
> the driver software encountered a problem when it tried to run. The
> problem code is 37.
>
> Problem signature:
>   Problem Event Name:   PnPDeviceProblemCode
>   Architecture: x86
>   Hardware Id:  USB\VID_0BB4&PID_0C92&REV_0100&MI_01
>   Setup class GUID:     {f72fe0d4-cbcb-407d-8814-9ed673d0dd6b}
>   PnP problem code:     0025
>   Driver name:  ANDROIDUSB.sys
>   Driver version:       2.0.7.1
>   Driver date:  06-10-2009
>   OS Version:   6.0.6000.2.0.0.256.6
>   Locale ID:    1033
>
> HTC Android Phone USB Device
>
> Device Status: This device is working normally.
>         Driver Provider: Microsoft
>         Driver Date: 6/21/2006
>
> So, the best I can tell is that there isn't a driver from the normal
> Android repository for the htc aria yet. And, for some reason my
> computer can't handle the htc sync drivers.
>
> Will there be a usb driver for the htc aria that I can download from
> Android Developers in the future?  Has anyone else been able to get
> htc sync to work with the htc aria? Is there anohter way to transfer
> my apps to the phone for development?
>
> I guess that I can always use the ddms environment and transfer the
> app, but I really wanted a more graceful way to do this.
>
> Thanks in advance,
> mhuman1

-- 
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] Has anyone gotten Point Sprites to work?

2010-08-09 Thread iconnary
I'm developing on a Droid, version 2.1update.  My supported GL
extensions include GL_OES_point_sprite and GL_OES_point_size_array.

I am unable to get point sprites to render.The code below throws
UnsupportedOperationException from GLWrapperBase at the glTexEnvi
call.If I disable textures and comment out the glTexEnvi all, it
throws the same exception further down, at glPointSizePointerOES().

Are point sprites properly supported in Android?   Has anyone gotten
them working?Or is there an issue with my code below?

gl.glEnable(GL11.GL_TEXTURE_2D);
gl.glEnable(GL11.GL_BLEND);
gl.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
gl.glDepthMask(false);
gl.glEnable(GL11.GL_POINT_SPRITE_OES);
gl.glTexEnvi( GL11.GL_POINT_SPRITE_OES, GL11.GL_COORD_REPLACE_OES,
GL11.GL_TRUE );
gl.glEnableClientState(GL11.GL_VERTEX_ARRAY);
gl.glVertexPointer(2, GL11.GL_SHORT, 0, .vertBuffer);
gl.glEnableClientState(GL11.GL_POINT_SIZE_ARRAY_OES);
gl.glPointSizePointerOES(GL11.GL_FLOAT, 0, pointSizeBuffer);





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] AppWidget multiple sizes

2010-08-09 Thread Fernando T
I'm looking at creating an AppWidget and want to have the user select
which size they want before adding it. Thus, the user can choose 1x1,
2x2, etc. The Calendar widget in Android 2.2 (and possibly earlier,
but not in 1.6) does this. How is this done?

-- 
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: Content provider doubt

2010-08-09 Thread Kostya Vasilyev
I'd like to further clarify one important benefit of ContentProvider
lifecycle management for an application with multiple Activities that need
to share data.

Putting a database into a Service means that, to use the database, an
Activity needs to bind to the Service. Binding is asynchronous, so there is
going to be a delay between the time an Activity appears on the screen, and
when it can start populating itself with data from the Service's database.

Now, I don't know how long of a delay this turns out to be, perhaps not long
at all, but there certainly is one.

With a ContentProvider, an Activity can start making data queries right
inside onStart or onResume. So the delay inherent in the Service pattern is
not there, and UI should feel more responsive.

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

10.08.2010 1:12 пользователь "Indicator Veritatis" 
написал:

Kostya hit the nail on the head: the biggest benefit provided by
ContentProvider and ContentResolver is probably just that, that it
provides lifecycle management on top of database queries.

There are also other benefits, such as insulating from the particulars
of database, but since we are tied to SQLite3 anyway, I don't see this
as nearly as big. Plus, it is a nuisance that the interface 'leaks' a
cursor -- forcing you to make it look like a database even in the rare
case where there is no database behind the ContentProvider:(

But that lifecycle management is a major benefit, since you really
would not want to handle releasing and re-acquiring database
connections etc. all on your own without that support.

ContentProvider also provides consistent means for sharing data
between applications, not just between application components of a
single activity.


On Aug 9, 2:36 am, Sohan badaya  wrote:
> Hi All,
>
> I have a doubt about ...

-- 
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] Detecting activity' fresh start

2010-08-09 Thread TreKing
On Mon, Aug 9, 2010 at 4:25 PM, Pinheiro  wrote:

> How can we detect if an Activity is run for the 1st time?


The savedInstanceState Bundle passed to you is null the first time through.
It is non-null if you're being restored (from a screen rotation or
otherwise), in which case it contains the data you save in
onSaveInstanceState.

-
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: hi, i'm newbie in android, i wonder about float dp...

2010-08-09 Thread Joseph Earl
Your calculation is wrong, it should be

buttonWidth = (currentDPI/160)*100;

So if currentDPI = 240 then buttonWidth = 150px

Instead of using (currentDPI/160) use
final float scaleDPI =
getContext().getResources().getDisplayMetrics().density;

and then

buttonWidth = scaleDPI*100;

See http://developer.android.com/guide/practices/screens_support.html#support
for more information on the topic.

On Aug 9, 12:05 pm, hwani  wrote:
> hi, guys.
>
> is it possible, coding float data to layout_height(int)?
>
> some problems occur in layout design, px to dp convert.
>
> ex) i designed some layout, in px work.(button width 100px)
>       then i build the layout to dp.(button width 66.67dp :
> 66.67dp(100px*160/240))
>
> 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] Backup file

2010-08-09 Thread Mark Murphy
On Mon, Aug 9, 2010 at 5:19 PM, Arthur Neves  wrote:
> Ok, this is the thing that I wanna make sure,... so I have to make one
> screen for it, right?

How you implement it from a UI standpoint is up to you. An activity
with options to back up and restore the data seems like a reasonable
choice, though.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

-- 
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] Detecting activity' fresh start

2010-08-09 Thread Pinheiro
Hi!

How can we detect if an Activity is run for the 1st time? I mean, it's
run just after the user clicked on the icon in the homescreen and not
after some event like screen rotation?

For instance:

public class Incoming extends Activity {
private boolean firstrun=true;

@Override
public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);

if (firstrun) {  // This is always run
firstrun=false;
... do some heavy work (import a database from the
web, etc)
}

The variable firstrun is always true. I've tried to change the
firstrun value in onResume but it's called after and not before
onCreate.

Is there a simple way to do this or will I have to resort to capture
screen orientation using onConfigurationChange?

Thanks in advance!

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


[android-developers] Launching barcode reading from browser

2010-08-09 Thread m
On the Google Products page, from an Android device, there is a "scan
barcode" button that launches a 3rd party barcode scanning app, which
returns results back to the browser.

1)  How did they do this?
2)  Is this available for any web developer to do, or a Google ->
Google api only?

-- 
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: Can't make restartPackage() / killBackgroundProcesses() to work

2010-08-09 Thread Indicator Veritatis
That depends on where you draw your line to decide what is in and
outside of the "black box". If you use JUnit, and have all your
Applications under test inherit from the basic test (TestCase), can't
you get the "black box" test effect you desire?

On Aug 9, 3:56 am, Fabrizio Giudici 
wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 8/9/10 04:03 , Dianne Hackborn wrote:
>
> > Well if you need it, write your own code to do it.  They are your
> > apps, right?  You can have a way for them to interact to have one
> > ask the other to kill itself -- send a broadcast to it, have a
> > service to bind to to send a command to it, or heck even just have
> > an instrumentation test case that does a self-murder and run that
> > between every real test case.
>
> It's what I'm doing in other cases, but this wouldn't be a black-box
> testing.
>
> > (Note from looking at your manifest -- applications have never
> > been able to get the INJECT_EVENT permission, so there is no reason
> > to request it.)
>
> Yes, it's a residual for other tries. Thanks.
>
> - --
> Fabrizio Giudici - Java Architect, Project Manager
> Tidalwave s.a.s. - "We make Java work. Everywhere."
> java.net/blog/fabriziogiudici -www.tidalwave.it/people
> fabrizio.giud...@tidalwave.it
> -BEGIN PGP SIGNATURE-
> Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkxf3uIACgkQeDweFqgUGxfR9gCfThS8ssQCOpmiH2O+DZv4jtpb
> fg8An1grVKrBcaBFyUdnhVgjAOyRJMsB
> =C1du
> -END PGP SIGNATURE-

-- 
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] Backup file

2010-08-09 Thread Arthur Neves
Ok, this is the thing that I wanna make sure,... so I have to make one
screen for it, right?

On Mon, Aug 9, 2010 at 5:16 PM, Mark Murphy  wrote:

> On Mon, Aug 9, 2010 at 5:11 PM, Arthur Neves  wrote:
> > No, I did not reject, I just reject the idea to send the backup file to a
> > server, because I don`t have a server, and also this files cannot go a
> > server side because they have some information that must be safe.
>
> That's rejecting the BackupManager solution, because it only goes to
> Google's servers. There is no other built-in alternative.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
> Available!
>
> --
> 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: on sdcard, File.canRead() = true, File.canWrite() = false

2010-08-09 Thread john brown
SOLVED! THANK YOU Android-Developers group!

Thank you so much for your help. It is wonderful to have someplace to
go for answers.

John Brown

On Aug 9, 11:59 am, john brown  wrote:
> Hello,
>
> Documentation source 
> >http://developer.android.com/guide/topics/data/data-storage.html
>
> "Every Android-compatible device supports a shared "external storage"
> that you can use to save files. This can be a removable storage media
> (such as an SD card) or an internal (non-removable) storage. Files
> saved to the external storage are world-readable and can be modified
> by the user when they enable USB mass storage to transfer files on a
> computer."
>
> PROBLEM: I cannot write to a file on the sdcard.
> QUESTION: Is it possible to write to a file on the sdcard?
>
> If YES, what do I need to do to make File.canWrite = true?
>
> I am using Android 2.1 update 1, API level 7, Eclipse, and HVGA skin.
>
> I am running my app / troubleshooting on the Android SDK ADV.
>
> When the AVD is running, I check settings > sdcard total 49.21MB,
> available 49.07MB.
>
> Environment.getExternalStorageState() yields > MEDIA_MOUNTED
>
> getExternalStorageDirectory() to establish the sdcard root directory.
>
> I copied the files to the sdcard with "adb push source destination"
>
> I am able to successfully read other files in that directory.
>
> psudo code:
> // __
> File fFile = new File(pathFile);
> if (fFile.exists()){ ... // returns true
> if (fFile.canRead()){ ... // returns true
> if (fFile.canWrite()){ ... // returns false
> try{
>         FileWriter Fw = new FileWriter(fFile, true);
>         BufferedWriter Bw = new BufferedWriter(Fw);
>         PrintWriter outPw = new PrintWriter(Bw, true);
>         outPw.println(strRec);
>         outPw.close();
>
> }
>
> catch(IOException ex){
>         System.out.println("IO Error - " + ex.toString());
>         System.exit(0);
>
> }
>
> // 
>
> System.out shows:
> IO Error - java.io.FileNotFoundException
> but we know the file is there from the preceding checks:
> if (fFile.exists()){ ... // returns true
> if (fFile.canRead()){ ... // returns true
>
> What do I need to do to make the file writable?
> Or
> I want to write to the file. What am I doing wrong?
>
> Thanks, John Brown
>
> P.S.
> I got a command prompt via c:\Program Files\Android-SDK\tools> adb
> shell
>
> # ls -l /sdcard/Android/data/lms
> rwxr-x system    sdcard_rw        63   2010-07-19 15:17
> mpReadAbDdx201006.txt
> rwxr-x system    sdcard_rw     45211   2010-07-19 15:17
> mpTranAbDdx201006.txt
>
> The way I read this is that the owner's rights are ---, group is rwx,
> others is r-x. I'm just guessing, the application is others?
>
> But I cannot get chmod to change the attributes, i.e.:
>
> # chmode o-rwx /sdcard/Android/data/lms/mpReadAbDdx201006.txt
> Bad mode
>
> (I get the same file attributes when I copy file to sdcard via  DDMS
> File Explorer.)
>
> Where can I find documentation to the Android linux (?) commands? (I
> mean the command line commands)

-- 
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] Backup file

2010-08-09 Thread Mark Murphy
On Mon, Aug 9, 2010 at 5:11 PM, Arthur Neves  wrote:
> No, I did not reject, I just reject the idea to send the backup file to a
> server, because I don`t have a server, and also this files cannot go a
> server side because they have some information that must be safe.

That's rejecting the BackupManager solution, because it only goes to
Google's servers. There is no other built-in alternative.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

-- 
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: Content provider doubt

2010-08-09 Thread Indicator Veritatis
Kostya hit the nail on the head: the biggest benefit provided by
ContentProvider and ContentResolver is probably just that, that it
provides lifecycle management on top of database queries.

There are also other benefits, such as insulating from the particulars
of database, but since we are tied to SQLite3 anyway, I don't see this
as nearly as big. Plus, it is a nuisance that the interface 'leaks' a
cursor -- forcing you to make it look like a database even in the rare
case where there is no database behind the ContentProvider:(

But that lifecycle management is a major benefit, since you really
would not want to handle releasing and re-acquiring database
connections etc. all on your own without that support.

ContentProvider also provides consistent means for sharing data
between applications, not just between application components of a
single activity.

On Aug 9, 2:36 am, Sohan badaya  wrote:
> Hi All,
>
> I have a doubt about content provider. Why we use content provider?
> can't we use database of a application?
> If we talk about other application also. can't we use database of that
> application directly wihout
> content provider?
>
> Thanks,
> Sohan

-- 
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: Yet another Droid OpenGL texture problem

2010-08-09 Thread Mike
I am. That's what's so perplexing.

On Aug 9, 3:56 pm, Tom  wrote:
> Make sure that you are loading your textures from the drawable-nodpi
> resource 
> directory:http://www.anddev.org/opengl_textures_-_motorola_droid-t10930.html
>
> On Aug 9, 1:07 pm, Mike  wrote:
>
>
>
> > I'm getting white (blank) textures on everything when running on the
> > Droid and Galaxy S devices.
> > My textures are all power-of-two PNGs and they're in the /res/drawable-
> > nodpi folder.
>
> > Here's my code:
>
> > public GLTextures(GL10 gl, Context context) {
> >                 if(gl==null)return;
> >                 this.gl = gl;
> >                 this.context = context;
> >                 this.textureMap = new java.util.HashMap();
> >                 sBitmapOptions.inPreferredConfig = Bitmap.Config.RGB_565;
>
> >         }
>
> >         public void freeTexs(){
> >                 gl.glDeleteTextures(textures.length, textures,0);
> >                 textureFiles = null;
> >         }
>
> >         public void loadTextures() {
> >                 if(gl==null)return;
> >                 int[] tmp_tex = new int[textureFiles.length];
> >                 gl.glGenTextures(textureFiles.length, tmp_tex, 0);
> >                 textures = tmp_tex;
> >                 for (int i = 0; i < textureFiles.length; i++) {
>
> >                         this.textureMap.put(new Integer(textureFiles[i]), 
> > new Integer(i));
> >                         int tex = tmp_tex[i];
>
> >             gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);
> >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
> >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST);
>
> >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
> >             gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> > GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);
> >             gl.glTexEnvf(GL10.GL_TEXTURE_ENV,
> > GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE);
>
> >             InputStream is =
> > context.getResources().openRawResource(textureFiles[i]);
> >             Bitmap bitmap;
> >             try {
> >                 bitmap = BitmapFactory.decodeStream(is, null,
> > sBitmapOptions);
> >             } finally {
> >                 try {
> >                     is.close();
> >                 } catch (IOException e) {
> >                     // Ignore.
> >                 }
> >             }
>
> >             buildMipmap(gl, bitmap, tex);
> >             bitmap.recycle();
>
> >                 }
> >         }
>
> > private void buildMipmap(GL10 gl, Bitmap bmp, int tex) {
> >                 //
> >                 int level = 0;
> >                 //
> >                 int height = bmp.getHeight();
> >                 int width = bmp.getWidth();
>
> >                 while (height >= 1 || width >= 1) {
> >                         GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, bmp, 
> > 0);
>
> >                         if (height == 1 || width == 1) {
> >                                 break;
> >                         }
> >                         // Increase the mipmap level
> >                         level++;
> >                         //
> >                         height /= 2;
> >                         width /= 2;
> >                         Bitmap bitmap2 = Bitmap.createScaledBitmap(bmp, 
> > width, height,
> > true);
> >                         // Clean up
> >                         bmp.recycle();
> >                         bmp = bitmap2;
> >                 }
> >         }
>
> > Here's my setup code in my renderer's onSurfaceCreated method:
>
> >                                 // Define the lighting
> >                 float lightAmbient[] = new float[] { 1f, 1f, 1f, 1 };
> >                 float lightDiffuse[] = new float[] { 1, 1, 1, 1 };
> >                 float[] lightPos = new float[] { 0, 0, 0, 1};
> >                 gl.glEnable(GL10.GL_LIGHTING);
> >                 gl.glEnable(GL10.GL_LIGHT0);
> >                 gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lightAmbient, 
> > 0);
> >                 gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightDiffuse, 
> > 0);
> >                 gl.glLightf(GL10.GL_LIGHT0, GL10.GL_CONSTANT_ATTENUATION, 
> > 1.0f);
> >                 gl.glLightf(GL10.GL_LIGHT0, GL10.GL_LINEAR_ATTENUATION, 
> > 0.01f);
> >                 gl.glLightf(GL10.GL_LIGHT0, GL10.GL_QUADRATIC_ATTENUATION, 
> > .1f);
> >                 gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPos, 0);
>
> >                 // Define the materials
> >                 float matAmbient[] = new float[] {1, 1, 1, 1 };
> >                 float matDiffuse[] = new float[] {1, 1, 1, 1 };
> >                 gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_AMBIENT, 
> > matAmbient,
> > 0);
> >                 gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_DIFFUSE, 
> > matDiffuse,
> > 0);
>
> >                          

Re: [android-developers] Backup file

2010-08-09 Thread Arthur Neves
No, I did not reject, I just reject the idea to send the backup file to a
server, because I don`t have a server, and also this files cannot go a
server side because they have some information that must be safe.

about this just work in Android 2.2, it`s not a problem

On Mon, Aug 9, 2010 at 5:02 PM, Mark Murphy  wrote:

> On Mon, Aug 9, 2010 at 4:54 PM, Arthur Neves  wrote:
> > yeap, cool, that`s a good solution, but in Blackberry, I don`t have to
> add a
> > screen in my app to do the backup/restore managements, the user do this
> by
> > the software(Desktop Manager) in  some PC, I just have to implements some
> > interfaces in my application and than the software can manage the
> > backup/restore.
> > Is there anything similar for android?
>
> Yes, but you rejected it in your original post on this thread. It also
> only works on Android 2.2. And I am not a terribly big fan of it:
>
>
> http://commonsware.com/blog/2010/07/11/backupmanager-unsafe-at-any-speed.html
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
> Available!
>
> --
> 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 there any API available to receive the broadcast receiver for app started.

2010-08-09 Thread Indicator Veritatis
The real solution is: study 
http://developer.android.com/guide/topics/fundamentals.html,
especially the parts on lifecycles of activities, services and
broadcast receivers (http://developer.android.com/guide/topics/
fundamentals.html#lcycles). Then take into account what Dianne said
(that there is no such broadcast). After studying that section, you
will more likely come up with the real solution to your problem. It
may help, for example, to notice that though there is no "app started"
broadcast, you can tell when your own applications/activities lose the
foreground or become invisible. This is almost the same information,
since launching another app is what causes yours to lose foreground
(device going to sleep will do this too). So you may be able to get
close enough by waiting for onPause() and onStop() events, overriding
these methods.

On Aug 8, 11:09 pm, manoj  wrote:
> Hi All,
>
> I have one question.
>
> I want to receive a broadcast receiver whenever any app is started.
>
> for example:
> I have an app which has the broadcast receiver which listens for the
> app started event .
>
> I installed this app on the device.
>
> Now I have opened the Phone or Contacts app. Now my app which is
> listening for this kind of event(app opened or started) has to be
> invoked.
>
> can any one tell me the solution?
>
> Thanks,
> Manoj.

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