[android-developers] Making money through advertising in an Android Application

2010-04-01 Thread jax
Does anyone know if there is any money to be made in Android
Advertising inside an app?

1.  Is anyone making any money?
2.  If so how much and what is your average downloads per day from the
Market?
3.  Is AppMobile the best choice?

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: TimerTask Thread problems

2010-01-12 Thread jax
I actually resolved this issue.

I was nothing to do with the TimerTask!



On Jan 11, 11:43 pm, jax jackma...@gmail.com wrote:
 I am having TimerTask Thread problems.  Basically I am running a
 TimerTask to update a clock timer I have created.  When the user gets
 an answer correct a small animation will play and the screen will be
 idle for about 5 seconds, then it will resume with the next question.

 The problem is that when I flip the G1 screen, the clock will have
 already started (Sometimes almost 3/4 through).  It seems to me that
 the initial TimerTask thread did not finish and now there are two
 different ones running at the same time.  I have cancelled the
 TimerTask and the Timer in the onStop() method as seem below.

 Any ideas?

 In the onStart() methods I have this:

                         mClockTimerTask = new TimerTask() {

                                 @Override
                                 public void run() {
                                         if(!clockPaused) {
                                                 if(mClock.getSweepArc() = 
 360) {
                                                         clockPaused = true;
                                                         
 mHandler.post(skipFromThread);
                                                         mClock.setAngleArc(0);
                                                 } else {
                                                         mHandler.post(new 
 Runnable() {
                                                                 @Override
                                                                 public void 
 run() {
                                                                         
 mClock.setAngleArc(mClock.getSweepArc()+mArcChangePerSecond);
                                                                 }
                                                         });
                                                 }
                                         }

                                 }
                         };

                         mClockTimer = new Timer();
                         mClockTimer.schedule(mClockTimerTask, 0,500);

 Here is my onStop() method:

         @Override
         protected void onStop() {
                 super.onStop();
                 if (Constants.DEBUG_LOG) {
                         Log.d(TAG, onStop());
                 }

                 //Stop the timer
                 mClockTimerTask.cancel();
                 mClockTimer.cancel();
                 mClockTimer = null;
         }-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] TimerTask Thread problems

2010-01-11 Thread jax
I am having TimerTask Thread problems.  Basically I am running a
TimerTask to update a clock timer I have created.  When the user gets
an answer correct a small animation will play and the screen will be
idle for about 5 seconds, then it will resume with the next question.

The problem is that when I flip the G1 screen, the clock will have
already started (Sometimes almost 3/4 through).  It seems to me that
the initial TimerTask thread did not finish and now there are two
different ones running at the same time.  I have cancelled the
TimerTask and the Timer in the onStop() method as seem below.

Any ideas?

In the onStart() methods I have this:


mClockTimerTask = new TimerTask() {

@Override
public void run() {
if(!clockPaused) {
if(mClock.getSweepArc() = 360) 
{
clockPaused = true;

mHandler.post(skipFromThread);
mClock.setAngleArc(0);
} else {
mHandler.post(new 
Runnable() {
@Override
public void 
run() {

mClock.setAngleArc(mClock.getSweepArc()+mArcChangePerSecond);
}
});
}
}


}
};

mClockTimer = new Timer();
mClockTimer.schedule(mClockTimerTask, 0,500);




Here is my onStop() method:

@Override
protected void onStop() {
super.onStop();
if (Constants.DEBUG_LOG) {
Log.d(TAG, onStop());
}

//Stop the timer
mClockTimerTask.cancel();
mClockTimer.cancel();
mClockTimer = null;
}
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 get the version information

2010-01-10 Thread jax
How to I get the version name from the Manifest, I tried the following
but I get a Null Pointer Exception.

//Set the version
PackageInfo info = new PackageInfo();

TextView versionTextView = (TextView) 
findViewById(R.id.version);
versionTextView.setText(Version +info.versionName);
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: How to get the version information

2010-01-10 Thread jax
Solved it:  use

PackageInfo pinfo = getPackageManager().getPackageInfo
(this.getPackageName(), 0);
String versionName = pinfo.versionName;


On Jan 10, 5:14 pm, jax jackma...@gmail.com wrote:
 How to I get the version name from the Manifest, I tried the following
 but I get a Null Pointer Exception.

                 //Set the version
                 PackageInfo info = new PackageInfo();

                 TextView versionTextView = (TextView) 
 findViewById(R.id.version);
                 versionTextView.setText(Version +info.versionName);
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Resetting a HTTP InputStream...is this possible?

2010-01-09 Thread jax

I am getting the input of a webpage using

InputStream in = httpConnection.getInputStream();

I then use the XmlPullParser to check if an error has occurred.

If no error has occurred, I then want to reset the InputStream back to
the beginning so that I can parse it through another function I have
created.

I tried

in.reset();

but this does not work.  Is this possible?
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Resetting a HTTP InputStream...is this possible?

2010-01-09 Thread jax
What I mean is that I just want to start reading from the start of the
Stream again, not request the whole http page again.

so basically - read a little of the stream and do some tests I have
created

then send the stream to another function where I need the entire
stream from the beginning



On Jan 9, 10:31 pm, Maps.Huge.Info (Maps API Guru)
cor...@gmail.com wrote:
 It would seem to me that a more logical approach would be to save the
 stream when reading it then parse the data rather than re-read the
 stream a second time. What if the second time there was an error? I'm
 not positive how this works, it may be that the stream is cached so
 you're not actually making a second http request by resetting it, but
 then again, you may in which case it would be very wasteful to reset.

 -John Coryat

 Radar Now!

 What Zip Code?
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Restarting an application programatically

2009-12-21 Thread jax
I need to restart my application in response to a particular event.

How do I do this?  I need to do a full restart, ie. kill the process
and start it again.

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] Base64.decodeBase64

2009-12-21 Thread jax
I need to use Base64.decodeBase64 in my application, I had to download
and include it myself into my project from apache commons.

Why is this not included in the default Android base system?  Are
there some weird licensing issues with this function or is it hidden
somewhere else under a different name?

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] Soft keyboard allows input when field is disabled

2009-12-21 Thread jax
I have disabled a text field but the soft keyboard still allows me to
enter text.

how do I stop this?

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


[android-developers] Getting hold of PreferenceActivity Views from the xml file

2009-12-13 Thread jax
I have an XML file called user_preferences that contains my
preferences for my application.

How do I get hold of the different preference Views so that I can
validate them?

Currently I have the code below which is not working because
getSharedPreferences does not return a View.



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

addPreferencesFromResource(R.xml.user_preferences);

