Re: [android-developers] Development platform on tablets?

2011-10-11 Thread iñaki
3.x?

Regards

On 11 October 2011 07:51, P.N. peter.nabbef...@gmx.de wrote:


 Hello,

 is there any Android SDK available for use on Android tablets?

 Kind regards
 Peter

 --
 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.comandroid-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/android-developers?hl=enhttp://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: HTTP Request Handler

2011-10-11 Thread Anil Jagtap
Dear Sunil,
I have wrote something like following

http://pastebin.com/6tX9UHQS

Is that what you want?

On Oct 10, 2:16 pm, Sunil Mishra suniljmis...@gmail.com wrote:
 Can any one please provide me an example of HTTP Request Handler.
 Please its urgent.

-- 
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: SQLite concurrency

2011-10-11 Thread gjs
Hi,

If you wrap all access to your sqlite3 database with a content
provider this issue goes away.

Regards

On Oct 11, 1:30 pm, Zsolt Vasvari zvasv...@gmail.com wrote:
 Thanks.  Are you saying that I should just open the database once?
 Right now, I am closing it in each Activity's onDestory().  I
 shouldn't worry about closing the database at all?

 On Oct 11, 10:09 am, Mark Murphy mmur...@commonsware.com wrote:







  Try having both components are using the same SQLiteDatabase object
  (e.g., via a singleton). SQLiteDatabase has its own thread-safety
  logic, but that only works with one instance, not across multiple
  instances.

  On Mon, Oct 10, 2011 at 9:53 PM, Zsolt Vasvari zvasv...@gmail.com wrote:
   Hello, I have my app with its UI and a periodic Service both accessing
   the same SQLite database.

   It appears when the Service is trying to hit the database and the UI
   has it open, I am getting a SQLiteException:

   android.database.sqlite.SQLiteDiskIOException: disk I/O error
   at android.database.sqlite.SQLiteDatabase.native_setLocale(Native
   Method)
   at
   android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:
   2101)
   at android.database.sqlite.SQLiteDatabase.init(SQLiteDatabase.java:
   1969)
   at
   android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:
   902

   I am opening the database see that I can call
   isDbLockedByCurrentThread() on it, but it's not even getting that
   far.  It's kind of like a chicken/egg situation as I cannot open the
   database to see it's locked, because it's crashing first.

   I am using SQLiteDatabase.openDatabase(this.file, null,
   SQLiteDatabase.OPEN_READWRITE) to open the database.

   Anybody has a clue how to get around this?

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

  --
  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 2.0
  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: Is it possible a nested JAR in JAR?

2011-10-11 Thread gjs
Hi,

See http://www.ibm.com/developerworks/java/library/j-onejar/

Regards

On Oct 11, 9:16 am, Kristopher Micinski krismicin...@gmail.com
wrote:
 What do you want to do?  You have a jar you're using in your app, and
 you want to replace it with somebody else's jar file?  Why can't you
 just drop it in and replace it?  This isn't too android specific,
 however..

 Kris







 On Mon, Oct 10, 2011 at 5:56 PM, Build account newandroi...@gmail.com wrote:
  Hello.

  Is it possible repackage a my custom JAR with another JAR(which may
  came from others)
  for only another developer's convienence. Not the illegal purpose.

  Possible? then how?

  Please comment me.

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

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


[android-developers] Re: Development platform on tablets?

2011-10-11 Thread P.N.
Haven't got a tablet with 3.x, yet, but I know 3.x is making them 
interesting. However, I've not seen any news about developing on 3.x 
directly - AFAIK I need a PC for Java development.


However, I've noticed, script development IS possible using SL4A.

Regards
Peter



iñaki schrieb:

3.x?

Regards

On 11 October 2011 07:51, P.N. peter.nabbef...@gmx.de
mailto:peter.nabbef...@gmx.de wrote:


Hello,

is there any Android SDK available for use on Android tablets?

Kind regards
Peter

--
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
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+__unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/__group/android-developers?hl=en
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] Can I save the wallpaper?

2011-10-11 Thread Perry168
Hi,

How can I  backup the current wallpaper? Also, does any method to
check the wallpaper is a livewallpaper or not?

Thanks a lot!

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


[android-developers] Unit testing methods containing Handler

2011-10-11 Thread lou
Hi !
I have a problem.
I have a class MyObject that has a method start() :

public class MyObject {

  public void start() {
Handler h = new Handler();
new Thread() {
  @Override
  public void run() {
super.run();

h.post(new Runnable() {
  @Override
  public void run() {
mIsRunning = true;
onStart();
  }
});

  }
}.start();
  }

}

I'm trying to test that onStart() callback is called.
I'm using AndroidTestCase class, and my test looks like this :

@UiThreadTest
public void testOnStartIsCalled() {
  mMyObject.start();
  assertTrue(mMyObject.isRunning());
}

But the Runnable posted in the Handler has never ran.
How could I test that the callback has been called ?

Thanks a lot, I'm a little bit hopeless...

Regards

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


[android-developers] Button/ImageButton Rotation Not working

2011-10-11 Thread Chenna
Hi

I am trying to create a Button/ImageButton and rotating to required
degrees. I can able to rotate ImageView but same not working for
Button/ImageButton

ImageButton homeButton = new ImageButton (context);
homeButton.setOnClickListener(homeButtonListener);

 
homeButton.setScaleType(android.widget.ImageView.ScaleType.MATRIX);
 
homeButton.setBackgroundResource(ScannerConfiguration.homeButtonResource); //
0x7f020001

matrix = new Matrix();
matrix.postRotate(270F);
//matrix.preTranslate(-((float)20 * density), -(height -10));
matrix.postTranslate((float)20 * density, height -10);

homeButton.setImageMatrix(matrix);

Please let me know anything needs to be done.

thanks
Chenna

-- 
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: SQLite concurrency

2011-10-11 Thread rich friedel
@Zsolt Vasvari Just a quick thought for you... Consider closing stuff like 
the database/database adapter in your onPause() method of the Activity. 
onPause is always called where onDestroy is called whenever, thus the 
database might still be open when it is expected to be closed. I tend to 
close close, unregister, etc.. stuff in the onPause and open, register them 
in the onResume methods.

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

2011-10-11 Thread Naveen
I want to play video file from application context row directory

MediaPlayer mediaPlayer = MediaPlayer.create(context,
R.raw.sound_file_1);
mediaPlayer.start(); // no need to call prepare(); create() does that
for you


This video contains size is 19.5 MB  facing error :

 Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
Please check logcat output for more details.
 Launch canceled!

Please help me can i able to play 19MB from raw directory

-- 
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] cannot make full functionality of lock slider with the use of seek bar

2011-10-11 Thread vishnu raj
converted android seek bar to lock slider but how to disable progress
change when user single tap on the Seekbar in Android

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


[android-developers] List with seperators, checkboxes...

2011-10-11 Thread BearTi
Hi,

I´ve problems to built a list for my app.
This list should have seperators, drop down menus and checkboxes.

I´ve read many tutorials, but I can´t find a good one that solves my
problem. (for expample which adapter I have to choose and so on)

Do you have a good axample for my or some tipps?

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 can i pass the complicated data from java to the native code (the c language)?

2011-10-11 Thread Doug
This is not an android specific question.  You just need to learn JNI,
and specifically how to access java objects using the JNI api.  There
are lots of resources about this that have nothing to do with Android.

Doug

On Oct 10, 3:11 am, 杨辉 yanghui1986...@gmail.com wrote:
 for example,look at the following codes:

 java code:

 class A{
 Rect mrect;

 }

 i pass an object of class A from the java to the native codes with jni.
 now i want to get the left/top/right/bottom value,how can i do?

 2011/10/10 James december...@gmail.com:









  what do you mean by all the data?
  In android, JNI is nothing special at all. use GetFieldID to access
  java class members.
  Hope this helps!

  On Oct 10, 4:07 pm, 杨辉 yanghui1986...@gmail.com wrote:
  hi,everybody,
   i have a question about jni.
   it is an android project. i want to pass all the data from java to
  the native code (c).
   for example, if now i have an object of the class A, How can i get
  the left/top/right/bottom value of the Rect in the native code?
   thank you !

   java code:

   class A{
   Rect mrect;

   }

  --
  杨辉

  --
  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: Custom DialogPreference and PreferenceManager.setDefaultValues issue

2011-10-11 Thread Thierry Legras
Hi Ibendlin,

Thanks for helping me :)

I don't think the problem is in SeekBarPreference.onSetInitialValue()
function itself as it is never called (I have put a log in it to check).
There is certainly an issue somewhere in my implementation; when
setDefaultValues is called, only SeekBarPreference constructor is called.

I was suspecting the xml, but I don't see any problem in it
(android:defaultValue is set and android:persistent as well):

com.tlegras.tools.SeekBarPreference
android:key=preferences_epg_daytostore
android:title=@string/preferences_epg_daytostore_title
android:summary=@string/preferences_epg_daytostore_summary
android:dialogMessage=Nombre de journées à télécharger.
Attention, plus ce nombre est élevé, plus le chargement sera long et moins
l'application sera réactive.
android:text= jour(s)
android:defaultValue=4
android:max=5
android:persistent=true
/


2011/10/11 lbendlin l...@bendlin.us

 it took me a few weeks to get that right.  here's my example for a boolean
 value. And yes, .setDefaultValues is actually working, despite what you may
 think :-/

@Override
 protected void onSetInitialValue(boolean restoreValue, Object
 defaultValue) {
 boolean temp = restoreValue ? getPersistedBoolean(false) :
 defaultValue.toString().equals(true) ? true : false;
 if (!restoreValue)
 persistBoolean(temp);
 this.oldValue = temp;
 }

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




-- 
Thierry.

-- 
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: HTC and LG haven't implemented Android in the right way

2011-10-11 Thread MobileVisuals
Thanks, it looks better when I added an alpha channel to the textures.
But I don't see that glBlendFunc(GL_SRC_ALPHA, GL_ONE)
made any difference. There are still black square quads, but less than
before. I tried to remove the gl.glColor4f calls, but that made the
black square quads much more visible. This is how it looks like now,
with gl.glColor4f(1f, 1f, 1f, 0.4f);

http://www.mobile-visuals.com/color4f04.png

with gl.glColor4f(1f, 1f, 1f, 0.8f);

http://www.mobile-visuals.com/color4f08.png

with no with gl.glColor4f calls:

http://www.mobile-visuals.com/noColor4f.png

This shows that with higher alpha value in glColor4f, the more black
square quads. It also shows that the
smaller alpha value in glColor4f, the more dull result. This how the
source textures looks like now:

http://www.mobile-visuals.com/trance1.png
http://www.mobile-visuals.com/star1.png
http://www.mobile-visuals.com/star2.png

I have used 2 quads for each star, placed on each other here. I tried
to only use one quad for each star. This improved the situation, but
the black squares quads are still visible:

http://www.mobile-visuals.com/onelayer.png

I tested with another texture and got better result, but there are
still black quads. They cover some of the stars, which makes these
stars not visible:

http://www.mobile-visuals.com/other.png

Is there something more that I can do to get as good result as with
Point sprites and size attenuation? I pasted my relevant code below.

draw method:

gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
gl.glEnable(GL10.GL_TEXTURE_2D);
gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glEnable(GL10.GL_BLEND);
gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE);
gl.glEnable(GL10.GL_ALPHA_TEST);
gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBufferS);
gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBufferLT);
gl.glColor4f(1f, 1f, 1f, 0.8f);
gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[1]);
gl.glDrawElements(GL10.GL_TRIANGLES, vertices*2,
GL10.GL_UNSIGNED_SHORT,
indiceBuffer);

gl.glDisable(GL10.GL_TEXTURE_2D);
gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
gl.glDisable(GL10.GL_BLEND);
gl.glDisable(GL10.GL_ALPHA_TEST);

surfaceCreated method:

gl.glEnable(GL10.GL_TEXTURE_2D);
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
gl.glClear(GL10.GL_DEPTH_BUFFER_BIT);
gl.glEnable(GL10.GL_DEPTH_TEST);
gl.glDepthFunc(GL10.GL_LEQUAL);
gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);

loadGLTexture method:

gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE,
GL10.GL_MODULATE);

bitmap1 = BitmapFactory.decodeResource(context.getResources(),
R.drawable.trance1);
gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, 
GL10.GL_TEXTURE_MIN_FILTER,
GL10.GL_NEAREST);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, 
GL10.GL_TEXTURE_MAG_FILTER,
GL10.GL_NEAREST);
GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap1, 0);

On Oct 10, 10:50 am, bdk mathieu.b...@gmail.com wrote:
 for a brighter result, try to use use additive blending:

  glBlendFunc(GL_SRC_ALPHA, GL_ONE)

 e.g.http://stackoverflow.com/questions/393785/how-to-setup-blending-for-a...

 and yes, alpha should be in the png - texture.

 best

 --
 Mathieu

 On Oct 8, 11:08 am, MobileVisuals eyv...@astralvisuals.com wrote:

  How do you mean that I should put brightness level in the textures? I
  have already enabled transparency with

  gl.glEnable(GL10.GL_BLEND);
  gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
  gl.glColor4f(1f, 1f, 1f, 0.25f);

  I see that the transparency have effect, but it doesn't work as well
  as it should. I have also noticed that the black square quads are
  visible. Do you know what I can do to get rid of the black square
  quads? Is there any way to make it as shiny and smooth as it was with
  point sprites?

  I use this call to draw the quads:

  gl.glDrawElements(GL10.GL_TRIANGLES, vertices*2,
  GL10.GL_UNSIGNED_SHORT,indiceBuffer);

  I don't think that I can use glDrawArrays,because that is for
  TriangleStripArrays. I have 1200 particles, which makes it 4800
  vertices in the array for the quads. The positions are morphed for
  each repaint. Maybe that is what is making it slow,but it was fast
  with point sprites.

  Each star particle consists of 2 quads. The star particle in the
  middle is smaller quad.  The transparent blueish blur around that
  particle is another quad. These are drawn with 2  arrays. I draw the
  most opaque array first (the star particle in the middle) and then the
  more transparent array later. This approach worked very well with
  point sprites and size attenuation, but maybe this doesn't work with
  texture mapped quads. Maye 

[android-developers] Re: Scenario where initLoader() does not call onLoadFinished()

2011-10-11 Thread kaciula
Indeed, the loader manager destroy() method is called and the field 
mDestroyed is set to true. After this, the loader manager is not functional 
anymore. In onLoadComplete() it exits if mDestroyed is set to true. So i 
guess the problem is that the loader manager for that fragment is destroyed 
but our fragment is still alive. I would venture to say that this is a bug.

It would be helpful if we find a workaround. I have a big app with a lot of 
fragments using loaders. For some, I removed setRetainInstance(true) but for 
others I must use setRetainInstance(true).

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

2011-10-11 Thread NaveenShrivastva
How to handle this situation here ...

On Tue, Oct 11, 2011 at 2:22 PM, Naveen kumarnaveen.si...@gmail.com wrote:
 I want to play video file from application context row directory

 MediaPlayer mediaPlayer = MediaPlayer.create(context,
 R.raw.sound_file_1);
 mediaPlayer.start(); // no need to call prepare(); create() does that
 for you


 This video contains size is 19.5 MB  facing error :

  Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
 Please check logcat output for more details.
  Launch canceled!

 Please help me can i able to play 19MB from raw directory

 --
 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: SQLite concurrency

2011-10-11 Thread Zsolt Vasvari
I just made the Database objects singletons as suggested by Mark.
What a fantastic idea -- this solved so many of my problems and
complexity in my app.  My app deals with a user configurable number of
databases (like files in a desktop app) and switching between them was
a pain in the b*tt.

This solved all my issues related to screen rotation, services
accessing the database, etc.  Highly recommended for anybody.

The only problem is that the datrabase is never closed.  But this is
more of a pedentic observation as there seems to be no real side
effects.  I do wish there were a onDestory() on the Application object
so I could close the databases before Android terminates my app, but
alas, there isn't.

Of course, creating a Content Provider is deseriable, but non-
practicle.  My app deals with very complex queries and since there is
currently no reason to expose my data to the outside world, a Content
Provider is not only very complicated to create, but it's also
unneccessary.

Thanks again to Mark.

On Oct 11, 4:48 pm, rich friedel rich.frie...@gmail.com wrote:
 @Zsolt Vasvari Just a quick thought for you... Consider closing stuff like
 the database/database adapter in your onPause() method of the Activity.
 onPause is always called where onDestroy is called whenever, thus the
 database might still be open when it is expected to be closed. I tend to
 close close, unregister, etc.. stuff in the onPause and open, register them
 in the onResume methods.

-- 
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] GPS locations distance

2011-10-11 Thread nageswara rao rajana
Hi,

   While walking i am capturing the route locations and placing on map.
But i am unable to get the distance travelled with those locations.So please
anyone help me in this.

 I tried this but Force close exception raising


http://www.androidsnippets.com/calculate-distance-between-two-gps-coordinates


please any one provide me same code link.

Thanking you.

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

[android-developers] Copy 20MB of file from asert folder

2011-10-11 Thread Naveen
Hello friends ,


i am using below code for copy file from asert folder , that's work
but not able to copy complete file only 9MB file copied ,

Please help me , i have already changed the byte array size with video
file size but same saze video in sdcard

private void CopyAssets() {
AssetManager assetManager = getAssets();
String[] files = null;
try {
files = assetManager.list();
} catch (IOException e) {
Log.e(tag, e.getMessage());
}
for(String filename : files) {
InputStream in = null;
OutputStream out = null;
try {
  in = assetManager.open(filename);
  out = new FileOutputStream(/sdcard/ + filename);
  copyFile(in, out);
  in.close();
  in = null;
  out.flush();
  out.close();
  out = null;
} catch(Exception e) {
Log.e(tag, e.getMessage());
}
}
}
private void copyFile(InputStream in, OutputStream out) throws
IOException {
byte[] buffer = new byte[2048];
int read;
while((read = in.read(buffer)) != -1){
  out.write(buffer, 0, read);
}
}

-- 
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] It is possible to rotate a object from his own coordinates and not from the plane coordinates?

2011-10-11 Thread saex
I am following the OpenGL es rotation examples from google to rotate a
simple Square (not a cube) on my Android App, for example this code:

gl.glRotatef(xrot, 1.0f, 0.0f, 0.0f);   //X
gl.glRotatef(yrot, 0.0f, 1.0f, 0.0f);   //Y
gl.glRotatef(zrot, 0.0f, 0.0f, 1.0f);   //Z

It works fine if you only rotate to one axis.

But if you rotate to one axis, and after that, you rotate to other
axis, the rotation is not fair. I mean that the rotation is done from
the plane (real world) coordinates and not from the square own
coordinates. I am not sure if i am explaining me fine.

-- 
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: SQLite concurrency

2011-10-11 Thread Mark Murphy
On Tue, Oct 11, 2011 at 6:13 AM, Zsolt Vasvari zvasv...@gmail.com wrote:
 The only problem is that the datrabase is never closed.  But this is
 more of a pedentic observation as there seems to be no real side
 effects.

Yeah, content providers suffer from the same issue. I fought and
fought against singleton databases and content providers, trying to
find a way to close the database, and eventually surrendered.

If you're really paranoid about it, you might rig up some sort of
inactivity timer that closes the database, and organize your singleton
to lazy-open the database if needed. This isn't a guarantee that it'll
get closed, though, as Android could terminate the process first.

Having multiple SQLiteDatabase objects is fine if (and only if) you're
only using them from one thread at a time via your own
synchronization. Or if you're accessing the databases on the main
application thread, like some balding guy I know has in one of his
books that's scheduled for an overhaul in 2012... :-)

 I do wish there were a onDestory() on the Application object
 so I could close the databases before Android terminates my app, but
 alas, there isn't.

Well, there is onTerminate(), but it's never used.

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

Android Training...At Your Office: http://commonsware.com/training

-- 
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] close application

2011-10-11 Thread Mark Murphy
On Tue, Oct 11, 2011 at 1:08 AM, venugopal reddy
venugopal.re...@tspl.com wrote:
 Now Just I close the browser and come  back to my home.(I thought  close the
 application).

You need to learn how Android works. You do not close the browser,
any more than pressing the home button in a browser closes the
browser.

 actually that application running background. once again i
 open the application ,press the my logo in application ,application is not
 open in web browser.that's  the problem,  Here i need to force to  close the
 application.

No, you don't.

 But I want close application (no need to go force stop the application),when
 i close the web browser in android emulator..

No, you don't.

For example, let us suppose that your application consists of a
single activity, where launching the activity is supposed to start the
Web browser on your desired URL. (let's ignore the fact that users
consider such applications to be completely stupid and will give it a
bunch of one-star ratings on the Market) If your activity is not
supposed to be around after you start up the Web browser, your
activity should call finish() right after it calls startActivity() to
launch the browser.

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

Android Training...At Your Office: http://commonsware.com/training

-- 
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: Development platform on tablets?

2011-10-11 Thread Mark Murphy
On Tue, Oct 11, 2011 at 3:12 AM, P.N. peter.nabbef...@gmx.de wrote:
 Haven't got a tablet with 3.x, yet, but I know 3.x is making them
 interesting. However, I've not seen any news about developing on 3.x
 directly - AFAIK I need a PC for Java development.

Correct.

You are welcome to attempt to port Java and the Android tool chain to
run on an ARM CPU, and from there attempt to get it to run on Android.
This is unlikely to be a simple process.

 However, I've noticed, script development IS possible using SL4A.

Also correct. Similarly, with a bit of tweaking, you can edit PhoneGap
applications right on a device (have the PhoneGap activity load its
HTML/CSS/JS from external storage while you're doing development,
instead of loading assets from the project).

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

Android Training...At Your Office: http://commonsware.com/training

-- 
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't upload an apk to Android Market

2011-10-11 Thread burnayev
I've been trying to upload a new apk for my application to the market
for the past hour or so with no success. Once I hit the Upload button
the progress bar stays at 0 B for a long time and then I get An
unexpected error occurred. Please try again later.

Is there a maintenance or something going on? When is later?

Kind regards,
Borys Burnayev
actioncomplete.com
GTD for Android and Web

-- 
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: Scenario where initLoader() does not call onLoadFinished()

2011-10-11 Thread kaciula
I noticed that this problem doesn't appear if I use a ListFragment with a 
CursorLoader/AsyncTaskLoader and setRetainInstance(true). It only happens 
when I use a basic Fragment with CursorLoader/AsyncTaskLoader and 
setRetainInstance(true).

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

Re: [android-developers] Can't upload an apk to Android Market

2011-10-11 Thread Rafael Maas
I did an upload a few hours ago!


2011/10/11 burnayev burna...@gmail.com:
 I've been trying to upload a new apk for my application to the market
 for the past hour or so with no success. Once I hit the Upload button
 the progress bar stays at 0 B for a long time and then I get An
 unexpected error occurred. Please try again later.

 Is there a maintenance or something going on? When is later?

 Kind regards,
 Borys Burnayev
 actioncomplete.com
 GTD for Android and Web

 --
 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: Can't upload an apk to Android Market

2011-10-11 Thread Shawn Holland
I'm having the exact same problem. I ran a wireshark trace. It looks
like the page tries to send the APK file up multiple times with no
response from the server.

-Shawn

On Oct 11, 7:15 am, burnayev burna...@gmail.com wrote:
 I've been trying to upload a new apk for my application to the market
 for the past hour or so with no success. Once I hit the Upload button
 the progress bar stays at 0 B for a long time and then I get An
 unexpected error occurred. Please try again later.

 Is there a maintenance or something going on? When is later?

 Kind regards,
 Borys Burnayev
 actioncomplete.com
 GTD for Android and Web