//get a handle on preferences that require validation
timeLimitPreference = (EditTextPreference) 
this.getSharedPreferences
(time_limit, MODE_PRIVATE);
timeLimitPreference.setOnPreferenceChangeListener(new
OnPreferenceChangeListener() {

@Override
public boolean onPreferenceChange(Preference 
preference, Object
newValue) {
//Check that the string is an integer.

if( newValue.toString()!=null  
newValue.toString().matches(\\d
{1-5}) ) {
Log.e(TAG, Not a number);
newValue = 30;
return true;
}
Log.e(TAG, Is a number);
return false;
}
});

}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Getting hold of PreferenceActivity Views from the xml file

2009-12-13 Thread jax
Yes that worked

I used:

timeLimitPreference = getPreferenceScreen().findPreference
(time_limit);

to get hold of the preference and then:

timeLimitPreference.setOnPreferenceChangeListener

to to validate the preference returning false if it was no successful
and thus canceling the change.

cheers


On Dec 13, 3:52 pm, Mark Murphy mmur...@commonsware.com wrote:
  I have an XML file called user_preferences that contains my
  preferences for my application.

  How do I get hold of the differentpreferenceViews so that I can
  validate them?

  Currently I have the code below which is not working because
  getSharedPreferences does not return a View.

 You can try calling getPreferenceScreen(), though a better approach is to
 add more validation-style configuration to the preferences themselves. For
 example, EditTextPreference supports all of the XML attributes that
 EditText does for determining input type and such.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.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: Securing a paid app

2009-12-06 Thread jax
Agreed, I don't want to get into any trouble.

What about storing a hash of the ime.  Then I am unable to identify
the actual ime that was used but I am still able validate.



On Nov 23, 10:53 pm, Fred Grott(Android Expert, 
http://mobilebytes.wordpress.com)
fred.gr...@gmail.com wrote:
 I agree getting IMEI to store on a server not in telecoms control bad
 idea..both security wise and legally..

 Fred GrottAndroidDeveloper 
 |http://mobilebytes.wordpess.com|http://twitter.com/sharemefg|http://www.linkedin.com/in/shareme|
 gtalk: fred.grott | skype: fred.grott | googlewave:
 fred.gr...@googlewave.com |
 gmail:fred.gr...@gmail.com

 On Nov 23, 9:23 am, David Given d...@cowlark.com wrote:

  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1

  jax wrote:

  [...]

   How would I go about generating the hash code?  I am intending on
   using the ime.

  If you're in the UK and you want to keep track of customers' IMEIs, you
  may need to get legal advice --- there's a good chance you'll be liable
  under the Data Protection Act (as you're storing personally identifiable
  information).

  - --
  ┌─── dg@cowlark.com ─http://www.cowlark.com─
  │
  │ Sufficiently advanced incompetence is indistinguishable from
  │ malice. -- Vernon Schryver
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1.4.9 (GNU/Linux)
  Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org

  iEYEARECAAYFAksKqO8ACgkQf9E0noFvlzjDQgCgrXFzamiu5EX6agg7NFI7OKiz
  BUEAn1CMcFfWIro+V8E7RtbDMF3rPqLa
  =KH5U
  -END PGP SIGNATURE-

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


[android-developers] Using external source inside my program (Eliminating Swing components)

2009-12-05 Thread jax
Hi

I am having a little trouble using some external source files.  I am
new to eclipse and the methods used to import external source files.

Basically this is what I have done.

Downloaded the source files for a java project called TrueLicense
via CVS.
Imported this library by going to Projects and adding the
TrueLicense project (I am not sure if I should do this in Source,
projects or Libraries?)
Imported the required classes into my android project without any
compile errors.

When I run the program I get:

12-05 15:52:28.632: WARN/dalvikvm(724): VFY: unable to find class
referenced in signature (Ljavax/swing/filechooser/FileFilter;)

Then a whole lot of other errors.

This seems sensible as there is a sections of the TrueLicense package
that used SWING.  How do I only import the parts of TrueLicense that I
need?

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


[android-developers] Re: Using external source inside my program (Eliminating Swing components)

2009-12-05 Thread jax
Hi

Well the part of the project I need actually has no references to
Swing.

The project looks like this

de.schlichtherle.license
de.schlichtherle.ftp
de.schlichtherle.wizard

All the swing parts are in the wizard section.  I don't want anything
from this package at all so can simple remove it.  But I don't know
how.  Should I just delete it from the CVS project?  Copy the
necessary files into my android project or create a new project with a
subset of the downloaded CVS one?

thanks

On Dec 5, 4:42 pm, Mark Murphy mmur...@commonsware.com wrote:
  I am having a little trouble using some external source files.  I am
  new to eclipse and the methods used to import external source files.

  Basically this is what I have done.

  Downloaded the source files for a java project called TrueLicense
  via CVS.
  Imported this library by going to Projects and adding the
  TrueLicense project (I am not sure if I should do this in Source,
  projects or Libraries?)
  Imported the required classes into my android project without any
  compile errors.

  When I run the program I get:

  12-05 15:52:28.632: WARN/dalvikvm(724): VFY: unable to find class
  referenced in signature (Ljavax/swing/filechooser/FileFilter;)

  Then a whole lot of other errors.

  This seems sensible as there is a sections of the TrueLicense package
  that used SWING.  How do I only import the parts of TrueLicense that I
  need?

 With some pain, I imagine. The question is whether there will be any
 functionality left after you clean up the Swing references.

 You'll need to search your source tgree, looking for javax.swing.*
 imports, and either deleting the source files referencing Swing or perhaps
 just commenting out bits of those files that use Swing. This, in turn,
 will break other stuff that depends on the stuff that depends on Swing, so
 you'll need to comment out or otherwise repair those references as well.
 And so on.

 Sometimes, you get lucky, and there are few references, and they are
 fairly isolated. For example, I got Rhino (Javascript interpreter in Java)
 working in Android 1.1 after fixing up references to some java.beans.*
 interfaces and classes. Fortunately, these were isolated in a single file.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.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: Using external source inside my program (Eliminating Swing components)

2009-12-05 Thread jax
Oh...actually I just saw a Swing reference.

So this means that I will need to delete all swing references right.


On Dec 5, 5:01 pm, jax jackma...@gmail.com wrote:
 Hi

 Well the part of the project I need actually has no references to
 Swing.

 The project looks like this

 de.schlichtherle.license
 de.schlichtherle.ftp
 de.schlichtherle.wizard

 All the swing parts are in the wizard section.  I don't want anything
 from this package at all so can simple remove it.  But I don't know
 how.  Should I just delete it from the CVS project?  Copy the
 necessary files into my android project or create a new project with a
 subset of the downloaded CVS one?

 thanks

 On Dec 5, 4:42 pm, Mark Murphy mmur...@commonsware.com wrote:

   I am having a little trouble using some external source files.  I am
   new to eclipse and the methods used to import external source files.

   Basically this is what I have done.

   Downloaded the source files for a java project called TrueLicense
   via CVS.
   Imported this library by going to Projects and adding the
   TrueLicense project (I am not sure if I should do this in Source,
   projects or Libraries?)
   Imported the required classes into my android project without any
   compile errors.

   When I run the program I get:

   12-05 15:52:28.632: WARN/dalvikvm(724): VFY: unable to find class
   referenced in signature (Ljavax/swing/filechooser/FileFilter;)

   Then a whole lot of other errors.

   This seems sensible as there is a sections of the TrueLicense package
   that used SWING.  How do I only import the parts of TrueLicense that I
   need?

  With some pain, I imagine. The question is whether there will be any
  functionality left after you clean up the Swing references.

  You'll need to search your source tgree, looking for javax.swing.*
  imports, and either deleting the source files referencing Swing or perhaps
  just commenting out bits of those files that use Swing. This, in turn,
  will break other stuff that depends on the stuff that depends on Swing, so
  you'll need to comment out or otherwise repair those references as well.
  And so on.

  Sometimes, you get lucky, and there are few references, and they are
  fairly isolated. For example, I got Rhino (Javascript interpreter in Java)
  working in Android 1.1 after fixing up references to some java.beans.*
  interfaces and classes. Fortunately, these were isolated in a single file.

  --
  Mark Murphy (a Commons Guy)http://commonsware.com
  Android App Developer Books:http://commonsware.com/books.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: Using external source inside my program (Eliminating Swing components)

2009-12-05 Thread jax
Hi Mark

I just commented out the Swing import into the suspect class and the
only package that is broken is de.schlichtherle.wizard.  This is the
exact package that I don't need.  Should I just delete this package?


On Dec 5, 5:06 pm, Mark Murphy mmur...@commonsware.com wrote:
  Well the part of the project I need actually has no references to
  Swing.

  The project looks like this

  de.schlichtherle.license
  de.schlichtherle.ftp
  de.schlichtherle.wizard

  All the swing parts are in the wizard section.  I don't want anything
  from this package at all so can simple remove it.  But I don't know
  how.  Should I just delete it from the CVS project?  Copy the
  necessary files into my android project or create a new project with a
  subset of the downloaded CVS one?

 Personally, I'd start with the copy the necessary files into my android
 project approach. You might consider setting it up as as separate project
 building an ordinary Java JAR, containing only the subset you need, but
 without knowing the source or your intentions, I can't say whether that
 will be worthwhile.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.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: Using external source inside my program (Eliminating Swing components)

2009-12-05 Thread jax
Hi Mark

Got it working.
I actually copied the parts I wanted into my own personal project
called myAndroidLibraries.  It works a treat.  However, this will
obviously eliminate any updates made by the author, is this a good
idea?  I could have just deleted the Wizard package from the CSV
project and continued to receive updates.  would that have been a
better option?



On Dec 5, 5:18 pm, Mark Murphy mmur...@commonsware.com wrote:
  I just commented out the Swing import into the suspect class and the
  only package that is broken is de.schlichtherle.wizard.  This is the
  exact package that I don't need.  Should I just delete this package?

 It is worth a shot. When you delete the package, there may be references
 to the deleted package from the other packages, and you'll need to comment
 those out as well.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.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] KeyStore JKS implementation not found