-- 
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: Scenario where initLoader() does not call onLoadFinished()

2011-10-11 Thread Mark Murphy
If anyone on this thread who is experiencing this problem can cook up
a simple example exhibiting the behavior and upload it somewhere, I'd
be interested to take a peek at it.

Thanks!

On Tue, Oct 11, 2011 at 7:53 AM, kaciula catalin.moro...@gmail.com wrote:
 I noticed that this problem doesn't appear if I use a ListFragment with a
 CursorLoader/AsyncTaskLoader and setRetainInstance(true). It only happens
 when I use a basic Fragment with CursorLoader/AsyncTaskLoader and
 setRetainInstance(true).

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

Android Training...At Your Office: http://commonsware.com/training

-- 
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] Custom compass image bounds in subclassed MyLocationOverlay

2011-10-11 Thread TreKing
On Mon, Oct 10, 2011 at 11:13 PM, stephen stephen.trai...@gmail.com wrote:

 How do you set the bounds of the custom imagery so that calls
 to drawCompass set the required bounds on the canvas object?


You could try saving the current state of the Canvas, doing your drawing,
then restoring it.

-
TreKing http://sites.google.com/site/rezmobileapps/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] List with seperators, checkboxes...

2011-10-11 Thread TreKing
On Tue, Oct 11, 2011 at 4:03 AM, BearTi mlrti...@googlemail.com wrote:

 I´ve read many tutorials, but I can´t find a good one that solves
 my problem. (for expample which adapter I have to choose and so on)

 Do you have a good axample for my or some tipps?


What, exactly, is your problem?

-
TreKing http://sites.google.com/site/rezmobileapps/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: GPS locations distance

2011-10-11 Thread lbendlin
which of the three (independent) methods did you use?

-- 
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: SQLite concurrency

2011-10-11 Thread Zsolt Vasvari
No, I am not worried about the database not closed.  I don't think it
can lead to data corruption.

On Oct 11, 6:55 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Tue, Oct 11, 2011 at 6:13 AM, Zsolt Vasvari zvasv...@gmail.com wrote:
  The only problem is that the datrabase is never closed.  But this is
  more of a pedentic observation as there seems to be no real side
  effects.

 Yeah, content providers suffer from the same issue. I fought and
 fought against singleton databases and content providers, trying to
 find a way to close the database, and eventually surrendered.

 If you're really paranoid about it, you might rig up some sort of
 inactivity timer that closes the database, and organize your singleton
 to lazy-open the database if needed. This isn't a guarantee that it'll
 get closed, though, as Android could terminate the process first.

 Having multiple SQLiteDatabase objects is fine if (and only if) you're
 only using them from one thread at a time via your own
 synchronization. Or if you're accessing the databases on the main
 application thread, like some balding guy I know has in one of his
 books that's scheduled for an overhaul in 2012... :-)

  I do wish there were a onDestory() on the Application object
  so I could close the databases before Android terminates my app, but
  alas, there isn't.

 Well, there is onTerminate(), but it's never used.

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

 Android Training...At Your Office:http://commonsware.com/training

-- 
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] Video streaming

2011-10-11 Thread mohana priya
Hello android developers.In my android application i need to capture
the video instead of capturing picture.Please tell how to do so.Please
tell me the solution.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


Re: [android-developers] GPS locations distance

2011-10-11 Thread TreKing
On Tue, Oct 11, 2011 at 5:17 AM, nageswara rao rajana nagu.raj...@gmail.com
 wrote:

  I tried this but Force close exception raising


Did you try debugging your app?

-
TreKing http://sites.google.com/site/rezmobileapps/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: Can't upload an apk to Android Market

2011-10-11 Thread Zsolt Vasvari
Yes, it's down.  Can't say I am shocked.

On Oct 11, 8:06 pm, Shawn Holland seholl...@gmail.com wrote:
 I'm having the exact same problem. I ran a wireshark trace. It looks
 like the page tries to send the APK file up multiple times with no
 response from the server.

 -Shawn

 On Oct 11, 7:15 am, burnayev burna...@gmail.com wrote:



  I've been trying to upload a new apk for my application to the market
  for the past hour or so with no success. Once I hit the Upload button
  the progress bar stays at 0 B for a long time and then I get An
  unexpected error occurred. Please try again later.

  Is there a maintenance or something going on? When is later?

  Kind regards,
  Borys Burnayev
  actioncomplete.com
  GTD for Android and Web- 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


Re: [android-developers] It is possible to rotate a object from his own coordinates and not from the plane coordinates?

2011-10-11 Thread TreKing
On Tue, Oct 11, 2011 at 5:52 AM, saex elpablos...@gmail.com wrote:

 But if you rotate to one axis, and after that, you rotate to other
 axis, the rotation is not fair. I mean that the rotation is done from
 the plane (real world) coordinates and not from the square own
 coordinates.


This isn't an Android problem. Google terms to search for: Object Space,
World Space, and OpenGL coordinate System.

-
TreKing http://sites.google.com/site/rezmobileapps/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: Can't upload an apk to Android Market

2011-10-11 Thread Pent
 Yes, it's down.  Can't say I am shocked.

I think I broke it

I was in the middle of an upload and killed the browser before it
finished, after that uploads just hung.

I carelessly and neglectfully endangered fragile infrastructure,
sorry :-(

Pent

-- 
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] sending email automatically

2011-10-11 Thread arun kumar
SMTP means simple mail transfer protocol. first search in google about
smtp in android and then you got some idea...
On 10/10/11, rahul verma rahulsgonnar...@gmail.com wrote:
 What is SMTP?

 On 10 Oct 2011 06:16, rahul verma rahulsgonnar...@gmail.com wrote:

 Yeah i too need to know that. .whenever we try to send a mail a gmail app
 screen comes ,what is the way to omit that i mean send the mail
 automatically


 On 8 Oct 2011 22:43, Palike palo...@centrum.sk wrote:

 Hi, at first sorry for my English

 --
 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: Development platform on tablets?

2011-10-11 Thread lbendlin
Here's a fun thing I saw recently

http://twitpic.com/67pibs

-- 
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 store AlarmManager object in to shared preference..........

2011-10-11 Thread saran vonteddu
Hi all,

  I'm working on AlarmClock application.  When ever my application
is killed due to low memory,
I want to retain some objects, so I want to store the
instance in SharedPreference so that I can retrieve
it whenever I needed. So I want to convert an Object into a String and
 store that String in sharedpreference.
I would like to store *AlarmManager* object , for that I'm using
ObjectSerializer.java to convert AlarmManager object to String.

  Below is the code I'm using


AlarmManager alarmManager = (AlarmManager) getSystemService(*ALARM_SERVICE*
);

String alarmString = ObjectSerializer.*serialize*(alarmManager);

AlarmManager *alarmMgr* = ObjectSerializer.*deserialize*(alarmString);

alarmManager.set(AlarmManager.*RTC_WAKEUP*, System.*currentTimeMillis*()

+ (i * 1000), pendingIntent);

Toast.*makeText*(*this*, Alarm set in  + i +  seconds,

Toast.*LENGTH_LONG*).show();

I'm getting the following error.

10-11 18:10:49.015: INFO/System.out(13048):
**Exception*IOE*java.io.NotSerializableException:
com.lge.ObjectSerialize.PersistentTime

How to resolve this issue. Atleast is there any way to store
AlarmManager object into Shared Preference so dat I can use the object wen
the

application is killed.

Any help in this regard would be highly appreciated.



thanks in advance,

Saran

-- 
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 store AlarmManager object in to shared preference..........

2011-10-11 Thread Mark Murphy
On Tue, Oct 11, 2011 at 8:54 AM, saran vonteddu saran.myw...@gmail.com wrote:
   I'm working on AlarmClock application.  When ever my application
 is killed due to low memory,
 I want to retain some objects, so I want to store the
 instance in SharedPreference so that I can retrieve
 it whenever I needed.

That is not a typical pattern.

 So I want to convert an Object into a String and
  store that String in sharedpreference.

That is a less-typical pattern.

 I would like to store AlarmManager object , for that I'm using
 ObjectSerializer.java to convert AlarmManager object to String.

That is simply impossible. AlarmManager is a system service. You
cannot persist it. If you are going to persist objects, persist your
own objects, please.

 How to resolve this issue. Atleast is there any way to store
 AlarmManager object into Shared Preference so dat I can use the object wen
 the

 application is killed.

You do not need to persist the AlarmManager, which is good, because
you cannot persist the AlarmManager. Simply call getSystemService()
whenever you need the AlarmManager.

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

Android Training...At Your Office: http://commonsware.com/training

-- 
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] is it necessary to register to c2dm every time app runs?

2011-10-11 Thread Hitendrasinh Gohil
Hi,

I want to apply push notification to my app.and found below  link
helpful.
http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html.

Here is the content from this site.

2.2. Getting the registration ID for the mobile app

To register your Android app for the C2DM service you fire an
registration intent com.google.android.c2dm.intent.REGISTER. This
will trigger a service which will send the registration to the Google
C2DM servers.

The intent includes a mail address in the sender extra and a
PendingIntent with the app extra. The PendingIntent gives the
Android system information about the current application. The sender
is typical an email address but is currently not used.

is it necessary to register the app every time it starts(assuming
service was stoped)?

-- 
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 profile information from twitter in android application?

2011-10-11 Thread Shruthi Varma
Hi All,

How to get user's personal informatio​n like first-name, last-name,
date-of-birth from twitter in my applicatio​n?

I went through these links. But It didn't work for me.

https://dev.twitter.com/docs/api#oauth

https://dev.twitter.com/docs/api/1/get/account/verify_credentials


Please help.


Regards,
Shruthi.



On Wed, Sep 28, 2011 at 7:23 PM, Shruthi Varma
shruthi.tlis...@gmail.com wrote:
 Hi All,

 I am developing an application in which the user can login through
 facebook and twitter
 Then I have to access their profile information (such as First Name,
 Last ame etc) from facebook or twitter.

 Using Facebook sdk, I can get the information.
 But I don't know how to get the profile information from twitter.

 Please help me with the API to get profile information from twitter.


 Regards,
 Shruthi.


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


Re: [android-developers] Re: How to get profile information from twitter in android application?

2011-10-11 Thread Mark Murphy
On Tue, Oct 11, 2011 at 9:27 AM, Shruthi Varma
shruthi.tlis...@gmail.com wrote:
 How to get user's personal information like first-name, last-name,
 date-of-birth from twitter in my application?

 I went through these links. But It didn't work for me.

 https://dev.twitter.com/docs/api#oauth

 https://dev.twitter.com/docs/api/1/get/account/verify_credentials


 Please help.

This is not a Twitter support list. This is an Android SDK support list.

Please contact Twitter for your Twitter-related questions.

-- 
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 2.0
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: Does Android Support SOAP web service?

2011-10-11 Thread Streets Of Boston
If you control both the development of both the Android app and the server, 
i would suggest REST. 
Google SOAP vs REST to see why I suggest REST for mobile development :-)

-- 
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: SQLite concurrency

2011-10-11 Thread Chris


On Tuesday, October 11, 2011 6:55:08 AM UTC-4, Mark Murphy (a Commons Guy) 
wrote:

 On Tue, Oct 11, 2011 at 6:13 AM, Zsolt Vasvari zvas...@gmail.com wrote:

  I do wish there were a onDestory() on the Application object
  so I could close the databases before Android terminates my app, but
  alas, there isn't.

 Well, there is onTerminate(), but it's never used.

While its not as bulletproof as an onDestroy or onTerminate, for various 
reasons I keep a reference count on the number of activities my app opens.  
When the reference count goes to zero I cleanup stuff on the app scope, 
assuming that the Application context is going away soon.

Maybe it'll 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

[android-developers] unable to upload app to android market

2011-10-11 Thread vandana toshniwal
Hey

i am not able to upload applications to android market.

When i select the apk file and click upload. it does nothing and after 5 to
10mins i get an error message something went wrong.

Please let me know what the problem could be.

Regards

Vandana Toshniwal

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

[android-developers] Re: Is it possible a nested JAR in JAR?

2011-10-11 Thread Ron
http://code.google.com/p/jarjar/

On Oct 10, 4:56 pm, Build account newandroi...@gmail.com wrote:
 Hello.

 Is it possible repackage a my custom JAR with another JAR(which may
 came from others)
 for only another developer's convienence. Not the illegal purpose.

 Possible? then how?

 Please comment me.

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


[android-developers] Re: unable to upload app to android market

2011-10-11 Thread b0b
Same here.

-- 
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: HTC and LG haven't implemented Android in the right way

2011-10-11 Thread Latimerius
Hello, my guess would be you don't sort your transparent sprites
back-to-front, do you?

For a couple more comments please see inline:

On Tue, Oct 11, 2011 at 11:51 AM, MobileVisuals
eyv...@astralvisuals.com wrote:
 before. I tried to remove the gl.glColor4f calls, but that made the
 black square quads much more visible. This is how it looks like now,
 with gl.glColor4f(1f, 1f, 1f, 0.4f);

 http://www.mobile-visuals.com/color4f04.png

 with gl.glColor4f(1f, 1f, 1f, 0.8f);

 http://www.mobile-visuals.com/color4f08.png

 with no with gl.glColor4f calls:

 http://www.mobile-visuals.com/noColor4f.png

 This shows that with higher alpha value in glColor4f, the more black
 square quads. It also shows that the
 smaller alpha value in glColor4f, the more dull result.

glColor() used with texturing simply modulates the texel colours in
your case.  By specifying (1,1,1, 1) you leave the hue alone but add
0.4f or 0.8f transparency.  Smaller alpha means dull because whatever
you draw becomes almost transparent.  Similarly, higher alpha means
what you draw is more visible, including the black artifacts.

 This how the
 source textures looks like now:

 http://www.mobile-visuals.com/trance1.png
 http://www.mobile-visuals.com/star1.png
 http://www.mobile-visuals.com/star2.png

BTW apart from star1.png these assets don't look correctly authored to
me.  I don't know exactly what you're trying to achieve but I believe
trance1.png and star2.png wouldn't work on a non-black background.

 I have used 2 quads for each star, placed on each other here.

This is where the above might bite you.  If you draw say star2.png
over trance1.png the black component in star2.png's pixels will start
to show.  I don't know if that's a problem for you, depends on what
your objectives are.

 gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE);

Make sure your art *doesn't* have premultiplied alpha.  If it does
then specifying GL_SRC_ALPHA would apply the alpha once more causing
transparent pixels to darken.  You'd need GL_ONE in that case.

 gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE,
                                GL10.GL_MODULATE);

I believe this is the default so you could just as well leave it out.

-- 
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 store cookies in an application for future use?

2011-10-11 Thread Shruthi Varma
Hi All,

In my application, I get all the cookies from the post requests with
the HttClient.getCookieStore method.

I want to save these cookies so the next time the app is started, the
user don't have to log in.

I don't know how to save the cookies in an application.

Because in the shared preferences, only primitive types (strings,
integers, boolean values) can be stored.

If I store the cookie value in the form of a string. I don't know how
to set it to HttClient.setCookieStore(CookieStore); when the
aplication starts again

Please help me.

Thanks and Regards,
Shruthi.

-- 
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: SQLite concurrency

2011-10-11 Thread AndyD


On Oct 11, 9:52 am, Chris crehb...@gmail.com wrote:

 While its not as bulletproof as an onDestroy or onTerminate, for various
 reasons I keep a reference count on the number of activities my app opens.  
 When the reference count goes to zero I cleanup stuff on the app scope,
 assuming that the Application context is going away soon.

 Maybe it'll help?

I'm suddenly having some painful COM IUnknown flashbacks :-)

-- 
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: SQLite concurrency

2011-10-11 Thread Christopher Van Kirk
It would be odd to add a close method to a system that wasn't needed for 
some reason.


On 10/11/2011 8:28 PM, Zsolt Vasvari wrote:

No, I am not worried about the database not closed.  I don't think it
can lead to data corruption.

On Oct 11, 6:55 pm, Mark Murphymmur...@commonsware.com  wrote:

On Tue, Oct 11, 2011 at 6:13 AM, Zsolt Vasvarizvasv...@gmail.com  wrote:

The only problem is that the datrabase is never closed.  But this is
more of a pedentic observation as there seems to be no real side
effects.

Yeah, content providers suffer from the same issue. I fought and
fought against singleton databases and content providers, trying to
find a way to close the database, and eventually surrendered.

If you're really paranoid about it, you might rig up some sort of
inactivity timer that closes the database, and organize your singleton
to lazy-open the database if needed. This isn't a guarantee that it'll
get closed, though, as Android could terminate the process first.

Having multiple SQLiteDatabase objects is fine if (and only if) you're
only using them from one thread at a time via your own
synchronization. Or if you're accessing the databases on the main
application thread, like some balding guy I know has in one of his
books that's scheduled for an overhaul in 2012... :-)


I do wish there were a onDestory() on the Application object
so I could close the databases before Android terminates my app, but
alas, there isn't.

Well, there is onTerminate(), but it's never used.

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

Android Training...At Your Office:http://commonsware.com/training


--
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 store cookies in an application for future use?

2011-10-11 Thread Mark Murphy
On Tue, Oct 11, 2011 at 10:46 AM, Shruthi Varma
shruthi.tlis...@gmail.com wrote:
 I don't know how to save the cookies in an application.

 Because in the shared preferences, only primitive types (strings,
 integers, boolean values) can be stored.

Use an XML file. Or a JSON file. Or a file with one cookie per line.
Or some other flat-file format. Or a database.

 If I store the cookie value in the form of a string. I don't know how
 to set it to HttClient.setCookieStore(CookieStore); when the
 aplication starts again

I imagine that you create an instance of a Cookie (e.g.,
BasicClientCookie), then call addCookie() on the CookieStore, though I
have not tried this. Since HttpClient is widely used outside of
Android, though, I would imagine you can find some posts or something
that describe how to do this.

-- 
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 2.0
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] HorizontalListView inside a VerticalListView

2011-10-11 Thread Marcos Paulo
Hi guys,

I need to do a HorizontalScrollView inside a listview like we have
in pulse app.

I found this guy that made an implementation of a horizontal listview -
http://www.dev-smart.com/archives/34
So I took his HorizontalListView and added it to a ListView, and it worked,
I could do something like pulse app but
there is a problem. When I am scrolling horizontally, when I accidentally
scroll vertically, the HorizontalListView stops
scrolling and the VerticalListView takes place... I need to block the
VerticalListView when I am scrolling horizontally and
vice-versa.

Can someone help me please? Pulse app works like that so I know it's
possible.

Many Thanks,
--
*Marcos Paulo Damasceno*
Software Developer.
@_marcospaulo_
http://devforfun.com/
http://github.com/marcospaulo
http://www.delicious.com/marcospaulo_

-- 
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 store cookies in an application for future use?

2011-10-11 Thread Christopher Van Kirk
Isn't the point of cookies that all this sort of work is done for you? 
If not, then perhaps you should consider storing (and accessing) the 
data in an alternative way.


On 10/11/2011 10:46 PM, Shruthi Varma wrote:

Hi All,

In my application, I get all the cookies from the post requests with
the HttClient.getCookieStore method.

I want to save these cookies so the next time the app is started, the
user don't have to log in.

I don't know how to save the cookies in an application.

Because in the shared preferences, only primitive types (strings,
integers, boolean values) can be stored.

If I store the cookie value in the form of a string. I don't know how
to set it to HttClient.setCookieStore(CookieStore); when the
aplication starts again

Please help me.

Thanks and Regards,
Shruthi.



--
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] HorizontalListView inside a VerticalListView

2011-10-11 Thread Christopher Van Kirk
My guess is that the reason you're seeing that effect is that your 
vertical list view comes before the horizontal one in the touch event 
sink chain. I think that once a touch event handler returns true no 
further processing on that event happens. Try making your primary view 
horizontal, and your secondary view vertical and see if that helps.


Failing that, you'll probably have to handle the touch events yourself.


On 10/11/2011 11:01 PM, Marcos Paulo wrote:

Hi guys,

I need to do a HorizontalScrollView inside a listview like we have
in pulse app.

I found this guy that made an implementation of a horizontal listview 
- http://www.dev-smart.com/archives/34
So I took his HorizontalListView and added it to a ListView, and it 
worked, I could do something like pulse app but
there is a problem. When I am scrolling horizontally, when I 
accidentally scroll vertically, the HorizontalListView stops
scrolling and the VerticalListView takes place... I need to block the 
VerticalListView when I am scrolling horizontally and

vice-versa.

Can someone help me please? Pulse app works like that so I know it's 
possible.


Many Thanks,
--
*Marcos Paulo Damasceno *
Software Developer.
@_marcospaulo _
http://devforfun.com/
http://github.com/marcospaulo
http://www.delicious.com/marcospaulo_

--
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 store cookies in an application for future use?

2011-10-11 Thread Daniel Drozdzewski
On 11 October 2011 16:06, Christopher Van Kirk
christopher.vank...@gmail.com wrote:
 Isn't the point of cookies that all this sort of work is done for you? If
 not, then perhaps you should consider storing (and accessing) the data in an
 alternative way.

That is true... a web browser has to confirm to cookie contract,
whereby it has a global cookie storage and attaches cookie to each
request to the domain that cookie originated from.

In Shruthi's case it is his application that has to fulfil this
contract, in case he is using web view.

As Mark suggested, retrieve and save to a file or a DB all cookies
from a session upon exit and revert the process upon re-entry to the
application.

You could integrate it even more, by implementing your own CookieStore
interface, that automatically uses storage or DB behind the scenes.
Have a look at the following point:

http://hc.apache.org/httpcomponents-client-ga/tutorial/html/statemgmt.html#d4e816


-- 
Daniel Drozdzewski

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


[android-developers] Re: List with seperators, checkboxes...

2011-10-11 Thread Studio LFP
Your description is a bit vague, but maybe check out the ExpandableListView 
here:

http://developer.android.com/reference/android/widget/ExpandableListView.html

It's a ListView with expandable sections.  To get checkboxes, you'll need to 
create a layout or extend a view to make it like you want.

Steven
Studio LFP
http://www.studio-lfp.com


On Tuesday, October 11, 2011 4:03:09 AM UTC-5, BearTi wrote:

 Hi, 

 I´ve problems to built a list for my app. 
 This list should have seperators, drop down menus and checkboxes. 

 I´ve read many tutorials, but I can´t find a good one that solves my 
 problem. (for expample which adapter I have to choose and so on) 

 Do you have a good axample for my or some tipps? 

 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: Custom compass image bounds in subclassed MyLocationOverlay

2011-10-11 Thread stephen
Makes sense. So something like:

canvas.save
canvas.scale
// do drawing...
canvas.restore

?

Or is there some other way to increase the canvas bounds that I should
be using?

Thanks,

Stephen

On Oct 11, 6:15 am, TreKing treking...@gmail.com wrote:
 On Mon, Oct 10, 2011 at 11:13 PM, stephen stephen.trai...@gmail.com wrote:
  How do you set the bounds of the custom imagery so that calls
  to drawCompass set the required bounds on the canvas object?

 You could try saving the current state of the Canvas, doing your drawing,
 then restoring it.

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/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: Scenario where initLoader() does not call onLoadFinished()

2011-10-11 Thread kaciula
Here you go: https://github.com/kaciula/BugRetain

It uses a CursorLoader to take 2 values from a database through a content 
provider and shows them on screen. Press the button to move to a second 
activity, then press BACK and then switch orientation of device. The values 
from db are no longer showing.

PS: I am eagerly awaiting a thorough chapter for loaders in your books :)

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

Re: [android-developers] How to store cookies in an application for future use?

2011-10-11 Thread Christopher Van Kirk
Hmm. Still sounds a bit dodgy. One wonders why  this guy's use case 
necessitates him building a new browser, and whether a well placed 
intent would achieve his goal with a lot less effort.