2009-12-05 Thread jax
I am trying to create certificates for users for my program

I am have created a keystore and included the publickeystore.store
with my application in the assets folder.  I created all the
certificates using the keytool program from JAVA.

When I try to authenticate the certificate I get the following error:

12-05 17:32:49.962: ERROR/AndroidRuntime(891): Caused by:
java.security.KeyStoreException: KeyStore JKS implementation not found


What does this mean?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: KeyStore JKS implementation not found

2009-12-05 Thread jax
I have discovered that JKS is not supported by android.

How do I create a BKS keystore?




On Dec 5, 5:55 pm, jax jackma...@gmail.com wrote:
 I am trying to create certificates for users for my program

 I am have created a keystore and included the publickeystore.store
 with my application in the assets folder.  I created all the
 certificates using the keytool program from JAVA.

 When I try to authenticate the certificate I get the following error:

 12-05 17:32:49.962: ERROR/AndroidRuntime(891): Caused by:
 java.security.KeyStoreException: KeyStore JKS implementation not found

 What does this mean?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Getting a File object from android

2009-12-05 Thread jax
I have a library that takes a File object as a parameter to one of the
functions.

I am getting the file like this:

this.openFileOutput(myFile, MODE_PRIVATE)

I need to load this file from the system, however, I don't know how to
convert FileOutputStream to File.  Or is there another way of doing
this?

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


[android-developers] Re: Getting a File object from android

2009-12-05 Thread jax
OK thanks



On Dec 6, 1:56 am, Mark Murphy mmur...@commonsware.com wrote:
  I have a library that takes a File object as a parameter to one of the
  functions.

  I am getting the file like this:

  this.openFileOutput(myFile, MODE_PRIVATE)

  I need to load this file from the system, however, I don't know how to
  convert FileOutputStream to File.  Or is there another way of doing
  this?

 Instead of openFileOutput(), use getFilesDir() to get a File pointing to
 the directory where openFileOutput() files go. Then, use normal File
 constructors to create a File object pointing to the file you want to
 create or use.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.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] Failed to resolve class help (custom java library)

2009-12-05 Thread jax
I am using a program I downloaded called TrueLicense.  So far I have
got everything working.  I am now trying to install a license file but
am getting the following errors.  Does anyone know what this means?


12-06 09:17:49.588: INFO/dalvikvm(2637): Failed resolving Lde/
schlichtherle/xml/PersistenceService$1; interface 248 'Ljava/beans/
ExceptionListener;'
12-06 09:17:49.598: WARN/dalvikvm(2637): Link of class 'Lde/
schlichtherle/xml/PersistenceService$1;' failed
12-06 09:17:49.598: ERROR/dalvikvm(2637): Could not find class
'de.schlichtherle.xml.PersistenceService$1', referenced from method
de.schlichtherle.xml.PersistenceService.getExceptionListener
12-06 09:17:49.598: WARN/dalvikvm(2637): VFY: unable to resolve new-
instance 242 (Lde/schlichtherle/xml/PersistenceService$1;) in Lde/
schlichtherle/xml/PersistenceService;
12-06 09:17:49.598: WARN/dalvikvm(2637): VFY:  rejecting opcode 0x22
at 0x0007
12-06 09:17:49.598: WARN/dalvikvm(2637): VFY:  rejected Lde/
schlichtherle/xml/PersistenceService;.getExceptionListener ()Ljava/
beans/ExceptionListener;
12-06 09:17:49.598: WARN/dalvikvm(2637): Verifier rejected class Lde/
schlichtherle/xml/PersistenceService;
12-06 09:17:57.587: DEBUG/AndroidRuntime(2637): Shutting down VM
12-06 09:17:57.587: WARN/dalvikvm(2637): threadid=3: thread exiting
with uncaught exception (group=0x4001aa28)
12-06 09:17:57.587: ERROR/AndroidRuntime(2637): Uncaught handler:
thread main exiting due to uncaught exception
12-06 09:17:57.747: ERROR/AndroidRuntime(2637): java.lang.VerifyError:
de.schlichtherle.xml.PersistenceService

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: KeyStore JKS implementation not found

2009-12-05 Thread jax
I found out how:

bouncycastle.org

On Dec 5, 8:18 pm, jax jackma...@gmail.com wrote:
 I have discovered that JKS is not supported by android.

 How do I create a BKS keystore?

 On Dec 5, 5:55 pm, jax jackma...@gmail.com wrote:

  I am trying to create certificates for users for my program

  I am have created a keystore and included the publickeystore.store
  with my application in the assets folder.  I created all the
  certificates using the keytool program from JAVA.

  When I try to authenticate the certificate I get the following error:

  12-05 17:32:49.962: ERROR/AndroidRuntime(891): Caused by:
  java.security.KeyStoreException: KeyStore JKS implementation not found

  What does this mean?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Failed to resolve class help (custom java library)

2009-12-05 Thread jax
I may have has some progress.

From the online documentation I cannot see the class
java.beans.ExceptionListener

In the code ExceptionListener is called:

listener = new ExceptionListener() {
   public void exceptionThrown(Exception e) {
   Log.e(PersistenceService, Error: throwing
UndeclaredThrowableException);
   throw new UndeclaredThrowableException(e);
}
};

Is there some sort of Android equivalent I could use?



On Dec 6, 9:35 am, jax jackma...@gmail.com wrote:
 I am using a program I downloaded called TrueLicense.  So far I have
 got everything working.  I am now trying to install a license file but
 am getting the following errors.  Does anyone know what this means?

 12-06 09:17:49.588: INFO/dalvikvm(2637): Failed resolving Lde/
 schlichtherle/xml/PersistenceService$1; interface 248 'Ljava/beans/
 ExceptionListener;'
 12-06 09:17:49.598: WARN/dalvikvm(2637): Link of class 'Lde/
 schlichtherle/xml/PersistenceService$1;' failed
 12-06 09:17:49.598: ERROR/dalvikvm(2637): Could not find class
 'de.schlichtherle.xml.PersistenceService$1', referenced from method
 de.schlichtherle.xml.PersistenceService.getExceptionListener
 12-06 09:17:49.598: WARN/dalvikvm(2637): VFY: unable to resolve new-
 instance 242 (Lde/schlichtherle/xml/PersistenceService$1;) in Lde/
 schlichtherle/xml/PersistenceService;
 12-06 09:17:49.598: WARN/dalvikvm(2637): VFY:  rejecting opcode 0x22
 at 0x0007
 12-06 09:17:49.598: WARN/dalvikvm(2637): VFY:  rejected Lde/
 schlichtherle/xml/PersistenceService;.getExceptionListener ()Ljava/
 beans/ExceptionListener;
 12-06 09:17:49.598: WARN/dalvikvm(2637): Verifier rejected class Lde/
 schlichtherle/xml/PersistenceService;
 12-06 09:17:57.587: DEBUG/AndroidRuntime(2637): Shutting down VM
 12-06 09:17:57.587: WARN/dalvikvm(2637): threadid=3: thread exiting
 with uncaught exception (group=0x4001aa28)
 12-06 09:17:57.587: ERROR/AndroidRuntime(2637): Uncaught handler:
 thread main exiting due to uncaught exception
 12-06 09:17:57.747: ERROR/AndroidRuntime(2637): java.lang.VerifyError:
 de.schlichtherle.xml.PersistenceService

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Failed to resolve class help (custom java library)

2009-12-05 Thread jax
Actually this project refers to java.beans a number of times

import java.beans.Encoder;
import java.beans.ExceptionListener;
import java.beans.PersistenceDelegate;
import java.beans.XMLEncoder;
import java.beans.XMLDecoder;


Is there anyway to getting hold of these classes in android?
Can I download a .jar or something and ship it with my app?




On Dec 6, 10:42 am, jax jackma...@gmail.com wrote:
 I may have has some progress.

 From the online documentation I cannot see the class
 java.beans.ExceptionListener

 In the code ExceptionListener is called:

 listener = new ExceptionListener() {
    public void exceptionThrown(Exception e) {
            Log.e(PersistenceService, Error: throwing
 UndeclaredThrowableException);
            throw new UndeclaredThrowableException(e);
         }
     };

 Is there some sort of Android equivalent I could use?

 On Dec 6, 9:35 am, jax jackma...@gmail.com wrote:

  I am using a program I downloaded called TrueLicense.  So far I have
  got everything working.  I am now trying to install a license file but
  am getting the following errors.  Does anyone know what this means?

  12-06 09:17:49.588: INFO/dalvikvm(2637): Failed resolving Lde/
  schlichtherle/xml/PersistenceService$1; interface 248 'Ljava/beans/
  ExceptionListener;'
  12-06 09:17:49.598: WARN/dalvikvm(2637): Link of class 'Lde/
  schlichtherle/xml/PersistenceService$1;' failed
  12-06 09:17:49.598: ERROR/dalvikvm(2637): Could not find class
  'de.schlichtherle.xml.PersistenceService$1', referenced from method
  de.schlichtherle.xml.PersistenceService.getExceptionListener
  12-06 09:17:49.598: WARN/dalvikvm(2637): VFY: unable to resolve new-
  instance 242 (Lde/schlichtherle/xml/PersistenceService$1;) in Lde/
  schlichtherle/xml/PersistenceService;
  12-06 09:17:49.598: WARN/dalvikvm(2637): VFY:  rejecting opcode 0x22
  at 0x0007
  12-06 09:17:49.598: WARN/dalvikvm(2637): VFY:  rejected Lde/
  schlichtherle/xml/PersistenceService;.getExceptionListener ()Ljava/
  beans/ExceptionListener;
  12-06 09:17:49.598: WARN/dalvikvm(2637): Verifier rejected class Lde/
  schlichtherle/xml/PersistenceService;
  12-06 09:17:57.587: DEBUG/AndroidRuntime(2637): Shutting down VM
  12-06 09:17:57.587: WARN/dalvikvm(2637): threadid=3: thread exiting
  with uncaught exception (group=0x4001aa28)
  12-06 09:17:57.587: ERROR/AndroidRuntime(2637): Uncaught handler:
  thread main exiting due to uncaught exception
  12-06 09:17:57.747: ERROR/AndroidRuntime(2637): java.lang.VerifyError:
  de.schlichtherle.xml.PersistenceService

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Securing a paid app

2009-11-23 Thread jax
I am still trying to get my head around this.

How would I go about generating the hash code?  I am intending on
using the ime.