On 10/11/2011 11:21 PM, Daniel Drozdzewski wrote:

On 11 October 2011 16:06, Christopher Van Kirk
christopher.vank...@gmail.com  wrote:

Isn't the point of cookies that all this sort of work is done for you? If
not, then perhaps you should consider storing (and accessing) the data in an
alternative way.

That is true... a web browser has to confirm to cookie contract,
whereby it has a global cookie storage and attaches cookie to each
request to the domain that cookie originated from.

In Shruthi's case it is his application that has to fulfil this
contract, in case he is using web view.

As Mark suggested, retrieve and save to a file or a DB all cookies
from a session upon exit and revert the process upon re-entry to the
application.

You could integrate it even more, by implementing your own CookieStore
interface, that automatically uses storage or DB behind the scenes.
Have a look at the following point:

http://hc.apache.org/httpcomponents-client-ga/tutorial/html/statemgmt.html#d4e816




--
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 store cookies in an application for future use?

2011-10-11 Thread Daniel Drozdzewski
On 11 October 2011 16:41, Christopher Van Kirk
christopher.vank...@gmail.com wrote:
 Hmm. Still sounds a bit dodgy. One wonders why  this guy's use case
 necessitates him building a new browser, and whether a well placed intent
 would achieve his goal with a lot less effort.

Point taken... sometimes http client use could mean something else
than just a browser.

Maybe presence of a cookie (acquired through a legit interaction via
web view) is being verified in some REST api call... you never know.


-- 
Daniel Drozdzewski

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


[android-developers] Re: OpenGL lockups in 2.2

2011-10-11 Thread calderwa
Nope, 'fraid not. That code seems if anything to makes things a little
worse for me = intermittent screen glitches, with rectangular areas
garbled, and the less frequesnt hangup for a second or so, with the
even less frequent reboot. I am using Samsung Galaxy S, 2.3.3, so
clearly not restricted to HTC. All hangs seem to be locking problems
in SharedBufferStack.
glFlush calls have no effect on my problem. Switching from
glDrawArrays to VBOs and glDrawElements had no effect.

This bug is SO bad and i have spent SO long on it now that I am pretty
much at the stage of junking many months of work and not publishing
the openGL version of my app.

This comes on top of unacknowledged problems in java 2d drawing
routines, the ridiculous DirectBuffer problem in 3.0+ where it
allocates 4* as much memory as you ask for. The list is nearly
endless.

Apple, here I come?


On Aug 13, 8:18 am, Herko Lategan herko.late...@gmail.com wrote:
 Guys! *SOLUTION*

 I finally *found the solution* while watching one of the Google IO talks! I
 have been struggling with this problem for over 2 months now, while
 developing on my HTC Desire, and it made me so demotivated knowing my
 application will freeze randomly for some users! But after hours of
 searching I found a solution done by a Google Developer!

 *solution*:

 Here is the link to the solution for 
 GLSurfaceView,http://replicaisland.googlecode.com/svn/trunk/src/com/replica/replica...
 Search for *mSafeMode, **check all the results*, he gives a description as
 to why the error occurs (it is because of broken drivers for certain
 chipsets).

 I have downloaded the source for this game, so if the links disappear you
 can email me and I'll be happy to share.

 Good luck to everyone!

-- 
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] Move vertical Seekbar thumb to the progress drawable height?

2011-10-11 Thread NikolaMKD
I have vertical seekbar.

In the class which extends Seekbar I have on touch listener
 @Override
public boolean onTouchEvent(MotionEvent event) {
if (!isEnabled()) {
return false;
}

switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_MOVE:
case MotionEvent.ACTION_UP:
setProgress(getMax() - (int) (getMax() *
event.getY() / getHeight()));
onSizeChanged(getWidth(), getHeight() , 0, 0);
break;

case MotionEvent.ACTION_CANCEL:
break;
}
return true;
}


When I setProgress(value) expected output is the progress bar to
change, in my case only yellow surface moves to regular value but the
thumb does not.

I tried to make it move after setting progress to
 setProgress(getMax() - (int) (getMax() * progressDrawableHeight /
getHeight()));
onSizeChanged(getWidth(), getHeight() , 0, 0);
which logically means that the thumb should be moved to progress
drawable height (the edge of the yellow surface)

Any ideas?

-- 
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] 1/3 sounds is distorted when played

2011-10-11 Thread Appaholics
Hi,

I am making an update to my game. I am adding an additional sound (a voice
saying Game Over) to the game. There are two other sounds in the game.
When I play the game over sound it is very distorted and lasts much longer
than it should. The other two sounds play perfectly. I edited the game over
sound in Audacity. All three sounds are in a .wav format.

The code I am using to play it is:

mSoundPool.play(mGameOverSound, 0.5f, 0.5f, 0, 0, 1.0f);


The sound has been loaded earlier and the sound pool has been prepared
properly.


The sound should play saying only Game Over. Instead it sounds like
G-a-a-a-a-a-m-m-m-m-m-e-e-e-e-e-  O-v-v-v-v-v-v-v-e-e-e-e-e.


Any idea why only this sound distorts and how to fix it?


Thanks

-- 
--
Raghav Sood
CEO/Founder/Owner/Dictator/Tyrant at Appaholics (Basically all titles
required to have complete control)
http://www.raghavsood.com/
https://market.android.com/developer?pub=Appaholics
http://www.appaholics.in/

-- 
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: Move vertical Seekbar thumb to the progress drawable height?

2011-10-11 Thread NikolaMKD
It's ok. I solved it myself.

I just created method that will call setProgress(getMax() - (getMax()
- progress)) inside my custom class that extended Seekbar. Cheers

On Oct 11, 6:07 pm, NikolaMKD nikola.despoto...@gmail.com wrote:
 I have vertical seekbar.

 In the class which extends Seekbar I have on touch listener
  @Override
             public boolean onTouchEvent(MotionEvent event) {
                 if (!isEnabled()) {
                     return false;
                 }

                 switch (event.getAction()) {
                     case MotionEvent.ACTION_DOWN:
                     case MotionEvent.ACTION_MOVE:
                     case MotionEvent.ACTION_UP:
                         setProgress(getMax() - (int) (getMax() *
 event.getY() / getHeight()));
                         onSizeChanged(getWidth(), getHeight() , 0, 0);
                         break;

                     case MotionEvent.ACTION_CANCEL:
                         break;
                 }
                 return true;
             }

 When I setProgress(value) expected output is the progress bar to
 change, in my case only yellow surface moves to regular value but the
 thumb does not.

 I tried to make it move after setting progress to
  setProgress(getMax() - (int) (getMax() * progressDrawableHeight /
 getHeight()));
                         onSizeChanged(getWidth(), getHeight() , 0, 0);
 which logically means that the thumb should be moved to progress
 drawable height (the edge of the yellow surface)

 Any ideas?

-- 
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] DexClassLoader issues on android 3.0 (api-11)

2011-10-11 Thread BogDan
Hello,

  I encounter a very strange problem using DexClassLoader on
android-11 (emulator), because I wasn't sure if is my fault I tested
android-custom-class-loading-sample[1] which was introduced in this
[2] blog post. The example is working perfectly on all android
versions (4,5,8,9,10,12,13) except android-11 which gives me the
following errors:
E/dalvikvm(  343): Can't open dex cache '/data/dalvik-cache/
data@d...@com.example.dex@app_dex@secondary_dex@classes.dex': No
such file or directory
I/dalvikvm(  343): Unable to open or create cache for /data/data/
com.example.dex/app_dex/secondary_dex.jar (/data/dalvik-cache/
data@d...@com.example.dex@app_dex@secondary_dex@classes.dex)
W/System.err(  343): java.lang.ClassNotFoundException:
com.example.dex.lib.LibraryProvider in loader
dalvik.system.DexClassLoader@406445c0
W/System.err(  343):at
dalvik.system.DexClassLoader.findClass(DexClassLoader.java:240)
W/System.err(  343):at
java.lang.ClassLoader.loadClass(ClassLoader.java:548)
W/System.err(  343):at
java.lang.ClassLoader.loadClass(ClassLoader.java:508)
W/System.err(  343):at com.example.dex.MainActivity
$1.onClick(MainActivity.java:79)
W/System.err(  343):at android.view.View.performClick(View.java:
3100)
W/System.err(  343):at android.view.View
$PerformClick.run(View.java:11644)
W/System.err(  343):at
android.os.Handler.handleCallback(Handler.java:587)
W/System.err(  343):at
android.os.Handler.dispatchMessage(Handler.java:92)
W/System.err(  343):at android.os.Looper.loop(Looper.java:126)
W/System.err(  343):at
android.app.ActivityThread.main(ActivityThread.java:3997)
W/System.err(  343):at
java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(  343):at java.lang.reflect.Method.invoke(Method.java:
491)
W/System.err(  343):at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:841)
W/System.err(  343):at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
W/System.err(  343):at dalvik.system.NativeStart.main(Native
Method)
D/SntpClient(   67): request time failed: java.net.SocketException:
Address family not supported by protocol

The problem is that my application depends by this feature, so I want
to ask if is there any (known) workaround for this issue ? I also
tried with PathClassLoader but the result was the same, any idea will
be very appreciated !

Thank you.

BogDan.

[1] http://code.google.com/p/android-custom-class-loading-sample/
[2] 
http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.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


[android-developers] Re: unable to upload app to android market

2011-10-11 Thread Thomas
I couldn't upload an app to Android Market even though it had passed
various tests and I had published others successfully.  I was using
winxp/FireFox at the time, but someone suggested I try winxp/IE8 and
for unknown reasons, I was able to publish again to Android Market.  I
haven't bothered to try Firefox as I don't publish or update that
much.

On Oct 11, 9:57 am, vandana toshniwal vandanatoshni...@gmail.com
wrote:
 Hey

 i am not able to upload applications to android market.

 When i select the apk file and click upload. it does nothing and after 5 to
 10mins i get an error message something went wrong.

 Please let me know what the problem could be.

 Regards

 Vandana Toshniwal

-- 
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] HorizontalListView inside a VerticalListView

2011-10-11 Thread Marcos Paulo
Unfortunately it didn't work.

I could handle the enableing and disableing of the scroll with events but
how do I do this programmatically?

I can't find a way to disable the scroll at programming level.
--
*Marcos Paulo Damasceno*
Software Developer.
@_marcospaulo_
http://devforfun.com/
http://github.com/marcospaulo
http://www.delicious.com/marcospaulo_



2011/10/11 Christopher Van Kirk christopher.vank...@gmail.com

  My guess is that the reason you're seeing that effect is that your
 vertical list view comes before the horizontal one in the touch event sink
 chain. I think that once a touch event handler returns true no further
 processing on that event happens. Try making your primary view horizontal,
 and your secondary view vertical and see if that helps.

 Failing that, you'll probably have to handle the touch events yourself.



 On 10/11/2011 11:01 PM, Marcos Paulo wrote:

 Hi guys,

  I need to do a HorizontalScrollView inside a listview like we have
 in pulse app.

  I found this guy that made an implementation of a horizontal listview -
 http://www.dev-smart.com/archives/34
 So I took his HorizontalListView and added it to a ListView, and it worked,
 I could do something like pulse app but
 there is a problem. When I am scrolling horizontally, when I accidentally
 scroll vertically, the HorizontalListView stops
 scrolling and the VerticalListView takes place... I need to block the
 VerticalListView when I am scrolling horizontally and
 vice-versa.

  Can someone help me please? Pulse app works like that so I know it's
 possible.

  Many Thanks,
 --
  * Marcos Paulo Damasceno *
  Software Developer.
  @_marcospaulo _
  http://devforfun.com/
 http://github.com/marcospaulo
  http://www.delicious.com/marcospaulo_

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

-- 
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] Package Browser: what does Restart button do?