Do I need public private keys?

confused...

On Nov 15, 3:39 am, Pooper code...@gmail.com wrote:
 What you can do is make your user enter serial #, the serial number
 could
 be a hashing function that you come up with that takes the device id
 (could be the imei number)
 the application could then check if the serial/hash code matches for
 that device.  This would
 require your customer to send you his/her imei # or another unique #
 associated with the device so that
 you can generate the serial code for that device.

 You can also implement a two step method so that the customer can't
 accidently enter in their imei incorrectly by misstake.

 To do it this way you would generate a Request For Serial Number
 Code store this code in your database.  The costomer
 enters this code in their phone, your phone connects to your web
 server sends the Request for Serial number code and the
 IMEI number of the phone with it.  Your server generates the hash/
 serial and sends it back to the phone.  You can then mark
 the Request for serial number code as used so that they can not use
 it for another device.  This is the method I use for my
 applications.

 On Nov 14, 8:39 am,jaxjackma...@gmail.com wrote:

  Yes, that is why I have posted the question because I don't know how
  to do it.

  Has anyone done this before or know of a method for achieving this?

  On Nov 14, 10:23 pm, Andrei gml...@gmail.com wrote:

   What u want to do is to tie your app to one device
   How u do it up to u

   On Nov 14, 7:12 am,jaxjackma...@gmail.com wrote:

I am wondering how I might go aboutsecuringa paid app on Android.

I am thinking of selling the application from my own website via
PayPal, however, how will I stop people from sharing it with their
friends etc.  Does Android have any type of native support for this?- 
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: Securing a paid app

2009-11-23 Thread jax
How do you get hold of the users google account from your app?



On Nov 17, 10:03 pm, Streets Of Boston flyingdutc...@gmail.com
wrote:
 What would happen if someone gets a new android phone? The app's
 authentication will fail.

 You should hash/key on the user's google-account, the same key that is
 used by Android Market (you can download paid apps as often as you
 want - once you paid for them - based on your google-account)

 On Nov 15, 2:32 am, android kracker markamorris2...@gmail.com wrote:

  Using the unique ID (hash) of the phone, register it with your web
  service on install.
  Then employ PKI to authenticate your app on each launch.
  On your web service sign a string containing the hash, timestamp, and
  a short expiration timestamp.
  Then have your app use your public key (in the app) to authenticate
  the string, verify the timestamps, and complete
  the launch if valid, otherwise abort the launch or offer the user to
  come clean and install.
  To prevent code modification--bypassing the check--don't include all
  of the code in the app.
  Keep some of it on the server and only send it to the app if the check
  takes place and passes the check.
  This way the app will not function correctly unless the check is
  performed and passes.
  Create a set of one-off methods (dummys that just pass through) that
  you can dynamically use with each app instance; since you
  are in control of the download (unlike Market publishers), you can
  dynamically build and package a unique app for each instance
  downloaded.
  This way no two apps use the same method and a hacker is up a creek as
  far a patching the code
  and replicating it to the community. When one instance is cracked, and
  it will be, then your server can cancel that hacked instance
  without effecting all of the other valid users. This will create a
  string disincentive, because no two app are the same, codewise ;-)

  Maybe we should start a service and offer Android publishers a secure
  distribution service, unlike the Market.
  There is no way to register (stamp an app with a phone id) downloads
  from the Market prior to installation.
  As it stands now publishers have no way to verify if their app was
  downloaded from the Market or copied and installed by other means.

  If there is I would like to know. I've asked but I never get replies
  regarding this advanced topic. Most publishers are still learning to
  just create apps, let alone seek out secure distribution and customer
  behavior--only Google enjoys this privilege, currently.

  Here's a method snippet for getting the unique ID and hashing it:

  String getPhoneID(){
          MessageDigest digest;
          try {
              digest = MessageDigest.getInstance(SHA-1);
          } catch (NoSuchAlgorithmException e) {
              throw new RuntimeException(this should never happen);
          }

          String srvcName = Context.TELEPHONY_SERVICE;
          TelephonyManager telephonyManager =
            (TelephonyManager)getSystemService(srvcName);

          /* requires READ_PHONE_STATE permission */
          String deviceId = telephonyManager.getDeviceId();
          if (TextUtils.isEmpty(deviceId)) {
              return ;
          }

          byte[] hashedDeviceId = digest.digest(deviceId.getBytes());
          String id = new String(Base64.encodeBase64(hashedDeviceId), 0,
  12);
          id = id.replaceAll(/, _);
          return id;

  }

  On Nov 14, 7:12 am,jaxjackma...@gmail.com wrote:

   I am wondering how I might go aboutsecuringa paid app on Android.

   I am thinking of selling the application from my own website via
   PayPal, however, how will I stop people from sharing it with their
   friends etc.  Does Android have any type of native support for this?- 
   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] Returning gmail email from device

2009-11-22 Thread jax
1.  Will/do all android phones use the gmail account sign-up system?
Is this a permanent thing or will it change in the future?

2. How do you return the users gmail account that they use to sign up
to android with.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Encrypting in PHP and Decrypting in Android

2009-11-22 Thread jax
What would I use to: Encrypt a string in PHP and Decrypt that string
from Android?  What methods are supported by both and which is the
most secure?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Saving Activity state when pressing Home

2009-11-20 Thread jax
Hi thanks that.

The issue is that the Bundle object only gets passed to onCreate()
and onSaveInstanceState()

Do I have to get this manually somehow?



On Nov 20, 2:15 am, vendor.net vendor@gmail.com wrote:
 How do you store that variable?

 On 19 Ноем, 17:18, jax jackma...@gmail.com wrote:

  I need to store a variable that contains my application state
  restoredClockTime

  I do this in onSaveInstanceState and onRestoreInstanceState and it
  works when I flip the screen on the G1.

  The problem is when I press the Home button and then re-enter the
  activity it does not work.

  why is this?



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


[android-developers] Re: Setting the ID in a SimpleAdapter

2009-11-19 Thread jax
What is the best way to do this?

Extend the ListView...or the adapter?

Or is there are more efficient way?

On Nov 19, 3:07 am, jeffro j...@trackaroo.com wrote:
 You need to implement the Adapter method to pass the id value you
 want:

 public long getItemId(int index) {}

 On Nov 18, 7:17 am, jax jackma...@gmail.com wrote:

  How do you set the Id attribute for a SimpleAdapter so that when you
  run

  onItemClick(AdapterView? parent, View view,int position, long id)

  I will be able to get the id?

  The data is coming from an XML file.



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


[android-developers] Re: Setting the ID in a SimpleAdapter

2009-11-19 Thread jax
OK, I did it by extending SimpleAdapter.

cheers

On Nov 19, 6:59 pm, jax jackma...@gmail.com wrote:
 What is the best way to do this?

 Extend the ListView...or the adapter?

 Or is there are more efficient way?

 On Nov 19, 3:07 am, jeffro j...@trackaroo.com wrote:

  You need to implement the Adapter method to pass the id value you
  want:

  public long getItemId(int index) {}

  On Nov 18, 7:17 am, jax jackma...@gmail.com wrote:

   How do you set the Id attribute for a SimpleAdapter so that when you
   run

   onItemClick(AdapterView? parent, View view,int position, long id)

   I will be able to get the id?

   The data is coming from an XML file.



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Saving Activity state when pressing Home

2009-11-19 Thread jax
I need to store a variable that contains my application state
restoredClockTime

I do this in onSaveInstanceState and onRestoreInstanceState and it
works when I flip the screen on the G1.

The problem is when I press the Home button and then re-enter the
activity it does not work.

why is this?

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


[android-developers] Setting the ID in a SimpleAdapter

2009-11-18 Thread jax
How do you set the Id attribute for a SimpleAdapter so that when you
run

onItemClick(AdapterView? parent, View view,int position, long id)

I will be able to get the id?

The data is coming from an XML file.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Adding hidden extra data to a ListView item

2009-11-17 Thread jax
I have downloaded and parsed an XML file.  The file contained and id
and name.  I want the name to be visible in a ListView but the id
to be hidden.  I am having trouble getting this working and have been
experimenting with ArrayAdapters and SimpleAdapters.  Below is what I
have so far.

listsArray = new ArrayListHashMapString,
String();
remoteListsAdapter = new SimpleAdapter(
getApplicationContext(),
listsArray,
android.R.layout.simple_list_item_1,
new String[] { id,name },
new int[] { android.R.id.text2 , 
android.R.id.text1} );

//Custom view to hold the id for the item in the 
setTag() method
remoteListsAdapter.setViewBinder(new ViewBinder() {

@Override
public boolean setViewValue(View view, Object 
data,
String textRepresentation) {

 //Maybe I can to somethig in
here like setTag etc.

return false;
}
});

I add items to the listsArray later on when parsing the XML file.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Securing a paid app

2009-11-14 Thread jax
I am wondering how I might go about securing a paid app on Android.

I am thinking of selling the application from my own website via
PayPal, however, how will I stop people from sharing it with their
friends etc.  Does Android have any type of native support for this?

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


[android-developers] Re: Securing a paid app

2009-11-14 Thread jax
Yes, that is why I have posted the question because I don't know how
to do it.

Has anyone done this before or know of a method for achieving this?


On Nov 14, 10:23 pm, Andrei gml...@gmail.com wrote:
 What u want to do is to tie your app to one device
 How u do it up to u

 On Nov 14, 7:12 am, jax jackma...@gmail.com wrote:

  I am wondering how I might go about securing a paid app on Android.

  I am thinking of selling the application from my own website via
  PayPal, however, how will I stop people from sharing it with their
  friends etc.  Does Android have any type of native support for this?



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


[android-developers] Subclass of ArrayAdapter not working

2009-11-04 Thread jax
I have subclassed ArrayAdapter to set the color of text to RED if the
string does not contain 100%, this has been added to a ListView.  The
problem is that some of the rows show as red when they contain 100%.
Why would this happen?


/*
 * Subclass of ArrayAdapter to change the color of the
 * text to red if it is not 100%
 *
 */
public class ScoringAdapter extends ArrayAdapterString {

private ArrayListString items;

public ScoringAdapter(Context context, int textViewResourceId,
ArrayListString items) {
super(context, textViewResourceId, items);
this.items = items;
}

@Override
public View getView(int position, View convertView, ViewGroup
parent) {
try {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater)
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate
(android.R.layout.simple_list_item_1, null);
}

String item = items.get(position);
TextView tv = (TextView) v.findViewById
(android.R.id.text1);
tv.setText(item);

if(!item.contains(100%)) {
tv.setTextColor(Color.RED);
}

return v;
}
catch(Exception e) {
e.printStackTrace();
}

return null;
}
}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Subclass of ArrayAdapter not working

2009-11-04 Thread jax
Thanks it worked, I changed it to

if(!item.contains(100%)) {
tv.setTextColor(Color.RED);
}
else {
tv.setTextColor(Color.BLACK);
}

but I still don't understand why...

Do you know any sites that explain about recycling views?




On Nov 4, 8:45 pm, Mark Murphy mmur...@commonsware.com wrote:
 jax wrote:
  I have subclassed ArrayAdapter to set the color of text to RED if the
  string does not contain 100%, this has been added to a ListView.  The
  problem is that some of the rows show as red when they contain 100%.
  Why would this happen?

 You are recycling rows but not resetting their color. Hence, over time,
 most if not all of your rows will be red.

                  if(!item.contains(100%)) {
                     tv.setTextColor(Color.RED);
                  }

 In the above code snippet, also handle the else branch and reset the
 color to its normal state.

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

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

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


[android-developers] Re: Subclass of ArrayAdapter not working

2009-11-04 Thread jax
Thanks, I will check it out



On Nov 4, 9:19 pm, Mark Murphy mmur...@commonsware.com wrote:
 jax wrote:
  Thanks it worked, I changed it to

                  if(!item.contains(100%)) {
                     tv.setTextColor(Color.RED);
                  }
                  else {
                     tv.setTextColor(Color.BLACK);
                  }

  but I still don't understand why...

  Do you know any sites that explain about recycling views?

 http://commonsware.com/Android/excerpt.pdf

 That is an excerpt from one of my books that talks about the process.

 Remember that the view you are recycling once held a row. Android does
 not somehow magically reset those rows to their original look. Hence, if
 you changed the color before, you may have to change it back.

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

 Android Consulting/App Development:http://commonsware.com/consulting

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Subclass of ArrayAdapter not working

2009-11-04 Thread jax
Actually Mark I went to buy your book on Amazon the other day and it
is $417.24 ...???

The Busy Coder's Guide to Android Development by Mark L. Murphy
(Paperback - Feb 6, 2009)
1 new from $417.24.

What is with that?

Is there another way to buy it?  I am not in the US.






On Nov 4, 10:53 pm, jax jackma...@gmail.com wrote:
 Thanks, I will check it out

 On Nov 4, 9:19 pm, Mark Murphy mmur...@commonsware.com wrote:

  jax wrote:
   Thanks it worked, I changed it to

                   if(!item.contains(100%)) {
                      tv.setTextColor(Color.RED);
                   }
                   else {
                      tv.setTextColor(Color.BLACK);
                   }

   but I still don't understand why...

   Do you know any sites that explain about recycling views?

 http://commonsware.com/Android/excerpt.pdf

  That is an excerpt from one of my books that talks about the process.

  Remember that the view you are recycling once held a row. Android does
  not somehow magically reset those rows to their original look. Hence, if
  you changed the color before, you may have to change it back.

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

  Android Consulting/App Development:http://commonsware.com/consulting



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] When I scroll a list I get the force close message