2011-10-11 Thread RLScott
I was playing around with the Package Browser on the Emulator while my
app was paused.  I located my app's package and noticed the Restart
button at the top of the page.  I clicked on this button and when I
went back to my app it was on the same activity I had paused, but the
display was a bit screwed up.  What does this restart button do in
terms of app and activity life cycles?  Does it do something that the
OS might do?  Does the screwed up screen mean that I am not persisting
my activity state properly?  Where should I look?

-- 
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 we detect 'screen touch' event itself from on any widget?

2011-10-11 Thread Build account
Hello.

My question might be ambigous to understand. But
let say that
In this situation,
- I have an activity which contain buttons and filled list view.
- I want to know the touch event whether screen touched on my activity
anywhere(not on specific widget)
- Is it possible to detect the event? then how? Should I use Gesture
calss stuff?

Please advice me..

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


[android-developers] Android 3.2 emulator display freezes as soon as I click apps or + in the home screen

2011-10-11 Thread Michael Diener
When running the 3.2 emulator and pressing apps or + in the home
screen, the screen starts to move a bit and then freezes. This happens
on a x64 Linux as well as a x64 Windows 7. Sometimes it gets so far
that apps are displayed, but only the top half of the screen is used
For 3.1 the same thing happens and for 3.0 it works sometimes.

Anybody else experiencing this or knows a way around this?

/Michael

-- 
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] Stored files on sdcard deleted during uninstall or update

2011-10-11 Thread yves...@gmail.com
It doesn't happen all the time. There are files I saved on /data/
CompanyName/ folder which got deleted during uninstall of the
application or update the application. It happens sometime, any ideas
on what happened here? What should I do to make sure the files will
always be kept.

-- 
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 organize lite and pro version of the code

2011-10-11 Thread yves...@gmail.com
I have an application which has lite and pro versions on the market.
Every time I change something, I have to update code on both projects.
Is there a simpler way to organize code that two projects will share
lots of common code in Eclipse? So, the maintenance work will be
minimal.

-- 
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] display images in galleryview from sqlite database

2011-10-11 Thread Abhi
Hi

I have a sqlite database that has over 2000 low res thumbnails of
pictures. The database itself is over 100MB in size. The project
requires me to have the photos residing in the database instead of the
file path. This is what I would like to do and need help with as this
is my first time dealing with images. I have a horizontal GalleryView
in my App UI that I want to populate with images pulled from this
database dynamically. I don't mind if these images are lazy loaded on
to the gallery view in the background. I read somewhere that I will
have to use an ImageAdapter to bind the images to the UI element
dynamically. I need in understanding how this is done. I have never
used the BaseAdapter class.

Thanks,

AB

-- 
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] Any way to embed existing views?

2011-10-11 Thread yves...@gmail.com
I am trying to write an app which I want to show, say, the calendar
app in my app. So, is there a way I can just embed the calendar app
view into one of my view (because i want to change the display size,
etc) as long as I know the name of the class? Also, I want all touch
event or keyboard events are captured by my app. Any way to accomplish
this?

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


Re: [android-developers] How to organize lite and pro version of the code

2011-10-11 Thread Appaholics
Create a library project with the common code and include it in both
versions.

Raghav Sood
Sent from my Android
LG Optimus One
http://www.appaholics.in
http://www.photoster.org
On Oct 11, 2011 11:31 PM, yves...@gmail.com yves...@gmail.com wrote:

 I have an application which has lite and pro versions on the market.
 Every time I change something, I have to update code on both projects.
 Is there a simpler way to organize code that two projects will share
 lots of common code in Eclipse? So, the maintenance work will be
 minimal.

 --
 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: OpenGL lockups in 2.2

2011-10-11 Thread Christopher Van Kirk

It's insane to throw away months of work.

Are you seeing this behavior in other 2 or 3d games running on that 
device? If so, it's probably a device fault that you simply can't get 
around, and should just be ignored. There are other devices in the world 
that, in theory, it should work on. In your market publish, just mention 
that you had problems with that device and that it's not recommended to 
be run there, then move on.


If you aren't seeing the behavior elsewhere, then what you have is an 
application problem. Have you considered that plugging and unplugging 
the USB cable is introducing thread locking that is absent in your code? 
When you connect the USB cable, if you have development enabled, you 
instantly start reading out logging info, which may have locking in 
there that's fixing some problem you have.


Anyway, giving up smacks of throwing the baby out with the bath water 
because of difficulties with one device. I wouldn't do it.




On 10/12/2011 12:02 AM, calderwa wrote:

Nope, 'fraid not. That code seems if anything to makes things a little
worse for me = intermittent screen glitches, with rectangular areas
garbled, and the less frequesnt hangup for a second or so, with the
even less frequent reboot. I am using Samsung Galaxy S, 2.3.3, so
clearly not restricted to HTC. All hangs seem to be locking problems
in SharedBufferStack.
glFlush calls have no effect on my problem. Switching from
glDrawArrays to VBOs and glDrawElements had no effect.

This bug is SO bad and i have spent SO long on it now that I am pretty
much at the stage of junking many months of work and not publishing
the openGL version of my app.

This comes on top of unacknowledged problems in java 2d drawing
routines, the ridiculous DirectBuffer problem in 3.0+ where it
allocates 4* as much memory as you ask for. The list is nearly
endless.

Apple, here I come?


On Aug 13, 8:18 am, Herko Lateganherko.late...@gmail.com  wrote:

Guys! *SOLUTION*

I finally *found the solution* while watching one of the Google IO talks! I
have been struggling with this problem for over 2 months now, while
developing on my HTC Desire, and it made me so demotivated knowing my
application will freeze randomly for some users! But after hours of
searching I found a solution done by a Google Developer!

*solution*:

Here is the link to the solution for 
GLSurfaceView,http://replicaisland.googlecode.com/svn/trunk/src/com/replica/replica...
Search for *mSafeMode, **check all the results*, he gives a description as
to why the error occurs (it is because of broken drivers for certain
chipsets).

I have downloaded the source for this game, so if the links disappear you
can email me and I'll be happy to share.

Good luck to everyone!


--
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: HTC and LG haven't implemented Android in the right way

2011-10-11 Thread MobileVisuals
I see, now I understand the color4f method. I can't sort the
transparent sprites back-to-front,because they are all in one vertex
array. It would be much slower if I had one vertex array for each
quad, because it would be so many drawArray calls.

I will only use one layer of quads from now on. But the particles in
the animation are morphed, so one particle will sometimes be placed
above another.
Do you mean that this will always result in black quads?

I will only use star1.png for testing,since you said that image was
correct. I used this guide to add the alpha channel:
http://fabiovisentin.com/tutorial/gimp_transparent_image/gimp_how_to_make_transparent_image.asp

On Oct 11, 4:22 pm, Latimerius l4t1m3r...@googlemail.com wrote:
 Hello, my guess would be you don't sort your transparent sprites
 back-to-front, do you?

 For a couple more comments please see inline:

 On Tue, Oct 11, 2011 at 11:51 AM, MobileVisuals



 eyv...@astralvisuals.com wrote:
  before. I tried to remove the gl.glColor4f calls, but that made the
  black square quads much more visible. This is how it looks like now,
  with gl.glColor4f(1f, 1f, 1f, 0.4f);

 http://www.mobile-visuals.com/color4f04.png

  with gl.glColor4f(1f, 1f, 1f, 0.8f);

 http://www.mobile-visuals.com/color4f08.png

  with no with gl.glColor4f calls:

 http://www.mobile-visuals.com/noColor4f.png

  This shows that with higher alpha value in glColor4f, the more black
  square quads. It also shows that the
  smaller alpha value in glColor4f, the more dull result.

 glColor() used with texturing simply modulates the texel colours in
 your case.  By specifying (1,1,1, 1) you leave the hue alone but add
 0.4f or 0.8f transparency.  Smaller alpha means dull because whatever
 you draw becomes almost transparent.  Similarly, higher alpha means
 what you draw is more visible, including the black artifacts.

  This how the
  source textures looks like now:

 http://www.mobile-visuals.com/trance1.png
 http://www.mobile-visuals.com/star1.png
 http://www.mobile-visuals.com/star2.png

 BTW apart from star1.png these assets don't look correctly authored to
 me.  I don't know exactly what you're trying to achieve but I believe
 trance1.png and star2.png wouldn't work on a non-black background.

  I have used 2 quads for each star, placed on each other here.

 This is where the above might bite you.  If you draw say star2.png
 over trance1.png the black component in star2.png's pixels will start
 to show.  I don't know if that's a problem for you, depends on what
 your objectives are.

  gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE);

 Make sure your art *doesn't* have premultiplied alpha.  If it does
 then specifying GL_SRC_ALPHA would apply the alpha once more causing
 transparent pixels to darken.  You'd need GL_ONE in that case.

  gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE,
                                 GL10.GL_MODULATE);

 I believe this is the default so you could just as well leave it out.

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


Re: [android-developers] Can we detect 'screen touch' event itself from on any widget?

2011-10-11 Thread TreKing
On Tue, Oct 11, 2011 at 12:35 PM, Build account newandroi...@gmail.comwrote:

 - I want to know the touch event whether screen touched on my
 activity anywhere(not on specific widget)


You want to know if your Activity can receive touch events. First step, go
to the Activity documentation. Second step, do a find on touch. Voila.

http://developer.android.com/reference/android/app/Activity.html#onTouchEvent(android.view.MotionEvent)

-
TreKing http://sites.google.com/site/rezmobileapps/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] Stored files on sdcard deleted during uninstall or update

2011-10-11 Thread TreKing
On Tue, Oct 11, 2011 at 12:57 PM, yves...@gmail.com yves...@gmail.comwrote:

 There are files I saved on /data/
 CompanyName/ folder which got deleted during uninstall of the
 application or update the application.


Uninstall wipes local data, update should not.


 It happens sometime, any ideas on what happened here?


Based on the limited information, I'll assume the sometimes is when you
uninstall, as expected.


 What should I do to make sure the files will always be kept.


Use the SD card?

-
TreKing http://sites.google.com/site/rezmobileapps/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] Service to Activity communication with Broadcast Reciever every 1 sec . Is this right approach?

2011-10-11 Thread NikolaMKD
I'm creating media player application that will run on service and all
its action (all intent actions stated in the manifest file of course)

What I did is, I created Runnable in my service that will
sendBroadcast whenever I do handler.postDelayed(myRunnable, 1000);

private Runnable updateActivity = new Runnable(){

@Override
public void run() {
if(mediaPlayer!=null)
{

Intent toActivity = new
Intent(com.share.play.SharePlayService);
toActivity.putExtra(position, position);  
//32bit
toActivity.putExtra(id, 
mediaPlayer.getAudioSessionId());  //
32bit

toActivity.putExtra(progress,mediaPlayer.getCurrentPosition()); //
32bit
toActivity.putExtra(duration, 
mediaPlayer.getDuration()); //
32bit
toActivity.putExtra(bands, totalbands);  // 5 
x 32bit
toActivity.putExtra(loop, mpLoop); // 1bit
toActivity.putExtra(shuffle, mpShuffle); 
//1bit
MyPlayService.this.sendBroadcast(toActivity);
handler.postDelayed(updateActivity, 1000);  // 
post again and
again every 1 sec
}
}};

And in my Activity I have receiver that will take the duration, and of
course the currentPosition() of the playing.


BroadcastReceiver ServiceReciever = new BroadcastReceiver(){

@Override
public void onReceive(Context arg0, Intent arg1) {

Bundle b = arg1.getExtras();
 if(b!=null)
 {


 seekbar.setMax(b.getInt(duration));
 seekbar.setProgress(b.getInt(progress));


 position=b.getInt(position);
 sessionId = b.getInt(id);

 if(b.getInt(position)(visual.size()-1))   
//Changing album
art whenever the current playing position is different from the
previous
 {
 position-=1;

 }
 else{
  if(position  -1  visual.size()0  
!visual.isEmpty())
 {
 
playingArtist.setText(visual.get(b.getInt(position)));
 Drawable drawable = null;
try {
drawable = getArtwork();
//drawable = 
drawable.getCurrent().
} catch (FileNotFoundException 
e) {
// TODO Auto-generated 
catch block
e.printStackTrace();
} catch 
(IllegalArgumentException e) {
// TODO Auto-generated 
catch block
e.printStackTrace();
}

 art.setImageDrawable(drawable);

 }
 }


 userLoop = b.getBoolean(loop);
 userShuffle = b.getBoolean(shuffle);

 int Minutes = (b.getInt(progress) % (1000*60*60)) /
(1000*60);
 int Seconds = ((b.getInt(progress) % (1000*60*60)) %
(1000*60)) / 1000;
 int Minutes2= (b.getInt(duration) % (1000*60*60)) /
(1000*60);
 int seconds2 = ((b.getInt(duration) % (1000*60*60)) %
(1000*60)) / 1000;
 timeline.setText(Integer.toString(Minutes) + :+ 
Seconds
+/+ Minutes2 +:+ seconds2); //updates the time line.
 }

 }

};

More over, I unregister and register the receiver regularly whenever
the activity is visible to the user or not.

1. Is there are any side-effect of this approach?
2. Is this reasonable? Does the message queue get starved?
3. Is there any rather better approach than this one? Point me
some...

If you need some more explanation please post...

-- 
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] Any way to embed existing views?

2011-10-11 Thread TreKing
On Tue, Oct 11, 2011 at 1:14 PM, yves...@gmail.com yves...@gmail.comwrote:

 So, is there a way I can just embed the calendar app view into one of my
 view (because i want to change the display size, etc) as long as I know the
 name of the class?


No.

-
TreKing http://sites.google.com/site/rezmobileapps/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] Observing a Singleton List from an Activity

2011-10-11 Thread Boozel
Hi

I have two activities, a service and a singleton list. The service is 
responsible for fetching all the data via async tasks called in my main 
activity. The other activity can add items to the list but when a new item 
is added the data service needs to fetch data for it.

The task to fetch data is in my main activity because it is bound to the 
service already.

i want the main activity to observe the list so that when the other activity 
adds an item to the list it can run the async task to fetch data for that 
item.
Is this the correct way to do this?
If So how do i get my main activity to observe my singleton list 
that extends Observable?

Any help would be great.
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

Re: [android-developers] Service to Activity communication with Broadcast Reciever every 1 sec . Is this right approach?

2011-10-11 Thread TreKing
On Tue, Oct 11, 2011 at 1:58 PM, NikolaMKD nikola.despoto...@gmail.comwrote:

 3. Is there any rather better approach than this one? Point me some...


http://developer.android.com/reference/android/app/Service.html#LocalServiceSample

-
TreKing http://sites.google.com/site/rezmobileapps/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] Observing a Singleton List from an Activity

2011-10-11 Thread TreKing
On Tue, Oct 11, 2011 at 2:20 PM, Boozel boozelcl...@gmail.com wrote:

 If So how do i get my main activity to observe my singleton list
 that extends Observable?


If you already extend Observable then it follows you would need an Oberver,
which in this case would be your Activity, from what you described.

-
TreKing http://sites.google.com/site/rezmobileapps/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] Russia, Belarus and Ukraine time changes

2011-10-11 Thread davem
From the end of this month, Russia, Belarus and Ukraine will not
revert to standard time as they have in the past, they will stay on
summer time year round. The time zone database on my Desire doesn't
have this change, so my app reports times incorrectly from then on,
and may fire alarms at the wrong time, especially if Android owners in
those countries adjust their clocks manually to work around the error.

Can we expect a firmware update in the near future to correct the time
zone database? Has this happened before?

-- 
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: A noob question about MultipartEntity

2011-10-11 Thread Paul Turchenko
well, there's nothing special in multipart. You can use apache mime
library in your prroject or implement multipart yourself.

On Oct 10, 6:58 am, routis ryu.ins...@gmail.com wrote:
 Hi I guess this is a stupid noob question but I want to know why
 Android framework does not provide with MultipartEntity class and if
 there is future plan to support this.

 Thank you for your reading.

-- 
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: HTC and LG haven't implemented Android in the right way

2011-10-11 Thread Latimerius
On Tue, Oct 11, 2011 at 8:38 PM, MobileVisuals eyv...@astralvisuals.com wrote:
 I see, now I understand the color4f method. I can't sort the
 transparent sprites back-to-front,because they are all in one vertex
 array. It would be much slower if I had one vertex array for each
 quad, because it would be so many drawArray calls.

Think about your problem from the depth sorting perspective.  Again, I
don't know what exactly you are doing but your geometry looks quite
regular to me - perhaps the depth sorting, once established, never
changes?

If you're drawing everything in a single glDrawArrays() call then all
of your quads share the same transformation (the same values you pass
to glTranslate()/glRotate()/glScale()).  If that's the case your
geometry is likely pre-transformed (you transform vertices of each
quad before putting them into the array) - could you sort the quads as
you transform them?

Try to take advantage of any problem-specific knowledge you have (and
I don't).  In my experience it's rather unlikely that you're unable to
do the required depth sorting.

 I will only use one layer of quads from now on. But the particles in
 the animation are morphed, so one particle will sometimes be placed
 above another.
 Do you mean that this will always result in black quads?

Unfortunately yes.  When using translucency with depth buffering I
don't know of any other solution, in general.

To understand this consider you draw a partially transparent quad,
just like one of yours.  Its transparent pixels will not change the
frame buffer since they are transparent - the corresponding frame
buffer pixels will stay at your clear colour.  However, the quad also
writes into the depth buffer.

Now, consider another quad comes that (partially) overlaps with the
first one and should be visible where the first quad had transparent
parts.  Also consider that this second quad can be further away from
the camera which can well happen since your quads are *not*
back-to-front sorted.  The second quad will be prevented by depth test
from writing to any pixels touched by the first quad.  This means your
clear colour remains where the first sprite was
transparent/translucent.  Hence your black rectangle - a quad close to
camera comes first and blocks other quads further away from the camera
from writing over it.

I'm afraid you will have to figure out how to depth-sort your geometry
properly.  As I said before, it shouldn't be *that* tough. ;-)

 I will only use star1.png for testing,since you said that image was
 correct. I used this guide to add the alpha channel:
 http://fabiovisentin.com/tutorial/gimp_transparent_image/gimp_how_to_make_transparent_image.asp

That is a fine tutorial, however you will notice the example image has
(perhaps apart from some anti-aliasing) sharp edges.  The process they
describe there is appropriate for that sort of images.  However, your
stuff is supposed to smoothly blend into its surroundings, with no
defined edge, pretty much.  The process from the tutorial is not well
suited for this kind of image.

Consider getting rid of the black component in your art for instance
by loading it into Gimp, then going to Colours-Colour to Alpha... and
setting the colour to black.  I checked and even star1.png seems to
have more black in it than would look right ...

Only you know what you're trying to achieve so this might or might not
be an appropriate fix.  To me, your art fixed like this looks about
right and ready for some serious blending. ;-)

-- 
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: OpenGL lockups in 2.2

2011-10-11 Thread calderwa
Difficulties with one device
I have no way of knowing how many makes/models of device this problem
is on. I know that it happens all the time on my Samsung Galaxy
(I9000). Others report exactly the same thing as being a feature of a
number of HTC devices - these two make up a major part of the market I
believe. I think I may well have two faults - one is the standard
eglSwapBuffers hang, which none of the suggested fixes have had any
effect on -square textures, different GLSurfaceView, wait, flush,
finish etc. The second one, which I think might be related, is my
intermittent framebuffer corruption, I am willing to accept this may
be my fault in some way I have been unable to pinpoint.
http://www.fordartworks.co.uk/dodgyS.png - the ractilinear dodgy area
just above the left and right arrow buttons.

smacks of throwing the baby out...
At the moment, I am just hugely frustrated by the long list of
problems I have faced with Android - halts on writing to SD card,
gradients that don't work at one particular angle and so on. I have
been a software designer and developer for over 25 years - parallel
architecture research, trading room systems, real time etc (assembler,
Fortran, Prolog, Occam, C, C++, Java) and I have never been so
frustrated by any system - there has always been a different way of
doing things, getting round problems. With this /these? OpenGL
problem(s) it appears to be a black box. Without a genuine
understanding of what is wrong, any fix is pure conjecture.

should just be ignored
I am extremely reluctant to put out an App that looks flakey or, much
worse, shuts down people's phones. Ignoring a problem that I can't
get round is not a viable solution I feel.

plugging and unplugging the USB cable
The USB cable stuff was a problem I had with very jerky OpenGL
performance when the rendering load was heavy - this was caused by the
CPU clock reducing when the GPU was active, I believe.

seeing the behavior elsewhere
I haven't experienced this problem with other programs on this phone.
(I have not detected the problem on my Asus Transformer either, but I
have tested that far less. It will also have very different
performance characteristics.) I don't play games, 2D or 3D. Many of
the openGL demonstrators, testers or benchmarkers don't stress the
system sufficiently - i can get 50 or 60 fps. The problem is very
timing dependent- i have one picture definition for my App that fails
vaguely regularly - i have 2 or 3 others that do very occasionally,
and I have 100+ that i haven't seen go wrong yet. I simply haven't the
time to sit and fiddle about with a 3rd party app on the off-chance of
catching a glitch. If I did - that would prove relatively little. I
could sit there till doomsday with my own app under the right
conditions and never see anything untoward.


I'll maybe just take a break from this (go and paint a few
pictures :-) ) - i've been on this problem 7 days a week for nearly 3
weeks now. I might even go get a real job again, lol.

It's insane
Thank you for your concerns over my mental health :-)


On Oct 11, 7:28 pm, Christopher Van Kirk
christopher.vank...@gmail.com wrote:
 It's insane to throw away months of work.

 Are you seeing this behavior in other 2 or 3d games running on that
 device? If so, it's probably a device fault that you simply can't get
 around, and should just be ignored. There are other devices in the world
 that, in theory, it should work on. In your market publish, just mention
 that you had problems with that device and that it's not recommended to
 be run there, then move on.

 If you aren't seeing the behavior elsewhere, then what you have is an
 application problem. Have you considered that plugging and unplugging
 the USB cable is introducing thread locking that is absent in your code?
 When you connect the USB cable, if you have development enabled, you
 instantly start reading out logging info, which may have locking in
 there that's fixing some problem you have.

 Anyway, giving up smacks of throwing the baby out with the bath water
 because of difficulties with one device. I wouldn't do it.

 On 10/12/2011 12:02 AM, calderwa wrote:



  Nope, 'fraid not. That code seems if anything to makes things a little
  worse for me = intermittent screen glitches, with rectangular areas
  garbled, and the less frequesnt hangup for a second or so, with the
  even less frequent reboot. I am using Samsung Galaxy S, 2.3.3, so
  clearly not restricted to HTC. All hangs seem to be locking problems
  in SharedBufferStack.
  glFlush calls have no effect on my problem. Switching from
  glDrawArrays to VBOs and glDrawElements had no effect.

  This bug is SO bad and i have spent SO long on it now that I am pretty
  much at the stage of junking many months of work and not publishing
  the openGL version of my app.

  This comes on top of unacknowledged problems in java 2d drawing
  routines, the ridiculous DirectBuffer problem in 3.0+ where it
  allocates 4* as much memory as you ask 

[android-developers] Re: OpenGL lockups in 2.2

2011-10-11 Thread calderwa
Difficulties with one device
I have no way of knowing how many makes/models of device this problem
is on. I know that it happens all the time on my Samsung Galaxy
(I9000). Others report exactly the same thing as being a feature of a
number of HTC devices - these two make up a major part of the market I
believe. I think I may well have two faults - one is the standard
eglSwapBuffers hang, which none of the suggested fixes have had any
effect on -square textures, different GLSurfaceView, wait, flush,
finish etc. The second one, which I think might be related, is my
intermittent framebuffer corruption, I am willing to accept this may
be my fault in some way I have been unable to pinpoint.
http://www.fordartworks.co.uk/dodgyS.png - the ractilinear dodgy area
just above the left and right arrow buttons.