2009-11-01 Thread jax
I have an ArrayList connected to a ListView with an onclick event that
loads some extra info about each list item.

When the list fits inside the screen (no scrolling) it works fine,
however, when the list becomes long enought that I need to scroll I
get the Force Close message.

why is this?

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


[android-developers] Re: When I scroll a list I get the force close message

2009-11-01 Thread jax
Here is the output from logcat as I scroll down


11-01 17:04:08.979: ERROR/StatsDisplay(1355):
android.widget.textv...@4381ade8 is not a valid ListView!
11-01 17:04:08.999: DEBUG/AndroidRuntime(1355): Shutting down VM
11-01 17:04:08.999: WARN/dalvikvm(1355): threadid=3: thread exiting
with uncaught exception (group=0x4001aa28)
11-01 17:04:08.999: ERROR/AndroidRuntime(1355): Uncaught handler:
thread main exiting due to uncaught exception
11-01 17:04:09.259: DEBUG/dalvikvm(1355): GC freed 7712 objects /
415992 bytes in 220ms
11-01 17:04:09.279: ERROR/AndroidRuntime(1355):
java.lang.NullPointerException
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.widget.ListView.setupChild(ListView.java:1683)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.widget.ListView.addViewBelow(ListView.java:2797)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.widget.ListView.scrollListItemsBy(ListView.java:2725)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.widget.ListView.arrowScrollImpl(ListView.java:2225)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.widget.ListView.arrowScroll(ListView.java:2172)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.widget.ListView.commonKey(ListView.java:1977)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.widget.ListView.onKeyDown(ListView.java:1924)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.view.KeyEvent.dispatch(KeyEvent.java:893)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.view.View.dispatchKeyEvent(View.java:3647)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:744)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.widget.ListView.dispatchKeyEvent(ListView.java:1909)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchKeyEvent(PhoneWindow.java:1708)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent
(PhoneWindow.java:1197)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.app.Activity.dispatchKeyEvent(Activity.java:1967)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent
(PhoneWindow.java:1684)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:
2329)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2299)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1621)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.os.Looper.loop(Looper.java:123)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
android.app.ActivityThread.main(ActivityThread.java:4203)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
java.lang.reflect.Method.invokeNative(Native Method)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
java.lang.reflect.Method.invoke(Method.java:521)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:791)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
11-01 17:04:09.279: ERROR/AndroidRuntime(1355): at
dalvik.system.NativeStart.main(Native Method)
11-01 17:04:09.319: INFO/Process(568): Sending signal. PID: 1355 SIG:
3
11-01 17:04:09.329: INFO/dalvikvm(1355): threadid=7: reacting to
signal 3
11-01 17:04:09.399: INFO/dalvikvm(1355): Wrote stack trace to '/data/
anr/traces.txt'
11-01 17:04:11.979: INFO/Process(1355): Sending signal. PID: 1355 SIG:
9




On Nov 1, 4:36 pm, Dexter#39;s Brain coomar@gmail.com wrote:
 A small code snippet or the stack trace would help us figure out the
 problem

 Dexter

 http://tech-droid.blogspot.com

 On Nov 1, 12:46 pm, jax jackma...@gmail.com wrote:

  I have an ArrayList connected to a ListView with an onclick event that
  loads some extra info about each list item.

  When the list fits inside the screen (no scrolling) it works fine,
  however, when the list becomes long enought that I need to scroll I
  get the Force Close message.

  why is this?



-- 
You received this message because you

[android-developers] Re: When I scroll a list I get the force close message

2009-11-01 Thread jax
Something I did not say - actually I forgot I even did it - is that I
subclasses ArrayAdapter.  Here is the subclass.




/*
 * Subclass of ArrayAdapter to change the color of the
 * text to red if it is not 100%
 *
 */
public class ScoringAdapter extends ArrayAdapterString {

private ArrayListString items;

public ScoringAdapter(Context context, int textViewResourceId,
ArrayListString items) {
super(context, textViewResourceId, items);
this.items = items;
}

@Override
public View getView(int position, View convertView, ViewGroup
parent) {
try {
View v = (ListView)convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater)
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate
(android.R.layout.simple_list_item_1, null);
}

String item = items.get(position);
TextView tv = (TextView) v.findViewById
(android.R.id.text1);
tv.setText(item);

if(!item.contains(100%)) {
tv.setTextColor(Color.RED);
}

return v;
}
catch(ClassCastException e) {
Log.e(TAG, convertView.toString()+ is not a valid
ListView!);
}

return null;
}
}