smacks of throwing the baby out...
At the moment, I am just hugely frustrated by the long list of
problems I have faced with Android - halts on writing to SD card,
gradients that don't work at one particular angle and so on. I have
been a software designer and developer for over 25 years - parallel
architecture research, trading room systems, real time etc (assembler,
Fortran, Prolog, Occam, C, C++, Java) and I have never been so
frustrated by any system - there has always been a different way of
doing things, getting round problems. With this /these? OpenGL
problem(s) it appears to be a black box. Without a genuine
understanding of what is wrong, any fix is pure conjecture.

should just be ignored
I am extremely reluctant to put out an App that looks flakey or, much
worse, shuts down people's phones. Ignoring a problem that I can't
get round is not a viable solution I feel.

plugging and unplugging the USB cable
The USB cable stuff was a problem I had with very jerky OpenGL
performance when the rendering load was heavy - this was caused by the
CPU clock reducing when the GPU was active, I believe.

seeing the behavior elsewhere
I haven't experienced this problem with other programs on this phone.
(I have not detected the problem on my Asus Transformer either, but I
have tested that far less. It will also have very different
performance characteristics.) I don't play games, 2D or 3D. Many of
the openGL demonstrators, testers or benchmarkers don't stress the
system sufficiently - i can get 50 or 60 fps. The problem is very
timing dependent- i have one picture definition for my App that fails
vaguely regularly - i have 2 or 3 others that do very occasionally,
and I have 100+ that i haven't seen go wrong yet. I simply haven't the
time to sit and fiddle about with a 3rd party app on the off-chance of
catching a glitch. If I did - that would prove relatively little. I
could sit there till doomsday with my own app under the right
conditions and never see anything untoward.


I'll maybe just take a break from this (go and paint a few
pictures :-) ) - i've been on this problem 7 days a week for nearly 3
weeks now. I might even go get a real job again, lol.

It's insane
Thank you for your concerns over my mental health :-)


On Oct 11, 7:28 pm, Christopher Van Kirk
christopher.vank...@gmail.com wrote:
 It's insane to throw away months of work.

 Are you seeing this behavior in other 2 or 3d games running on that
 device? If so, it's probably a device fault that you simply can't get
 around, and should just be ignored. There are other devices in the world
 that, in theory, it should work on. In your market publish, just mention
 that you had problems with that device and that it's not recommended to
 be run there, then move on.

 If you aren't seeing the behavior elsewhere, then what you have is an
 application problem. Have you considered that plugging and unplugging
 the USB cable is introducing thread locking that is absent in your code?
 When you connect the USB cable, if you have development enabled, you
 instantly start reading out logging info, which may have locking in
 there that's fixing some problem you have.

 Anyway, giving up smacks of throwing the baby out with the bath water
 because of difficulties with one device. I wouldn't do it.

 On 10/12/2011 12:02 AM, calderwa wrote:



  Nope, 'fraid not. That code seems if anything to makes things a little
  worse for me = intermittent screen glitches, with rectangular areas
  garbled, and the less frequesnt hangup for a second or so, with the
  even less frequent reboot. I am using Samsung Galaxy S, 2.3.3, so
  clearly not restricted to HTC. All hangs seem to be locking problems
  in SharedBufferStack.
  glFlush calls have no effect on my problem. Switching from
  glDrawArrays to VBOs and glDrawElements had no effect.

  This bug is SO bad and i have spent SO long on it now that I am pretty
  much at the stage of junking many months of work and not publishing
  the openGL version of my app.

  This comes on top of unacknowledged problems in java 2d drawing
  routines, the ridiculous DirectBuffer problem in 3.0+ where it
  allocates 4* as much memory as you ask 

[android-developers] Re: Service to Activity communication with Broadcast Reciever every 1 sec . Is this right approach?

2011-10-11 Thread NikolaMKD
I have to create AIDL for methods from which I'll have access to the
service. If I have each player feature(play, next, previous) I'm
starting new service with startService(), when onBind() the object
that will be returned to be used to control the service will I still
have the access to the service whenever another call to startService
is made?

On Oct 11, 9:20 pm, TreKing treking...@gmail.com wrote:
 On Tue, Oct 11, 2011 at 1:58 PM, NikolaMKD nikola.despoto...@gmail.comwrote:

  3. Is there any rather better approach than this one? Point me some...

 http://developer.android.com/reference/android/app/Service.html#Local...

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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


[android-developers] Re: how to change the font typeface in PreferenceScreen

2011-10-11 Thread Arkadiusz Wojcieszek
In my PreferenceActivity I have this:

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.settings);
setContentView(R.layout.preferences);

SharedPreferences sharedPreferences =
getSharedPreferences(settings, Context.MODE_PRIVATE);
sharedPreferences.registerOnSharedPreferenceChangeListener(new
OnSharedPreferenceChangeListener() {

@Override
public void onSharedPreferenceChanged(SharedPreferences
sharedPreferences,
String key) {
Toast.makeText(getApplicationContext(), key, 
0).show();
}
});
}

To test this solution. But I can't see any Toast.

On 11 Paź, 02:16, lbendlin l...@bendlin.us wrote:
 you might get lucky 
 viahttp://developer.android.com/reference/android/content/SharedPreferen...
 as I believe this is called when the preference is first rendered.

 And then you can poke the individual preference like so

     public void onSharedPreferenceChanged(SharedPreferences
 sharedPreferences, String key) {
     Preference pref = findPreference(key);

     if (pref instanceof ListPreference) {
         ListPreference listPref = (ListPreference) pref;
         pref.setSummary(listPref.getEntry());

         String pT = (String) pref.getTitle();
 ...

 Alternatively, if you only have a few preferences, you should be able to
 address them via their key directly.

-- 
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 change the font typeface in PreferenceScreen

2011-10-11 Thread Arkadiusz Wojcieszek
In my PreferenceActivity I have this:

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.settings);
setContentView(R.layout.preferences);

SharedPreferences sharedPreferences =
getSharedPreferences(settings, Context.MODE_PRIVATE);
sharedPreferences.registerOnSharedPreferenceChangeListener(new
OnSharedPreferenceChangeListener() {

@Override
public void onSharedPreferenceChanged(SharedPreferences
sharedPreferences,
String key) {
Toast.makeText(getApplicationContext(), key, 
0).show();
}
});
}

To test this solution. But I can't see any Toast.

On 11 Paź, 02:16, lbendlin l...@bendlin.us wrote:
 you might get lucky 
 viahttp://developer.android.com/reference/android/content/SharedPreferen...
 as I believe this is called when the preference is first rendered.

 And then you can poke the individual preference like so

     public void onSharedPreferenceChanged(SharedPreferences
 sharedPreferences, String key) {
     Preference pref = findPreference(key);

     if (pref instanceof ListPreference) {
         ListPreference listPref = (ListPreference) pref;
         pref.setSummary(listPref.getEntry());

         String pT = (String) pref.getTitle();
 ...

 Alternatively, if you only have a few preferences, you should be able to
 address them via their key directly.

-- 
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 change the font typeface in PreferenceScreen

2011-10-11 Thread Arkadiusz Wojcieszek
In my PreferenceActivity I have this:

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.settings);
setContentView(R.layout.preferences);

SharedPreferences sharedPreferences = getSharedPreferences(settings,
Context.MODE_PRIVATE);
sharedPreferences.registerOnSharedPreferenceChangeListener(new
OnSharedPreferenceChangeListener() {

@Override
public void onSharedPreferenceChanged(SharedPreferences
sharedPreferences, String key) {
Toast.makeText(getApplicationContext(), key, 0).show();
}
});
}

To test this solution. But I can't see any Toast.

On 11 Paź, 02:16, lbendlin l...@bendlin.us wrote:
 you might get lucky 
 viahttp://developer.android.com/reference/android/content/SharedPreferen...
 as I believe this is called when the preference is first rendered.

 And then you can poke the individual preference like so

     public void onSharedPreferenceChanged(SharedPreferences
 sharedPreferences, String key) {
     Preference pref = findPreference(key);

     if (pref instanceof ListPreference) {
         ListPreference listPref = (ListPreference) pref;
         pref.setSummary(listPref.getEntry());

         String pT = (String) pref.getTitle();
 ...

 Alternatively, if you only have a few preferences, you should be able to
 address them via their key directly.

-- 
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: Service to Activity communication with Broadcast Reciever every 1 sec . Is this right approach?

2011-10-11 Thread NikolaMKD
Will START_STICKY keep my service running even if the phone is locked
or activity is not visible to the user anymore?

On Oct 11, 10:21 pm, NikolaMKD nikola.despoto...@gmail.com wrote:
 I have to create AIDL for methods from which I'll have access to the
 service. If I have each player feature(play, next, previous) I'm
 starting new service with startService(), when onBind() the object
 that will be returned to be used to control the service will I still
 have the access to the service whenever another call to startService
 is made?

 On Oct 11, 9:20 pm, TreKing treking...@gmail.com wrote:







  On Tue, Oct 11, 2011 at 1:58 PM, NikolaMKD 
  nikola.despoto...@gmail.comwrote:

   3. Is there any rather better approach than this one? Point me some...

 http://developer.android.com/reference/android/app/Service.html#Local...

  --- 
  --
  TreKing http://sites.google.com/site/rezmobileapps/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: Scenario where initLoader() does not call onLoadFinished()

2011-10-11 Thread Mark Murphy
On Tue, Oct 11, 2011 at 11:34 AM, kaciula catalin.moro...@gmail.com wrote:
 Here you go: https://github.com/kaciula/BugRetain
 It uses a CursorLoader to take 2 values from a database through a content
 provider and shows them on screen. Press the button to move to a second
 activity, then press BACK and then switch orientation of device. The values
 from db are no longer showing.

OK. It may take a few days before I get a chance to look at this,
given my travel schedule and other commitments.

 PS: I am eagerly awaiting a thorough chapter for loaders in your books :)

I don't know how much constitutes thorough but I have a loader
chapter coming in the next edition of _The Busy Coder's Guide to
Advanced Android Development_. Since I think we will remain Ice Cream
Sandwich-less this week, I hope to publish this update on Monday. I
want to examine your issue before I do that, though, as there's
probably something I should be adding to the chapter, either the
solution for the problem, or a warning to others about the problem.

Thanks for posting the sample!

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

Android 3.1 Programming Books: http://commonsware.com/books

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


[android-developers] Re: Service to Activity communication with Broadcast Reciever every 1 sec . Is this right approach?

2011-10-11 Thread Studio LFP
You may want to check out a foreground service if you need a high priority 
service like playing music, etc.

http://developer.android.com/reference/android/app/Service.html#startForeground%28int,%20android.app.Notification%29

This should make it a foreground application and help keep it from being 
destroyed for needed memory.

Steven
Studio LFP
http://www.studio-lfp.com


On Tuesday, October 11, 2011 3:33:53 PM UTC-5, NikolaMKD wrote:

 Will START_STICKY keep my service running even if the phone is locked 
 or activity is not visible to the user anymore? 

 On Oct 11, 10:21 pm, NikolaMKD nikola.d...@gmail.com wrote: 
  I have to create AIDL for methods from which I'll have access to the 
  service. If I have each player feature(play, next, previous) I'm 
  starting new service with startService(), when onBind() the object 
  that will be returned to be used to control the service will I still 
  have the access to the service whenever another call to startService 
  is made? 
  
  On Oct 11, 9:20 pm, TreKing treki...@gmail.com wrote: 
  
  
  
  
  
  
  
   On Tue, Oct 11, 2011 at 1:58 PM, NikolaMKD nikola.d...@gmail.comwrote: 

  
3. Is there any rather better approach than this one? Point me 
 some... 
  
  http://developer.android.com/reference/android/app/Service.html#Local... 

  
   
 --- 
 -- 
   TreKing http://sites.google.com/site/rezmobileapps/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

  1   2   >