On Nov 1, 5:05 pm, jax jackma...@gmail.com wrote:
 Here is the output from logcat as I scroll down

 11-01 17:04:08.979: ERROR/StatsDisplay(1355):
 android.widget.textv...@4381ade8 is not a valid ListView!
 11-01 17:04:08.999: DEBUG/AndroidRuntime(1355): Shutting down VM
 11-01 17:04:08.999: WARN/dalvikvm(1355): threadid=3: thread exiting
 with uncaught exception (group=0x4001aa28)
 11-01 17:04:08.999: ERROR/AndroidRuntime(1355): Uncaught handler:
 thread main exiting due to uncaught exception
 11-01 17:04:09.259: DEBUG/dalvikvm(1355): GC freed 7712 objects /
 415992 bytes in 220ms
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):
 java.lang.NullPointerException
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.widget.ListView.setupChild(ListView.java:1683)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.widget.ListView.addViewBelow(ListView.java:2797)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.widget.ListView.scrollListItemsBy(ListView.java:2725)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.widget.ListView.arrowScrollImpl(ListView.java:2225)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.widget.ListView.arrowScroll(ListView.java:2172)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.widget.ListView.commonKey(ListView.java:1977)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.widget.ListView.onKeyDown(ListView.java:1924)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.view.KeyEvent.dispatch(KeyEvent.java:893)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.view.View.dispatchKeyEvent(View.java:3647)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:744)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.widget.ListView.dispatchKeyEvent(ListView.java:1909)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 com.android.internal.policy.impl.PhoneWindow
 $DecorView.superDispatchKeyEvent(PhoneWindow.java:1708)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent
 (PhoneWindow.java:1197)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.app.Activity.dispatchKeyEvent(Activity.java:1967)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent
 (PhoneWindow.java:1684)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:
 2329)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2299)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.view.ViewRoot.handleMessage(ViewRoot.java:1621)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355):     at
 android.os.Handler.dispatchMessage(Handler.java:99)
 11-01 17:04:09.279: ERROR/AndroidRuntime(1355

[android-developers] Re: Need an invitation to google Wave?

2009-11-01 Thread jax
yes thanks

On Nov 1, 4:26 pm, li jiecong lijiec...@gmail.com wrote:
 Hi, please give me an invitation, thx!

 2009/11/1 Auguste Lunang legraphi...@gmail.com

  Hi,
  i have some google wave. invits to share. tell me if u want ..
  thx

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-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=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: When I scroll a list I get the force close message

2009-11-01 Thread jax
Thanks, it worked




On Nov 1, 7:58 pm, Dexter#39;s Brain coomar@gmail.com wrote:
 I think.

 In your getView() method, don't cast it to ListView, remove that and I
 guess, I will work.

 Dexter.

 http://tech-droid.blogspot.com

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


[android-developers] Can two different activities that extend the same superclass have the same view ids?

2009-10-31 Thread jax
I have a superclass called Game.  I have two subclasses of this class
Game1 and Game2 .

Inside the superclass Game there is a Skip button.  This button is
in both Game1 and Game2 as they both use this button.  Inside Game I
have initialized it using

mSkipButton = (Button)findViewById(R.id.skip_button);

Both Game1 and Game2 have a View with an Id of @+id/skip_button

For some reason the Skip button works in Game1 but not Game2.  Can two
different Activities share the same ID?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 two different activities that extend the same superclass have the same view ids?

2009-10-31 Thread jax
my mistake

forgot to run super on the methods in the second game when overriding.



On Oct 31, 2:15 pm, jax jackma...@gmail.com wrote:
 I have a superclass called Game.  I have two subclasses of this class
 Game1 and Game2 .

 Inside the superclass Game there is a Skip button.  This button is
 in both Game1 and Game2 as they both use this button.  Inside Game I
 have initialized it using

 mSkipButton = (Button)findViewById(R.id.skip_button);

 Both Game1 and Game2 have a View with an Id of @+id/skip_button

 For some reason the Skip button works in Game1 but not Game2.  Can two
 different Activities share the same ID?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Locale and TTS problem

2009-10-31 Thread jax
I have set my emulator to use US English.

When I run Locale.getDefault()

There is no country code!
The language code is set to en_us

When I set a varaible audioLocale using

audioLocale= Locale.US

The country code is US
The language code is en

When I run

mTts.isLanguageAvailable(audioLocale) == TextToSpeech.LANG_AVAILABLE

I get

-2 == 0

Why is mTts reporting that the US language is not 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] How to disable touch event on listView

2009-10-29 Thread jax

I have a ListView with a setOnItemClickListener.  I am trying to
prevent the user from pressing an item repeatedly but can't seem to
get it to work.  I have tried the following.

mAvailableOptionsListView.setClickable(false);
mAvailableOptionsListView.setEnabled(false);

and then a little time later in a TimerTask enabling them again

mAvailableOptionsListView.setClickable(true);
mAvailableOptionsListView.setEnabled(true);

This does not seem to work
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] update a ListView with getView

2009-10-28 Thread jax

Hi

I am trying to update a ListView with the following:

TextView listItem= (TextView)mAvailableOptionsListView.getAdapter
().getView(1, null, null);

listItem.setText(test);


The problem is that it does not update in the
mAvailableOptionsListView ListView.  Why is that?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: update a ListView with getView

2009-10-28 Thread jax

ok fixed that, I used this:

mAvailableOptionsListView.getChildAt(correctPosition).setAnimation
(shake)

my next problem is that when I set this animation the view does not
seem to set the animation immediately...why is that?  Do I have to
invalidate anything or manually refresh the display somehow?

On Oct 28, 10:54 pm, jax jackma...@gmail.com wrote:
 Hi

 I am trying to update a ListView with the following:

 TextView listItem= (TextView)mAvailableOptionsListView.getAdapter
 ().getView(1, null, null);

 listItem.setText(test);

 The problem is that it does not update in the
 mAvailableOptionsListView ListView.  Why is that?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: update a ListView with getView

2009-10-28 Thread jax

ok, I used invalidateViews() and it seemed to work.  This will
invalidate all views.  Is it better to use a Rect in this case or does
it not really matter?

On Oct 28, 11:25 pm, jax jackma...@gmail.com wrote:
 ok fixed that, I used this:

 mAvailableOptionsListView.getChildAt(correctPosition).setAnimation
 (shake)

 my next problem is that when I set this animation the view does not
 seem to set the animation immediately...why is that?  Do I have to
 invalidate anything or manually refresh the display somehow?

 On Oct 28, 10:54 pm, jax jackma...@gmail.com wrote:

  Hi

  I am trying to update a ListView with the following:

  TextView listItem= (TextView)mAvailableOptionsListView.getAdapter
  ().getView(1, null, null);

  listItem.setText(test);

  The problem is that it does not update in the
  mAvailableOptionsListView ListView.  Why is that?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Instant Refresh on CursorAdapter attached to a ListView

2009-10-16 Thread jax

no that did not work

On Oct 15, 5:46 pm, odd.isometry polina-barkal...@yandex.ru wrote:
 Maybe, it will be useful to override methods  onPause()  onResume()
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Instant Refresh on CursorAdapter attached to a ListView

2009-10-16 Thread jax

I finally fixed this problem

I needed to run a requery() on the cursor

cursor.requery();
myAdapter.notifyDataSetChanged();



On Oct 15, 10:05 am, jax jackma...@gmail.com wrote:
 I have a CursorAdapter attached to a ListView, the ListView contains
 checkboxes for every row.

 When I check/uncheck a checkbox in a row it will update it to a 0 or 1
 in the database (This is working fine)

 I also have another checkbox in the same Activity that when pressed
 will disable all the checkboxes in the ListView [ setEnabled(false) ].

 The problem is that when I press this checkbox the ListView checkboxes
 return to their initial state when I started the activity.  It does
 not matter the number of checkboxes I changed during the activity.

 However, if I press the back button and then re-enter the activity all
 modifications are saved because the Cursor is refreshed.

 I am calling notifyDataSetChanged() at the end of the the methods that
 disables all the checkboxes.

 I also tried this for every checkbox in the ListView but it did not
 work (was unable to check a checkbox)

 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] Instant Refresh on CursorAdapter attached to a ListView

2009-10-14 Thread jax

I have a CursorAdapter attached to a ListView, the ListView contains
checkboxes for every row.

When I check/uncheck a checkbox in a row it will update it to a 0 or 1
in the database (This is working fine)

I also have another checkbox in the same Activity that when pressed
will disable all the checkboxes in the ListView [ setEnabled(false) ].

The problem is that when I press this checkbox the ListView checkboxes
return to their initial state when I started the activity.  It does
not matter the number of checkboxes I changed during the activity.

However, if I press the back button and then re-enter the activity all
modifications are saved because the Cursor is refreshed.

I am calling notifyDataSetChanged() at the end of the the methods that
disables all the checkboxes.

I also tried this for every checkbox in the ListView but it did not
work (was unable to check a checkbox)

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