[android-developers] Is Google Play In-App Billing mandatory?

2016-06-09 Thread Matthias Schlesinger
Hi, 

I'm developing an application that includes premium content that requires a 
subscription. Ideally, I want to handle the subscription process and 
payments myself. 
According to this 

 
article "Google has [...] given app developers the ability to handle 
payments themselves and keep all of the revenue". But the Play store policy 
on monetization  still 
states that all payments (except for physical products and digital content 
that can be consumed outside the app) must use Google Play In-App billing. 
So which of those statements is true? 

Thanks. 
Matt

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/393d865f-e291-48c6-b5c5-384216ab920f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Disclaimer in Android Developer Console for Google Play Market

2012-11-27 Thread Matthias Böhmer
Yes! Have you ever used this?

On Tue, Nov 27, 2012 at 4:31 PM, TreKing treking...@gmail.com wrote:
 On Tue, Nov 27, 2012 at 8:12 AM, phoku mboeh...@fh-muenster.de wrote:

 In the Android Developer Console one can provide a URL to a disclaimer,


 Disclaimer? Are you referring to the Privacy Policy (Link to Policy
 section)?

 -
 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



-- 
Matthias Böhmer
Innovative Retail Laboratory
DFKI GmbH, Campus D3_4, Stuhlsatzenhausweg 3, D-66123 Saarbrücken, Germany
http://www.innovative-retail.de
http://dfki.de/~mabo04
Tel.: +496818 5775 5018
Fax.: +496818 5775 5007
-
Deutsches Forschungszentrum für Künstliche Intelligenz GmbH
Firmensitz: Trippstadter Strasse 122, D-67663 Kaiserslautern

Geschaeftsführung:
Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender)
Dr. Walter Olthoff

Amtsgericht Kaiserslautern, HRB 2313
-

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


Re: [android-developers] Multiple IntentServices for one Intent

2012-05-17 Thread Matthias Böhmer
so, is there kind of a best practice so solve this?
On May 16, 2012 11:24 PM, Dianne Hackborn hack...@android.com wrote:

 Sorry you can't.  You should basically never call startService() or
 bindService() with an implicit intent; you will get essentially random
 behavior in the service that is found if there are multiple services that
 match the intent.

 On Wed, May 16, 2012 at 9:32 PM, phoku mboeh...@fh-muenster.de wrote:

 Hi! I want to have multiple IntentServices listening to the same action
 getting fired when I call context.startService(...). How can I do that?
 Currently only one out of some IntentServices receives the Intent.

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




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

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

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

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

[android-developers] Re: Android Library sources not found

2012-01-13 Thread Matthias
While Eclipse now finds the sources while debugging, I am still not able to 
click through to the source of any item referenced from my app project. 
Does that work for you? ^^

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

[android-developers] Re: TeamCity and monkeyrunner

2011-09-14 Thread Matthias Braun
After a colleague and I have investigated the problem for three days, we 
could not find the source of this problem.
But when we used another PC as the build agent, the issue was gone.
We still don't know what caused this NullPointerException.

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

2011-09-08 Thread Matthias Braun
 

Hi,

I have a monkeyrunner script that connects to an Android device and deploys 
an APK on it.

serial = '12345JKL'
device = MonkeyRunner.waitForConnection(deviceId=serial)
device.installPackage(path_to_apk)

This works flawlessly when I execute the script using the Windows command 
shell.

C:\dev\android\tools\monkeyrunner.bat C:\dev\my_script.py -psome_parameter

The problem is that I want to have my_script.py executed by a TeamCity 
(Enterprise 6.0.3) build configuration on the same PC: this fails. Please 
find the stack trace here: http://pastebin.com/CjWy95c3

First I thought that TC was messing with the parameters of the script. But 
the command from the TC build log

[00:55:12]: Starting: C:\dev\android\tools\monkeyrunner.bat 
C:\dev\my_script.py -psome_parameter
in directory: C:\some_dir

was the same as in the command shell and accordingly the script could 
connect to the device and worked fine when I copied the command into a 
command shell while C:\some_dir was my current directory.

I was not able to reproduce this error outside of TC.

I want to emphasize that this all happens on the same PC (Win 7 x64). The 
script works when executed from the command shell but fails (always when 
trying to connect to a device) when triggered by the TC build configuration.

Further testing has shown that the problem isn't limited to 
MonkeyRunner.waitForConnection() but also occurs when calling 
MonkeyRunner.sleep(5). Stacktrace http://pastebin.com/JsG1uxT1 

Can it be that monkeyrunner and TeamCity don't go along well with each 
other?

If anybody could point me in the right direction I would be very happy.

Best,

Matthias

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: adb serving a limited number of devices attached to PC via USB

2011-08-02 Thread Matthias Braun
I am also interested in the maximum number of devices adb can serve. Is 
there a maximum number at all?

Best regards,
Matthias

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Aw: Re: PackageManage: Couldn't copy package file to temp file.

2011-05-20 Thread Matthias
I see this happening with rooted G1s, was your phone rooted by any chance?

In any case, I can install packages via adb and Eclipse, but not using the 
'pm' command on the device.

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

Re: [android-developers] Country code from Location API

2011-05-19 Thread Matthias Böhmer
Hi, thanks! There are a lot of web services that provide country codes. But I 
would rather like to do it offline, directly on the device. Is there any 
possibility to get the country code from any API directly on the device?

Am 19.05.2011 um 12:41 schrieb gaurav gupta:

 Hi , i can provide u api for finding country name and city name using 
 longitute and latitute.
 in this api u can get country code too.
 its api is mainly for weather report but u can use it, here a tag 
 countryIN/country gives country code.
 i hope it will work for u
  
 http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=28.6484223,77.1265769
 
  
 countryIN/country
 
 /country_iso3166
 
 chk these tags of this api.it will work 4 u.
 u just change longitute and latitute in this url u will get the anycountry's 
 code;
 :)
 
 On Thu, May 19, 2011 at 3:00 PM, mboehmer mboeh...@fh-muenster.de wrote:
 Is it possible to get a country code for the user's current location from the 
 location API? Or from somewhere else?
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Re: Emulator crashing with System Tools rev 9

2011-02-11 Thread Matthias
just out of curiosity, are you on a Mac? I found the tools to be much less 
stable on OSX than on Linux (don't know about Windows), although that has 
gotten a little better (e.g. the adb server used to crash all the time on 
OSX, and while the crashes are not entirely gone, it has gotten a lot better 
with the last few SDK releases)

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

2011-02-11 Thread Matthias Stock
Hello,

this is Eclipse related (Helios). The basic question here is:
How would you include system independent java classes into a Android
Library project?

Context: I have a graphics engine which is loosely coupled with the
Android system (engine classes do not include Android packages, mostly
factory patterns). I'd like being able to write e.g. an editor for the
Windows JRE which includes this engine also.

This is my preferred projects setup:

#Project 'Engine'
- Java project
- does not have any system specific classes

#Project 'EngineAndroidLib'
- Android library project
- includes 'Engine' *Point of Failure*
- only Android specific classes
- keeps default assets

#Project 'EngineWindows'
- Java project
- includes JOGL
- includes 'Engine'
- only windows specific classes
- keeps default assets

#Project 'Game'
- Android project
- includes 'EngineAndroidLib' library

#Project 'Editor
- Java project
- uses swing
- includes 'EngineWindows'

My problem is that the Android library 'EngineAndroidLib' itself
includes the source files of the 'Engine' project. This leads to an
error within my 'Game' project (added library dependency in Properties-
Android):
The import [of 'Engine' packages] cannot be resolved.
Maybe 'Game' includes the lib without considering lib's includes.

Do you have a fix for that?
- or -
Do you have another idea on how to include (system independent) java
classes into an Android Library project?

Thanks for reading. I wasn't able to make it short... Hopefully, I
made it clear at least. Btw.: This is for a bachelor thesis, no
commercial stuff.

Best regards,
Matthias

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Emulator crashing with System Tools rev 9

2011-02-10 Thread Matthias
the rev9 emulator is also very unstable for me. Whenever I send a geo fix 
(from DDMS or telnet), the emulator crashes and reboots. It also randomly 
reboots when using it sometimes. I wonder if that's related to the same 
issue the Nexus S has. it's also slower than previous emulators.

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

2011-02-09 Thread Matthias
http://code.google.com/p/android/issues/detail?id=14616

On Feb 8, 6:42 pm, Matthias m.kaepp...@googlemail.com wrote:
 I'm pretty sure it's a bug. When running this directly in the test
 case, I get the same error:

         getInstrumentation().runOnMainSync(new Runnable() {

             @Override
             public void run() {
                 AlertDialog.Builder b = new
 AlertDialog.Builder(getInstrumentation()
                         .getTargetContext());
                 b.show();
             }
         });

 Time for another bug report I guess.

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

2011-02-08 Thread Matthias
Hi,

we're running into an issue here where in a unit test for an activity,
we test a dialog that's part of the activity. However, as soon as
control flow reaches the call to Dialog.show, the test case crashes
with an exception:

Test run failed: android.view.WindowManager$BadTokenException

the activity window seems to be valid, and clicking buttons and
everything works fine. Are dialog interactions generally not possible
in ActivityUnitTestCase? Why?

Thanks a lot,
-Matthias

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

2011-02-08 Thread Matthias
yes it's called on the UI thread. There's nothing special about the
invocation; in the test case I click the button (using
View.performClick) that brings up the dialog, but it crashes on the
show() method. Up to that point, everything checks out. It must be
something specific to how Dialogs are handled in ActivityUnitTestCase.

What I don't understand is: I realize that AUTC does not actually
launch the application, it pretty much just instantiates the Activity
directly and then calls its onCreate method. But it does inject a
Window object, and the Dialog seems to be referencing that, so what's
the difference to, say, showing a Toast (although I admit I didn't try
showing toasts in a unit test, maybe that crashes, too).

On Feb 8, 5:57 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 How do you call the showing of the dialog?
 Is it on the main UI thread (and not on the test-case thread)?

 On Feb 8, 11:47 am, Matthias m.kaepp...@googlemail.com wrote:

  Hi,

  we're running into an issue here where in a unit test for an activity,
  we test a dialog that's part of the activity. However, as soon as
  control flow reaches the call to Dialog.show, the test case crashes
  with an exception:

  Test run failed: android.view.WindowManager$BadTokenException

  the activity window seems to be valid, and clicking buttons and
  everything works fine. Are dialog interactions generally not possible
  in ActivityUnitTestCase? Why?

  Thanks a lot,
  -Matthias



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

2011-02-08 Thread Matthias
I'm pretty sure it's a bug. When running this directly in the test
case, I get the same error:

getInstrumentation().runOnMainSync(new Runnable() {

@Override
public void run() {
AlertDialog.Builder b = new
AlertDialog.Builder(getInstrumentation()
.getTargetContext());
b.show();
}
});

Time for another bug report I guess.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: InstrumentationTestCase.sendKeys() fails on headless emulators

2010-07-12 Thread Matthias
Anyone?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] InstrumentationTestCase.sendKeys() fails on headless emulators

2010-07-10 Thread Matthias
Hi,

before reporting this as a bug, I thought I'd ask here (I also posted
on stackoverflow with no reply so far, but the Google developers don't
seem to be actively posting there anyway --
http://stackoverflow.com/questions/3214531/how-to-send-key-events-to-a-headless-emulator-in-an-instrumentation-test).

So the problem is:
We run a build server in our company on a headless Linux, so we have
to start the emulator with the -no-window flag when running the
instrumentation tests. When this flag is set, however, the
InstrumentationTestCase.sendKeys() method fails -- not with an
exception, but there is an obscure message in the device log:

Permission denied: injecting key event from pid 646 uid 10026 to
window Window{43d55100 paused=false} owned by uid 1000

this works fine on a normal emulator which does have a window.

We already tried fumbling with the INJECT_EVENTS permission, process
affinity and sharedUserId, but nothing works.

This basically makes our test suite useless on a build server, which
are typically headless. Is this a bug or are we missing something?

Thanks,
Matthias

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Emulator 2.1 2.2 reverse geocoding not available

2010-07-08 Thread Matthias
any progress on this anyone? this is really annoying, I basically
can't test our app on 2.2 since we heavily rely on the Geocoder.

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

2010-04-21 Thread Matthias
Hi,
I am currently working with a videoview to show live broadcasts. For
this I want to adapt the error messages which are shown by the
videoview component, when an error occures (connection error, video
error etc..).

Is it ist possible to register another error handler to a videoview?

best regards Matthias

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] onConfigurationChanged whielk splash scrren i shown

2010-04-14 Thread Matthias
Hi,
I implemented a splash screen activity in the following way.

[...]

public class Splash extends Activity {
  private final int SPLASH_DISPLAY_LENGHT = 3000;

  private Handler handler = new Handler();

 @Override
public void onCreate(Bundle bundle){
super.onCreate(bundle);
setContentView(R.layout.splash);

handler.postDelayed(new Runnable() {
public void run() {
  Log.d(this.getClass().getName(), handler.postDelayed());

  /* Create an intent that will start the main activity. */
  Intent mainIntent = new Intent(Splash.this,
MyListView.class);
  MyListView.this.startActivity(mainIntent);
  MyListView.this.finish();
}
  }, SPLASH_DISPLAY_LENGHT);
  }

  @Override
  public void onStart() {
super.onStart();
  }

  @Override
  public void onConfigurationChanged(Configuration newConfig) {
Log.d(this.getClass().getName(), onConfigurationChanged
newConfig: + newConfig.toString());
super.onConfigurationChanged(newConfig);
  }

[...]

Everythings works fine unless.. a configuration change event handeled
while the splash screen is shown. In this case everytime the
orientation change the handler add a new Runabel Object to queue.
And the MyListActivity will be started X-times.

i am thankfull for every advice.
best regards matthias






-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: onConfigurationChanged whielk splash scrren i shown

2010-04-14 Thread Matthias Hog
I solved.. ;)
I forgot to set the android:configChanges=orientation
in the AndroidManifest.xml.

Never the less, thanks for reading!

Best regarts
Matthias

2010/4/14 Matthias matthias@googlemail.com

 Hi,
 I implemented a splash screen activity in the following way.

 [...]

 public class Splash extends Activity {
  private final int SPLASH_DISPLAY_LENGHT = 3000;

  private Handler handler = new Handler();

  @Override
 public void onCreate(Bundle bundle){
super.onCreate(bundle);
setContentView(R.layout.splash);

handler.postDelayed(new Runnable() {
public void run() {
  Log.d(this.getClass().getName(), handler.postDelayed());

  /* Create an intent that will start the main activity. */
  Intent mainIntent = new Intent(Splash.this,
 MyListView.class);
  MyListView.this.startActivity(mainIntent);
  MyListView.this.finish();
}
  }, SPLASH_DISPLAY_LENGHT);
  }

  @Override
  public void onStart() {
super.onStart();
  }

  @Override
  public void onConfigurationChanged(Configuration newConfig) {
Log.d(this.getClass().getName(), onConfigurationChanged
 newConfig: + newConfig.toString());
super.onConfigurationChanged(newConfig);
  }

 [...]

 Everythings works fine unless.. a configuration change event handeled
 while the splash screen is shown. In this case everytime the
 orientation change the handler add a new Runabel Object to queue.
 And the MyListActivity will be started X-times.

 i am thankfull for every advice.
 best regards matthias









-- 
Matthias Hog

Mobil: 0174.6619792
Email: matthias@gmail.com
Skype: matthias.hog

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

2010-04-04 Thread Matthias
I was thinking about using Guice myself before, but hesitated fearing
to make the overall sluggishness of the platform even worse.

How much of an overhead are talking about in terms of memory footprint
and size of bundled libraries? Any noticeable impacts on speed or
battery life? How often does Guice kick in in the background?

I'm currently stepping back from overly abstract programming models on
Android because of exactly these issues.

On Mar 29, 8:53 pm, Michael Burton m...@niskala.org wrote:
 Hello Android developers,

 I'd like to announce the final release of RoboGuice 1.0!

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

 RoboGuice is a framework that brings the simplicity and ease of Dependency 
 Injection to Android, using Google's own Guice library.  If you've ever used 
 Spring (the #1 enterprise framework on Java, now more popular than J2EE 
 itself) or Guice, you already know how convenient this style of programming 
 can be.

 To give you an idea, take a look at this simple example of a typical Android 
 activity:

 class AndroidWay extends Activity {
     TextView name;
     ImageView thumbnail;
     LocationManager loc;
     Drawable icon;
     String myName;

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

         name      = (TextView) findViewById(R.id.name);
         thumbnail = (ImageView) findViewById(R.id.thumbnail);
         loc       = (LocationManager) 
 getSystemService(Activity.LOCATION_SERVICE);
         icon      = getResources().getDrawable(R.drawable.icon);
         myName    = getString(R.string.app_name);
         name.setText( Hello,  + myName );
     }

 }

 This example is 18 lines of code.  If you're trying to read through 
 onCreate(), you have to skip over 5 lines of boilerplate initialization to 
 find the only one that really matters: name.setText().  And complex 
 activities can end up with a lot more of this sort of initialization code.

 Compare this to the same app, written using RoboGuice:

 class RoboWay extends GuiceActivity {
     @InjectView(R.id.name)             TextView name;
     @InjectView(R.id.thumbnail)        ImageView thumbnail;
     @InjectResource(R.drawable.icon)   Drawable icon;
     @InjectResource(R.string.app_name) String myName;
     @Inject                            LocationManager loc;

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

         name.setText( Hello,  + myName );
     }

 }

 In this example, onCreate() is much easier to take in at a glance.  All the 
 platform boilerplate is stripped away and you're left with just your own 
 app's business logic.  Do you need a SystemService?  Inject one.  Do you need 
 a View or Resource?  Inject those, too, and RoboGuice will take care of the 
 details.  

 RoboGuice's goal is to make your code be about your app, rather than be about 
 all the initialization and lifecycle code you typically have to maintain in 
 Android.

 RoboGuice has been in development since August 2009, and 0.9 entered release 
 candidacy in December and has been stabilizing ever since. After three months 
 and a few finishing touches, we now believe it's ready to expose to a larger 
 audience.

 We know that RoboGuice won't be for everybody.  Although RoboGuice never 
 prevents you from doing things the Android way, some people will still prefer 
 seeing everything spelled out explicitly in their code.  And other people who 
 write extremely high performance applications such as games may not want to 
 incur the small overhead imposed by yet another framework.  But for people 
 who want to build simple and straightforward code that's easily testable and 
 easy to read, I encourage you to give RoboGuice a try.

 We hope you like it.  Stop by our discussion forums if you'd like to have any 
 help getting started.

 Cheers,
 Mike

 PS. We're beginning work on RoboGuice 1.1 now, which will include more 
 injectible objects, better unit testing support, and hopefully some general 
 usability improvements as well.  I'd love to hear your thoughts on other 
 things you'd like to see in the next release.

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

2009-11-25 Thread Matthias
On Nov 24, 5:28 pm, Romain Guy romain...@google.com wrote:
  This seems like a major framework fail... 16Bit graphics? It's 2009,
  I'd sort of expect better image rendering than that of Window 3.11.

 Except that phone displays do not display more than 16 bits of colors.
 The displays are natively 565.

You mean /Android/ phones? The iPhone supports 6 Bits per color,
that's 18 Bits you have to render e.g. a gradient. That's 4 times the
color richness of Android.

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


[android-developers] Re: PNG optimization on packaging process

2009-11-25 Thread Matthias
On Nov 24, 5:28 pm, Romain Guy romain...@google.com wrote:
  This seems like a major framework fail... 16Bit graphics? It's 2009,
  I'd sort of expect better image rendering than that of Window 3.11.

 Except that phone displays do not display more than 16 bits of colors.
 The displays are natively 565.

You mean /Android/ phones? AFAIK the iPhone uses 6 Bits per color,
that's 18 Bits you got for image rendering. While it's also not True
Color, it's still 4 times the color richness of Android.

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


[android-developers] Re: no title bar

2009-11-25 Thread Matthias
call requestWindowFeature(Window.FEATURE_NO_TITLE) before calling
setContentView() OR set it as part of a style definition
(android:windowNoTitle=true).

On Nov 25, 5:16 pm, Jags jag...@gmail.com wrote:
 I dont want title bar in my application, how to remove that ? in my
 activity ?

 Jagat

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

2009-11-24 Thread Matthias
how did you do the pre-dithering? our designer created a host of
images with dithering enabled, but it didn't have any effect. The
artifacts would only disappear when setting setDither(true) on EVERY
SINGLE drawable having a gradient.

This seems like a major framework fail... 16Bit graphics? It's 2009,
I'd sort of expect better image rendering than that of Window 3.11.

On Oct 30, 3:55 am, Ian iangm...@gmail.com wrote:
 The pre-dithering of the images worked fine (I've had to download a
 dithering plugin to photoshop).

 On Oct 29, 3:52 pm, Ian Guedes Maia iangm...@gmail.com wrote:

  Thanks. I've checked it and the optimization do not affect the colors
  the way that is shown on the emulator/device. I've tried to define a
  proxy XML for the PNG and set its dither to true, but it didn't
  worked. I'll try to change the png image settings on photoshop or
  something.

  I've found some previous discussion on the subject, but nothing
  conclusive i 
  guess:http://osdir.com/ml/AndroidBeginners/2009-06/msg00017.html(I'lltry 
  that)http://groups.google.com/group/android-developers/browse_thread/threa..

  2009/10/29 webmonkey webmonke...@gmail.com:

   To do a true comparison of what the PNG is like after 'optimization'
   take it out of the final APK, it is just a zip archive.

   The banding artifacts you see are because the device and the emulator
   are displaying in 16-bit 565 pixel format, they can't display all the
   colors. Have you tried painting the image with Paint.setDither(true)
   turned on:

  http://developer.android.com/reference/android/graphics/Paint.html#se...

   On Oct 28, 9:20 pm, Ian iangm...@gmail.com wrote:
   Hi all,

   I've noticed that the PNGs of my application with some gradients
   effects looked terribly bad at the device (a Samsung Galaxy) and at
   the emulator, and I've found the following note at the documentation
   (http://developer.android.com/guide/topics/graphics/2d-
   graphics.html):

   Note: Image resources placed in res/drawable/ may be automatically
   optimized with lossless image compression by the aapt tool. For
   example, a true-color PNG that does not require more than 256 colors
   may be converted to an 8-bit PNG with a color palette. This will
   result in an image of equal quality but which requires less memory. So
   be aware that the image binaries placed in this directory can change
   during the build. If you plan on reading an image as a bit stream in
   order to convert it to a bitmap, put your images in the res/raw/
   folder instead, where they will not be optimized.

   I've tried the res/raw suggestion, but it didn't worked.

   I've tried to use the image as JPEG as a workaround, but I couldn't
   use 9-patch.

   I've uploaded a comparison between the original png and the
   optimized png that is shown on the emulator or 
   devices:http://www.weka.com.br/temp/img/comparison.jpg

   One workaround would be put the images at /assets/ and manually load
   and set the image on the ImageViews, but it requires a lot of code
   changes.

   Any ideas? Is there any way to disable this optimization?

   Thanks in advance,
   Ian



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Droid-Fu: A shared library for Android application developers

2009-11-16 Thread Matthias
Hey folks,

I have been working on a utility library for Android for some while
now, and I believe it has now enough cool things to offer to make it
public.

An introduction on my blog:
http://brainflush.wordpress.com/2009/11/16/introducing-droid-fu-for-android-betteractivity-betterservice-and-betterasynctask/

Source code is here:
http://github.com/kaeppler/droid-fu

There's more in the lib of course, most of which I will cover in
upcoming blog posts.

Contributions and feedback welcome!

Cheers,
Matthias

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 TextView supposed to be able to scroll its contents?

2009-11-10 Thread Matthias
It was my understanding that even though TextView is not a ScrollView,
it has scrolling functionality built-in.

However, I'm not able to scroll the contents of a TextView (that's on
1.6). I've reduced my code to the most trivial example:

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
  android:layout_height=fill_parent
  android:layout_width=fill_parent
  android:orientation=vertical

  TextView
android:layout_width=fill_parent
android:layout_height=fill_parent
android:inputType=text|textMultiLine
android:singleLine=false
/

/LinearLayout

I then defined a really long string for testing, which I set on this
text view using setText().

The text is too long for the TextView, but there is no way to scroll
it. So do I need to wrap it in a ScrollView after all?

Cheers,
Matthias

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Multipart file uploads using Apache Mime4J still not working

2009-10-23 Thread Matthias

Hi,

I raised this ticket a long while ago: 
http://code.google.com/p/android/issues/detail?id=2357

I am still running into this problem. In fact, since I upgraded to the
latest http-mime and mim4j JARs, it has become worse. I always get
this exception when trying to upload a file received using
ContentResolver.openInputStream():

IOException:
at java.io.FileInputStream.openCheck(FileInputStream.java:389)

My code:

photoData = context.getContentResolver().openInputStream(
photoUri);

MultipartEntity payload = new MultipartEntity
(HttpMultipartMode.STRICT);
payload.addPart(uploaded_data, new PhotoStreamBody
(photoData,
photoSize));

HttpPost request = new HttpPost(url);
request.setEntity(payload);
request.setHeader(HTTP_CONTENT_TYPE_HEADER,
payload.getContentType().getValue());

response = httpClient.execute(request);

PhotoStreamBody inherits from InputStreamBody. The only thing it does
is overwriting the getContentLength() method, because Android has
another bug which reports wrong content sizes...

Does anyone know what is causing this?

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

2009-10-23 Thread Matthias

Hi,

I am trying to animate a ViewStub -- without success. My code:

  stub.setVisibility(View.VISIBLE); // inflate the stub

  Animation anim = AnimationUtils.makeInAnimation(this, true);
  stub.startAnimation(anim);

No animation is played, the ViewStub simply appears. How come?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Managing background uploads

2009-10-22 Thread Matthias

Hey James,

good to know, thanks!

-Matthias

On Oct 21, 9:30 pm, James Yum j...@google.com wrote:
 Hi Matthias,
 Thank you for the good question (shows you're thinking).

 Check the Application Fundamentals dev 
 guidehttp://developer.android.com/guide/topics/fundamentals.html

 Near the bottom:

 Because a process running a service is ranked higher than one with
 background activities, an activity that initiates a long-running operation
 might do well to start a service for that operation, rather than simply
 spawn a thread — particularly if the operation will likely outlast the
 activity. Examples of this are playing music in the background and uploading
 a picture taken by the camera to a web site. Using a service guarantees that
 the operation will have at least service process priority, regardless of
 what happens to the activity.

 Also from the Service class doc:

 Note this means that most of the time your service is running, it may be
 killed by the system if it is under heavy memory pressure. If this happens,
 the system will later try to restart the service. An important consequence
 of this is that if you implement
 onStart()http://developer.android.com/reference/android/app/Service.html#onSta...,
 int) to schedule work to be done asynchronously or in another thread, then
 you may want to write information about that work into persistent storage
 during the onStart() call so that it does not get lost if the service later
 gets killed.

 As far as the tasks, you can probably devise a simple (and try to keep it
 simple) way to track the different tasks. I'd probably add some sort of
 timeout check to clear out threads that never terminated for whatever
 reason.

 Cheers,
 James

 On Wed, Oct 21, 2009 at 8:27 AM, Matthias m.kaepp...@googlemail.com wrote:

  Hi,

  in our app we're doing background photo uploads. The current
  implementation works using a combination of a Service and an
  AsyncTask. The former will trigger the latter, which will do the
  actual network I/O.

  My question is: since the user can trigger many uploads in parallel,
  is this the correct implementation pattern? The problem is that I can
  never call Service.stopSelf() from an upload task when it finishes,
  because those tasks don't know anything about each other or the
  service that triggered them (because of the very nature of AsyncTask).

  Do I even need a Service here at all? I always thought services were
  meant for long running background tasks, but their documentation
  clearly states that one must execute blocking operations in a separate
  thread. What's the purpose of Services then? You could just fork an
  AsyncTask from an Activity, it would make no difference at all.

  What would you suggest doing in my case?

  Cheers,
  Matthias


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

2009-10-21 Thread Matthias

Hi,

in our app we're doing background photo uploads. The current
implementation works using a combination of a Service and an
AsyncTask. The former will trigger the latter, which will do the
actual network I/O.

My question is: since the user can trigger many uploads in parallel,
is this the correct implementation pattern? The problem is that I can
never call Service.stopSelf() from an upload task when it finishes,
because those tasks don't know anything about each other or the
service that triggered them (because of the very nature of AsyncTask).

Do I even need a Service here at all? I always thought services were
meant for long running background tasks, but their documentation
clearly states that one must execute blocking operations in a separate
thread. What's the purpose of Services then? You could just fork an
AsyncTask from an Activity, it would make no difference at all.

What would you suggest doing in my case?

Cheers,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Dialog cannot fill whole screen

2009-09-04 Thread matthias

Hi Dianne,

this is what I did, and it didn't work:

  WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
  lp.width = WindowManager.LayoutParams.FILL_PARENT;
  lp.height = WindowManager.LayoutParams.FILL_PARENT;
  getWindow().setAttributes(lp);

that has no effect whatsoever (I called it in onCreate(), tried
calling it before and after the super.onCreate(), but no luck).

What I do now is implement a custom LinearLayout for the activity
where I override onMeasure() and set the width and height to the
screen width and height. But that's incorrect of course, because that
size is larger than the actual canvas (it doesn't account for menu and
toolbars).

Can you help me out here? Why is there no simple way to fix a dialog's
size?

Cheers,
Matthias

On Sep 1, 6:55 pm, Dianne Hackborn hack...@android.com wrote:
 The dialog theme, as part of its nature, sets the top-level window layout to
 be WRAP_CONTENT.  You could try manually setting the Window layout width and
 height to FILL_PARENT, though this is going to make for a kind-of weird
 dialog (especially if one day you find yourself running on a large
 screen...).



 On Tue, Sep 1, 2009 at 7:18 AM, matthias m.kaepp...@googlemail.com wrote:

  Hi, I am also trying to find a solution to this...

  On Jul 31, 4:41 pm, nEx.Software email.nex.softw...@gmail.com
  wrote:
   Just out of curiosity, why are you using a dialog if you want it to
   fill the screen?

  simply because there are occasions where you need to replace content
  in the dialog dynamically and you don't want the dialog to resize but
  remain at full width and height. For instance, I need to display
  images of different width and height in the dialog, and I don't want
  the dialog to change size with every image the user looks at.

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

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to make a RotateDrawable actually rotate?

2009-09-04 Thread matthias

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



[android-developers] Re: How to reference (icon) drawables delivered with Android in XML

2009-09-04 Thread matthias

android:icon=@android:drawable/iconfile

Cheers,
Matthias

On Sep 4, 11:10 am, f_heft delphik...@gmail.com wrote:
 Hello,

 I'm defining my options menu in an XML file and I want to add an icon
 to the menu items.
 Normally, this would be sth like
 --
  (...)
   android:icon=@drawable/iconfile /
 --

 But I want to use the drawables that are already stored in the
 android.jar (as listed 
 here:http://www.screaming-penguin.com/info/android_drawables/android_drawa...
 ).
 As the website says, I can access them via
 --
 myMenuItem.setIcon(android.R.drawable.ic_menu_save);
 --
 But how can I do that in XML? I tried several things but none worked
 for me...

 Best regards,
 F Heft
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] What's the meaning of obtainStyledAttributes() and a custom attrs.xml?

2009-09-01 Thread Matthias

I've seen this in the Gallery API Demo shipping with the SDK.

There is an attrs.xml holding declare-stylable tags, and the gallery
adapter then does this:

in attrs.xml:

declare-styleable name=Gallery1
attr name=android:galleryItemBackground /
/declare-styleable

in Gallery1.java:

// See res/values/attrs.xml for the declare-styleable
that defines
// Gallery1.
TypedArray a = obtainStyledAttributes
(R.styleable.Gallery1);
mGalleryItemBackground = a.getResourceId(
 
R.styleable.Gallery1_android_galleryItemBackground, 0);
a.recycle();

...

// The preferred Gallery item background
i.setBackgroundResource(mGalleryItemBackground);

I couldn't find any point in the code where the background resource is
set to an actual value. There is a gallery_background_1 drawable
defined, but it's nowhere used (at least Eclipse search didn't find
any references to it).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Resizing dialog window does not work

2009-09-01 Thread Matthias

In one of my activities, I use the Theme.Dialog style, and I can't get
the window to launch at full size.

What I do is this:

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

WindowManager.LayoutParams lp = new WindowManager.LayoutParams
();
lp.width = WindowManager.LayoutParams.FILL_PARENT;
lp.height = WindowManager.LayoutParams.FILL_PARENT;
getWindow().setAttributes(lp);

...
}

why does that not work? I also tried setting the size in pixels, but
that has no effect whatsoever.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Resizing dialog window does not work

2009-09-01 Thread matthias

additional note:

I even added a LinearLayout with FILL_PARENT for width and height to
the activity view root, but still, the activity window is not resizing.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Customing the lookfeel of DatePicker and TimePicker widgets

2009-09-01 Thread matthias

Just out of curiosity, why are you hijacking this thread?

On Sep 1, 1:25 pm, Armond Avanes armond...@yahoo.com wrote:
 Hi Guys,

 I'm seeking a way to customize the lookfeel of DatePicker and TimePicker.
 But I couldn't find any theme attribute to be related to these two
 widgets... Any help is greatly appreciated!

 Cheersss,
 Armond
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 make a RotateDrawable actually rotate?

2009-09-01 Thread Matthias

Hi,

I've been struggling to find out how Android's animation framework
works, as it's basically undocumented. What I want to do is create a
custom rotating spinner graphic (similar to an ajax loader).

Now, I looked at how the framework uses RotateDrawable, and basically
copied the XML used to define such a drawable.

But, when I set this drawable as an image resource or background, it
remains static rather that performing the rotation. So how to I
trigger the rotation? There is a class called RotateAnimation, but it
asks the same things off me (e.g. rotation degrees, pivot) that I
already defined in the RotateDrawable... that can't be right I guess?

So how do I trigger the rotation of a RotateDrawable?

Thanks in advance,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Dialog cannot fill whole screen

2009-09-01 Thread matthias

Hi, I am also trying to find a solution to this...

On Jul 31, 4:41 pm, nEx.Software email.nex.softw...@gmail.com
wrote:
 Just out of curiosity, why are you using a dialog if you want it to
 fill the screen?

simply because there are occasions where you need to replace content
in the dialog dynamically and you don't want the dialog to resize but
remain at full width and height. For instance, I need to display
images of different width and height in the dialog, and I don't want
the dialog to change size with every image the user looks at.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] java.net.HttpURLConnection throws Received authentication challenge is null

2009-08-31 Thread Matthias

I am using HttpURLConnection to send a GET request to a server. Upon
reading the response code, the Android implementation of
HttpURLConnection.doRequestInternal() throws an exception:

java.io.IOException: Received authentication challenge is null

I don't even get what the error is trying to tell me. I write an OAuth
param string to the Authorization header, but this works fine on other
occasions. There is nothing peculiar about my request apart from that.

Any idea what this means, what is causing this and how to get around
it? This works fine with Sun's Java implementation, so I guess it's a
problem with Apache Harmony?

Thanks!
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: java.net.HttpURLConnection throws Received authentication challenge is null

2009-08-31 Thread matthias

Hi Mark,

you were right: it was a 401 causing this. The odd thing being, I got
this exception *before* I was actually able to check for a 401 (it was
thrown in getResponseCode()). But now knowing this error represents a
401, I was able to fix it in my code (I was not sending the OAuth
verifier code which was required at this point).

Thanks!

On Aug 31, 3:33 pm, Mark Murphy mmur...@commonsware.com wrote:
  I am using HttpURLConnection to send a GET request to a server. Upon
  reading the response code, the Android implementation of
  HttpURLConnection.doRequestInternal() throws an exception:

  java.io.IOException: Received authentication challenge is null

  I don't even get what the error is trying to tell me.

 Off the cuff, it would seem as though you're getting a 401 Unauthorized
 error, due to a malformed Authorization header.

  This works fine with Sun's Java implementation, so I guess it's a
  problem with Apache Harmony?

 That's a distinct possibility.

 --
 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: TextView always loses focus after orientation change

2009-06-12 Thread matthias

anyone?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] TextView always loses focus after orientation change

2009-06-11 Thread Matthias

Hi,

when changing screen orientation while running an Activity that has
both a normal layout and a layout-land file defined (both of which
contain a TextView), then that view loses its focus after being
restored and a warning is issued on the log:

Previously focused view reported id X during save, but can't be found
during restore.

Is this a bug? I looked at the mID field of that view, and it's
identical for both the portrait and the landscape layout.

Thanks,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 1.1 virtual devices don't show up as run targets

2009-06-10 Thread Matthias

Hi,

even when setting minSdkVersion to 2, any Android 1.1 virtual device
does not appear in the list of run targets when launching the
emulator.

How come?

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



[android-developers] Re: Android 1.1 virtual devices don't show up as run targets

2009-06-10 Thread matthias

Hi,

On Jun 10, 5:12 pm, arnouf arnaud.far...@gmail.com wrote:
 Add a new AVD, when you're launching the Run configuration, on Target
 click on AVD Manager button. You can create a new AVD file
 automatically.

well, that's what I did to create the 1.1 AVDs. (also created one
using the command line tools, no difference.)

 If it's not visible, try to stop and restart your Eclipse tool.

I probably restarted Eclipse 20 times since I created them. Didn't
help :-)

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



[android-developers] Re: Android 1.1 virtual devices don't show up as run targets

2009-06-10 Thread matthias

I just received a reply via email; the answer is:

It's not sufficient to set minSdkVersion to 2, one must also go to
project -- settings -- build target and select 1.1 there. That
doesn't really help though, because now the resource compiler breaks
on any imeOptions attributes, even though those are supposed to be
simply ignore by the 1.1 runtime...

In other words, to test your app on different Android versions, you
must set up two different code bases, even though it's not necessary
(because an APK built using 1.5 and having minSdkVersion 2 would also
run on 1.1, unless of course you use 1.5 specific APIs). Great.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 state of a stateful drawable?

2009-06-08 Thread matthias

anyone?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: IME options behavior is inconsistent across different devices

2009-06-05 Thread matthias

I raised a bug report:
http://code.google.com/p/android/issues/detail?id=2882
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 change the state of a stateful drawable?

2009-06-05 Thread Matthias

Hi,

I am trying to use that small favorite icon (the Android star icon,
android:drawable/btn_star), which according to its XML definition has
several distinct states in which it looks different (e.g. it's a
golden filled star when checked, and a grey unfilled star when
unchecked).

Whenever the ImageView rendering that drawable receives a click event,
I want to switch those two states. Here is what I do:

starIcon.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Drawable star = starIcon.getDrawable();
int[] currentState = star.getState();
System.out.println(StateSet.dump(currentState));
if (StateSet.stateSetMatches(currentState,
android.R.attr.state_checked)) {
System.out.println(is checked);
star.setState(new int[]
{ android.R.attr.state_enabled });
} else {
System.out.println(not checked);
star.setState(new int[]
{ android.R.attr.state_checked });
}

star.invalidateSelf();
}
});

however, the onclick handler always enters the else clause and the
dump always prints W P E, which means that the call to setState
(checked) has no effect... I guess?

What am I missing?

Thanks,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] IME options behavior is inconsistent across different devices

2009-06-04 Thread Matthias

Hi,

I noticed that the imeOptions attribute on TextViews behaves
inconsistently across different devices. For instance, setting
imeOptions to normal has the following effects:

1) On the emulator and G1s running 1.5:
The OSK will have a Done key and clicking it will simply close the
OSK with no further action taken (this is exactly what I need)

2) On my HTC Magic (G2), also running 1.5 (of course):
The OSK will have an enter key (showing the enter symbol instead of
Done) and when clicking it, the OSK will close and bring up the
context menu of the text view... I mean, seriously. That is the last
thing any user or developer would expect it to do.

There seems to be no way to simply close the OSK after entering some
text on the G2, *except* when specifying flagNoEnterAction in
imeOptions, which on the G2 does what normal does on the G1, but on
the G1, this will lead to the OSK to not respond at all to the enter
key (user has to hit back to close the OSK).

This is a complete mess, is there any way to have the OSK behave in a
sane manner without resorting to hacks (like checking for device
models and setting imeOptions programmatically)? Didn't Google say
they cared about backwards compatibility before releasing Cupcake? I
have nothing but trouble getting my app to look and behave identical
on different Android models.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: IME options behavior is inconsistent across different devices

2009-06-04 Thread matthias

This is even more messed up than I thought:

It seems as if on the HTC Magic, the constant values backing the
different IME options are shifted to the right by one (so to speak).
That is, if you look at the different options as described in the API
docs, then for example setting actionSearch on the text view will do
exactly that on a G1, but will result in actionNext on the G2.
Similarly, setting actionSearch will result in actionSend on the Magic
being activated... weirdness!

Is this a known bug?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: What's the deal with onRetainNonConfigurationInstance()?

2009-06-04 Thread matthias

Hi Mark,

On Jun 4, 5:57 pm, Mark Murphy mmur...@commonsware.com wrote:
 onSaveInstanceState() is called in cases other than screen rotations
 (e.g., activity is being closed up due to low memory), and in those other
 cases, onRetainNonConfigurationInstance() is not used at all.

yes, but wouldn't it be more clever to have
onRetainLastNonConfigurationInstance() be called *before*
onSaveInstanceState(), because then one could determine whether it's
necessary to have the latter actually do something. For those cases I
mentioned (which I suppose are the more typical use cases), this would
be very helpful, because you could do something like this:

protected Object onRetainLastNonConfigurationInstance() {
return expensiveObject;
}

protected void onSaveInstanceState(Bundle out) {
if (getLastNonConfigurationInstance() == null) {
 // serialize expensiveObject to bundle
}
}

protected void onCreate(Bundle in) {
Object expensiveObject = getLastNonConfigurationInstance();
if (expensiveObject == null) {
// deserialize expensiveObject
}
}

using that approach, one could benefit from that method in, what,
99.9% of all situations in which onSaveInstanceState() is called? (by
which I mean orientation changes, not low memory scenarios).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: IME options behavior is inconsistent across different devices

2009-06-04 Thread matthias

anyone?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Application.onPause()? Is there a hook like this?

2009-05-29 Thread matthias

 ...
 It's a static reference, ie global to the process. So as activities
 are started the ref points to the new activity.

 That said, I agree the right thing to do here isn't obvious. But it's
 also not obvious to me why you think it's bad to unregister the
 listener in your apps onDestroy. I am skeptical battery life would be
 that badly harmed?

If GPS keeps running for no reason when the user is on the home
screen, users will complain, and rightfully so. GPS is probably the
largest battery sucker on Android.

Anyway, I guess I'll just stick with my hack, it works well (although
I hate that I have to call it in EVERY SINGLE activity the user could
potentially exit the app from). Frankly, I already thought about
putting together a library with support classes that take care of all
those things. I more and more find myself writing boilerplate code for
things that really should already be handled by Android... best
example is long running operations support (threads spawning from a
context), which is very difficult to get right on Android with all the
lifecycle states your app can be in, but that's a different story.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Application.onPause()? Is there a hook like this?

2009-05-28 Thread Matthias

Hi,

I want to unregister my location listeners whenever the app is hidden
by another application. I cannot use the onPause() hook in my main
activity, because that hook will also be called when an activity of my
app is hidden by another activity of my own app (in which case I do
not want to disable location listeners -- going through a disable/
enable cycle for two location listeners is pretty expensive).

In other words, is there a thing like App.onPause(), which gets
triggered when the whole app is paused (i.e., no activities of the
same app are visible anymore), e.g. when bringing up the home
application or when a call comes in?

Thanks,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Application.onPause()? Is there a hook like this?

2009-05-28 Thread matthias

Hm, so I just peeked at the source code of the Google Maps app on
Android, because they seem to get it right: if you have GPS enabled,
then it will stay on if the main Maps activity is hidden by another
activity of the same app, e.g. the Maps history screen, but it will
turn off when pausing the app via the Home button.

NMapActivity.onPause() looks like this:

protected void onPause()
{
super.onPause();
if(sActivityReference.get() == this)
{
   ... // stop location services
} else
{
android.util.Log.d(MapActivity, (new StringBuilder
()).append(onPause leaving the lights on for ).append
(sActivityReference.get()).toString());
}
}

but what is sActivityReference? I suppose it's some static field with
package level visibility, but it's not declared in that activity...
seems to be some Android internal magic, so I cannot use it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Application.onPause()? Is there a hook like this?

2009-05-28 Thread matthias

okay, so sActivityReference is a java.lang.ref.WeakReference, so
apparently this is related to something else (memory management stuff
I guess?).

Any other 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] Re: Application.onPause()? Is there a hook like this?

2009-05-28 Thread matthias

I found a workaround, but it's a hack, so I'm still open for better
ideas. I found this to do exactly what I need:

in the main activity of my app:

@Override
protected void onPause() {
super.onPause();

ActivityManager am = (ActivityManager) getSystemService
(ACTIVITY_SERVICE);
ListRunningTaskInfo taskInfo = am.getRunningTasks(1);
if (!taskInfo.isEmpty()) {
ComponentName topActivity = taskInfo.get(0).topActivity;
if (!topActivity.getPackageName().equals(getPackageName
())) {
// disable listeners ...
}
}
}

what this does is find out what the most recently triggered activity
is when the current activity is paused (i.e., it yields the name of
the activity that caused the pause, e.g. the home app), and checks
whether it's an activity of the same package or not (in the latter
case, I unregister the listeners to save battery life).

An app.onPause() hook or a simple isApplicationVisible() would be a
lot nicer of course...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Application.onPause()? Is there a hook like this?

2009-05-28 Thread matthias

Well, I need to disable the listeners when the app goes into the
background, not only when it terminates.

I also tested this use of WeakReference, simply to see how it behaves,
and it didn't work for me at all. Regardless of whether the app was
paused to display another application or to display another activity
of the same app, the identity test for 'this' always succeeded.

Frankly, I do not understand how this would work at all. In onCreate
(), the reference is set to 'this' (the current activity), otherwise
it is set to null. So the test for 'this' in onPause is only true, if
onPause() is called on the same activity instance that created the
weak reference in onCreate. But how could those ever be two distinct
objects? Is it possible that resuming an activity will not resurrect
the old one, but create a new activity object? But wouldn't that be
the same as simply doing an onCreate? I'm confused.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] XML+XPath on Android using dom4j and Jaxen

2009-05-19 Thread Matthias

Hey guys,

in case you're looking for easy and powerful XML parsing on Android,
you may be interested in this:
http://brainflush.wordpress.com/2009/05/19/the-force-unleashed-xmlxpath-on-android-using-dom4j-and-jaxen/

Cheers,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: XML+XPath on Android using dom4j and Jaxen

2009-05-19 Thread matthias

I found that it works well for us... I didn't profile the memory
consumption but I also didn't experience any noticeable system or app
slow downs, so I didn't feel it was necessary. At the end of the day,
it's pretty clear that you're trading in some performance for
stability and ease of use here. I found that it was well worth it, but
that probably depends on the app you're developing.

The point is:
If you need a full fledged XML parser that does things such as text
node merging an entity ref resolution (at least the former you will
almost certainly want to have for ANY XML document), you don't have
much of a choice: you either use existing, well proven solutions (such
as dom4j), or you use the bare XML tools Android gives you and write
everything else yourself on top of that. If the latter approach will
arrive at a result which performs better than say, dom4j, AND does
everything you actually need, then that's cool. I didn't see myself re-
inventing the wheel though.

On May 19, 5:14 pm, Zero zeroo...@googlemail.com wrote:
 as much as i love dom4j (and i do!), how is performance on the
 hardware ?
 dom4j tends to suck in  a lot of memory, so..uh..dunno.

 On May 19, 2:17 pm, Matthias m.kaepp...@googlemail.com wrote:

  Hey guys,

  in case you're looking for easy and powerful XML parsing on Android,
  you may be interested in 
  this:http://brainflush.wordpress.com/2009/05/19/the-force-unleashed-xmlxpa...

  Cheers,
  Matthias


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] include-ing views into RelativeLayouts

2009-05-18 Thread Matthias

Hi,

I have a problem with including a view hierarchy into a
RelativeLayout: all layout parameters provided when including it are
ignored, or at least not recognized properly. More precisely: I want
to position the included hierarchy (root is a LinearLayout) below
another LinearLayout in the including file.

Like this:

?xml version=1.0 encoding=utf-8?
RelativeLayout ...

...

LinearLayout android:id=@+id/search_linear_layout_1 ...
...
/LinearLayout

include layout=@layout/location_bar
...
android:layout_below=@id/search_linear_layout_1
/

...

/RelativeLayout

That doesn't work. The included LinearLayout is NOT positioned below
the given view, but is simply attached to the top edge of the screen.

What am I missing?

Thanks,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] gravity vs. layout_gravity? I'm lost.

2009-05-14 Thread Matthias

Hi,

I think I've lost enough hair over this, so now I'll ask. What is the
difference between those attributes? According to the documentation of
R.attr, there isn't any difference (doc text is exactly the same, see
http://developer.android.com/reference/android/R.attr.html), but
apparently, that's simply not true. For example, the gravity attribute
can be used on EditText to set the text alignment (e.g. left, center,
right).

I often found that neither of them work to align a view at all. For
example, I need to float two text views in a relative layout, one
going to the left below a title bar, the other going to the right
below the title bar. So what I did was this:

RelativeLayout
xmlns:android=http://schemas.android.com/apk/res/android;
android:layout_width=fill_parent
android:layout_height=fill_parent

!-- the title bar --
ImageView ...
/ImageView

TextView android:id=@+id/left_text
android:layout_below=@id/title_bar
android:layout_gravity=left
...
/

TextView android:id=@+id/right_text
android:layout_below=@id/title_bar
android:layout_gravity=right
...
/

/RelativeLayout

That doesn't work, however. The left text is indeed aligned to the
left inside its parent (the relative layout), but the right text is
not aligned to the right; instead, it's placed directly to the right
of the left text.

Why's that?

Thanks,
Matthias

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: gravity vs. layout_gravity? I'm lost.

2009-05-14 Thread matthias

Guys,

thanks for clearing up! I'll file a bug against the documentation
then, because there it says:

public static final int  gravity

Specifies how to place an object, both its x and y axis, within a
larger containing object.

Which is true for layout_gravity, but not gravity. Apart from that, I
solved my problem by wrapping the two TextViewS in a horizontal
LinearLayout and setting the left text to have a larger weight than
the right text, so that it pushes the right text to the edge of the
container (which is a good solution for me, because the left text has
dynamic length, while the right one is fixed). I suspected this would
work, but I first refused to try it, because somewhere in the docs or
on Romain's blog it was mentioned that using LinearLayoutS and weights
would be more expensive than using e.g. a RelativeLayout, because of
additional layout measurement cycles.

It would be great though if things like these (i.e. that
RelativeLayout ignores layout_gravity) would appear somewhere in the
documentation. It's not immediately apparent to people why for some
layouts the gravity is simply ignored, and for others it's not.

Anyway, thanks!

On May 14, 5:02 pm, Romain Guy romain...@google.com wrote:
 It used to be called something like that but we decided to unify the
 names across all widgets.

 On Thu, May 14, 2009 at 7:58 AM, Streets Of Boston



 flyingdutc...@gmail.com wrote:

  As a side-note: I think the TextView's (and EditText) 'gravity' should
  have been called 'alignment'. It's called that way in most UI's.  :=)

  On May 14, 10:54 am, Romain Guy romain...@google.com wrote:
  Hi,

  Well, first of all RelativeLayout ignores layout_gravity. Then you
  need to know that gravity means apply gravity to the content of this
  view whereas layout_gravity means apply gravity to this view within
  its parent. So on a TextView, gravity will align the text within the
  bounds of the TextView whereas layout_gravity will align the TextView
  within the bounds of its parent.

  On Thu, May 14, 2009 at 5:31 AM, Matthias m.kaepp...@googlemail.com 
  wrote:

   Hi,

   I think I've lost enough hair over this, so now I'll ask. What is the
   difference between those attributes? According to the documentation of
   R.attr, there isn't any difference (doc text is exactly the same, see
  http://developer.android.com/reference/android/R.attr.html), but
   apparently, that's simply not true. For example, the gravity attribute
   can be used on EditText to set the text alignment (e.g. left, center,
   right).

   I often found that neither of them work to align a view at all. For
   example, I need to float two text views in a relative layout, one
   going to the left below a title bar, the other going to the right
   below the title bar. So what I did was this:

   RelativeLayout
      xmlns:android=http://schemas.android.com/apk/res/android;
      android:layout_width=fill_parent
      android:layout_height=fill_parent

      !-- the title bar --
      ImageView ...
      /ImageView

      TextView android:id=@+id/left_text
          android:layout_below=@id/title_bar
          android:layout_gravity=left
          ...
          /

      TextView android:id=@+id/right_text
          android:layout_below=@id/title_bar
          android:layout_gravity=right
          ...
          /

   /RelativeLayout

   That doesn't work, however. The left text is indeed aligned to the
   left inside its parent (the relative layout), but the right text is
   not aligned to the right; instead, it's placed directly to the right
   of the left text.

   Why's that?

   Thanks,
   Matthias

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

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

  - Show quoted text -

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

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: include/ in TableRow

2009-05-13 Thread matthias

I have the same problem with including an EditText into a
RelativeLayout. All layout parameters are ignored, or at least not
recognized properly. The width/height fix doesn't work for me,
because the included view must not have fixed width or height.

The included view:

?xml version=1.0 encoding=UTF-8?
EditText xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@+id/location_field
android:layout_width=wrap_content
android:layout_height=wrap_content
android:singleLine=true
android:paddingLeft=10sp
android:paddingRight=10sp
android:layout_centerVertical=false
android:layout_centerHorizontal=true
android:inputType=text
android:imeOptions=actionDone|flagNoEnterAction
/

And the layout where I include it:

?xml version=1.0 encoding=utf-8?
RelativeLayout
xmlns:android=http://schemas.android.com/apk/res/android;
android:layout_width=fill_parent
android:layout_height=fill_parent
android:background=@android:color/transparent

...

LinearLayout android:id=@+id/search_linear_layout_1
android:layout_below=@id/search_title_image
android:layout_height=wrap_content
android:layout_width=fill_parent

...

/LinearLayout

include layout=@layout/location_field
android:id=@+id/search_edit_text
android:layout_width=300px
android:layout_below=@id/search_linear_layout_1
/

LinearLayout android:id=@+id/search_linear_layout_2
android:layout_below=@id/search_edit_text
android:layout_height=wrap_content
android:layout_width=fill_parent

...

/LinearLayout

...

/RelativeLayout

The edit box floats at the top of the screen instead of below the
linear layout, and is also not 300 pixels wide.

Any ideas?

Thanks,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: include/ in TableRow

2009-05-13 Thread matthias

Correction:
Passing the layout_* params to include works, but you MUST provide
them there, not in the included view. If you pre-define them in the
included view, then they get ignored, so there is no point in defining
defaults and only overriding the ones you need to change; you always
have to pass all layout attributes in the include directive. :-/

Is this a bug?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 All files in the directory

2009-05-07 Thread matthias

Hi,

for accessing e.g. the shared_prefs directory, you would do something
like this (in an Activity or Service):

PackageManager pm = getPackageManager();
ApplicationInfo appInfo = pm.getApplicationInfo(getPackageName
(), 0);

final ListString list = Arrays.asList(files);
File sharedPrefsDir = new File(appInfo.dataDir + /
shared_prefs);

FileFilter filter = new FileFilter() {
public boolean accept(File pathname) {
   // in case you must filter files...
   [...]
}
};
File[] prefFiles = sharedPrefsDir.listFiles(filter);
for (File f : prefFiles) {
[...]
}
}


HTH.

Cheers,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 All files in the directory

2009-05-07 Thread matthias

Hi,

not sure about the app dir, but for accessing e.g. the shared_prefs
directory, you would do something
like this (in an Activity or Service):

PackageManager pm = getPackageManager();
ApplicationInfo appInfo = pm.getApplicationInfo(getPackageName
(), 0);

File sharedPrefsDir = new File(appInfo.dataDir + /
shared_prefs);

FileFilter filter = new FileFilter() {
public boolean accept(File pathname) {
   // in case you must filter files...
   [...]
}
};
File[] prefFiles = sharedPrefsDir.listFiles(filter);
for (File f : prefFiles) {
[...]
}
}

HTH.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 anyone do XPath on Android?

2009-05-07 Thread matthias

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

2009-05-06 Thread Matthias

Hey guys,

I have recently been working on an OAuth library that has been
designed to play well with Apache HttpComponents 4 (and thus, Android
of course). If you're looking for a straight forward way to do client-
side OAuth on Android, check it out (literally) here:
http://code.google.com/p/oauth-signpost

I'd like to get feedback / suggestions / contributions from my fellow
Android developers (that would be you!).

Cheers,
Matthias

PS: there is also a slightly opinionated (hence missing on the project
homepage) rationale for why I started this project on my blog:
http://brainflush.wordpress.com/2009/05/03/introducing-signpost-easy-oauth-for-java-and-apache-httpcomponents-android-too/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Discussion on localizing-android-apps-draft

2009-04-11 Thread Matthias

in case not everyone noticed, this article has been updated and now
contains the correct instructions.

Thanks Justin!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Speed difference between DOM and SAX parser for small documents

2009-04-08 Thread Matthias

Hi,

currently, we use the SAX parser bundled with Android to parse XML
coming from our servers. We found however that parsing the XML using a
SAX handler is prone to errors and difficult to maintain. Therefore I
thought about switiching to a DOM parser, and probably also a wrapper
around it (like JDOM) for convenience.

But, does anyone know how big the performance impact will be? Is it
negligible for documents that are merely 10-50k in size? I remember
that in early alphas of Android, the DOM parser was noticeably slower,
but I also heard that this has become better meanwhile.

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



[android-developers] Re: ListView elements in Dialogs never expand to full width

2009-04-01 Thread matthias

anyone? I still cannot sort this one 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 make a ListView adapt to dynamic element sizes?

2009-04-01 Thread Matthias

Hi,

I am struggling over another layouting problem again. I render a
ListView with ellipsized TextView elements, but those text views can
expand in size when the user clicks it. The problem is: If the
ListView doesn't already take the whole screen (e.g. because the total
height of all visible elements is smaller than the screen height),
then when expanding an element, the ListView's size doesn't also
expand accordingly, still obscuring most parts of the now taller text
view.

I have tried practically everything that seemed reasonable to me to
make the ListView get aware of the new height of its children,
including calls to:

invalidate()
measure()
recomputeViewAttributes(textView)

on all participating views (the list view and its elements), but
nothing works.

What am I missing? How can I programmatically tell a container view to
look at its children again in order to resize if necessary?

Thanks!
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Performance: pre-instantiate activities on app launch? Good practice or not?

2009-04-01 Thread matthias

Thanks for your reply Dianne.

As to profiling, I looked at traceview, but seems to be a bit overly
simplistic to actually profile a whole app. What I understand from the
documentation, what it actually does is measuring the time it takes
for a single method to complete. That's not a terribly useful
information if you want to see the big picture, however (i.e. get
answers to questions such as: how much time does the app spend in
which parts of the code base?).

Are there any plans to make traceview a tad more capable? That would
be great news!

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

2009-04-01 Thread matthias

Romain,

thanks for pointing out onInterceptTouchEvent()! I'll take a look at
that method ASAP.

As to the it was meant to be part of the UI design, I really wonder
why practically none of the apps shipped with Android use gestures
then (I mean, apart from scrolling up or down of course)? I can only
think of the home app right now. In contrast, the iPhone makes very
consistent use of flings to navigate back and forth between app
screens. We tried to implement this for our app, but as I said, it
wasn't actually an easy thing to do, because, for example, Android
doesn't actually define what a left or right fling is (in terms of
velocity and so forth). So, another app may have a different
understanding of this, and react differently to left and right flings
(in terms of when to interpret it as such, not in terms of the
resulting action, which of course may be different), giving navigation
in the platform an inconsistent feel. That's what I meant with messy
and fragile.

Cheers,
Matthias

On Mar 29, 8:16 pm, Romain Guy romain...@google.com wrote:
  Doesn't look like fling support as known from the iPhone was ever
  meant to be part of Android's UI design. Making your app react to
  flings (or even detect them properly) is a messy and fragile procedure
  in Android.

 It was meant to be part of the UI design. And it's not messy nor
 fragile, you just need to use onInterceptTouchEvent().

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

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to make a ListView adapt to dynamic element sizes?

2009-04-01 Thread matthias

Well, I found a really ugly workaround. That workaround is based on my
observation that the problem described does only occur if the
ListView's layout height is set to WRAP_CONTENT. So, since I use a
custom list adapter, I now call listView.getLayoutParams().height =
LayoutParams.FILL_PARENT whenever a text view is about to be
expanded... the reason I do not statically set its height to
FILL_PARENT is because then it will draw line separators below the
last element, which looks ugly if it doesn't expand to the bottom of
the screen.

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



[android-developers] Re: ListView elements in Dialogs never expand to full width

2009-04-01 Thread matthias

Okay, I found (once again), a rather ugly workaround for this: Putting
the textview in layout object does the job. Like this:

?xml version=1.0 encoding=utf-8?
RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=wrap_content
android:paddingLeft=14dip
android:paddingRight=15dip

TextView
android:id=@+id/list_dialog_item
android:layout_width=fill_parent
android:layout_height=wrap_content
android:minHeight=?android:attr/listPreferredItemHeight
android:textAppearance=?android:attr/textAppearanceLarge
android:gravity=center_vertical
/
/RelativeLayout

But, that layout object is unnecessary overhead of course

Is this a bug maybe?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Discussion on localizing-android-apps-draft

2009-04-01 Thread Matthias

Xavier,

very helpful! thanks for sharing, works perfectly.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] ListView elements in Dialogs never expand to full width

2009-03-31 Thread Matthias

Hi,

I am rendering a ListView inside a dialog. The ListView elements are
very simple TextView objects. The problem: whatever I do, they never
take the full width in the list view, which has the side effect that
the list view selector only covers the actual text, not the whole list
entry (i.o.w., if the text of the entry is much smaller than the width
of the listview/dialog, then only a tiny portion of the list element
is highlighted when focusing it).

Setting layout_width to FILL_PARENT on the text view layout didn't
help. So didn't layout_gravity = fill_horizontal.

Why doesn't this work?

The TextView (list element):

?xml version=1.0 encoding=utf-8?
TextView xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@+id/list_dialog_item
android:layout_width=fill_parent
android:layout_height=wrap_content
android:minHeight=?android:attr/listPreferredItemHeight
android:textAppearance=?android:attr/textAppearanceLarge
android:gravity=center_vertical
android:paddingLeft=14dip
android:paddingRight=15dip
/

The dialog layout:

ListView xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@+id/list_dialog_list
android:layout_width=wrap_content
android:layout_height=wrap_content
/

Any ideas?

Cheers,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Long click on list activity item

2009-03-31 Thread matthias

Hi,

On Feb 22, 9:53 pm, an...@akapost.com wrote:
 ...
 The standard onListItemClick() will still fire as well; my best guess
 there is to keep a suppression boolean around, which isn't pretty.
 Any other thoughts on this?

just return true from onItemLongClick(); this means you have consumed
the event, so it won't propagate up to the normal click handler.

Cheers,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Discussion on localizing-android-apps-draft

2009-03-31 Thread Matthias

Setting the locale in /data/locale as described here doesn't work for
me in 1.1 R1. Has the process changed? This used to work for me in
pre-1.1 releases.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Performance: pre-instantiate activities on app launch? Good practice or not?

2009-03-30 Thread Matthias

Hi guys,

our app is getting bigger and more complicated lately, and I
definitely noticed a loss in responsiveness and overall snappy-ness.
Besides onCreate handlers becoming slower (we use lots of custom view
drawables now, because the Android stock styles don't work for us
anymore), sometimes, when a class is used for the first time, the
Android class loader lazy loads that class which significantly slows
down activity load times.

I was therefore wondering if you know whether it's possible and common
practice to load activities and classes which are anticipated to be
loaded anyway during application start, e.g. by using Class.forName or
even explicitly calling Activity.onCreate simply to already have it
readily constructed as soon as the user actually wants to use it? A
loading screen would be shown meanwhile.

I have never seen an Android app doing this, but on the iPhone, almost
any application goes through a loading process when starting up.

Any thoughts on best practices and solutions here?

Thanks for your input,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 progress indicator ?

2009-03-29 Thread matthias

that's a good question; unfortunately, drawable resources are poorly
documented. You can always take a look at the Android implementation
though... there should be plenty of examples. I usually simply copy
over drawables from the framework and modify them to suit my needs.
Android's drawables (including the progress indicators) are located in
frameworks/base/core/res/res/drawable.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: testing using EasyMock

2009-03-29 Thread matthias

Hi,

On Mar 26, 4:15 pm, gyuri gyorgy.tar...@gmail.com wrote:
 Can EasyMock be used with Android SDK to test my code?
 ...

How did you run that test case? You cannot run tests against Android
classes (or tests which stub them) just by running your tests as a
Junit program or whatever. You cannot access Android classes from
outside the emulator, so you will have to use Android's
Instrumentation mechanisms to run your tests. Doing so should get rid
of weird class loader errors.

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

2009-03-29 Thread matthias

Well, you can set a OnTouchListener on any view, including ListView,
and use a GestureDetector to detect horizontal flings. So, yes, I
guess. The problem with this whole touch mechanism in Android is that
child views can silently consume the touch gesture, so your fling will
not even propagate up to your ListView when it happened on a list
element.

Doesn't look like fling support as known from the iPhone was ever
meant to be part of Android's UI design. Making your app react to
flings (or even detect them properly) is a messy and fragile procedure
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] Re: File size column in image database is always 0 for the newest image

2009-03-27 Thread matthias

I raised a bug for this: http://code.google.com/p/android/issues/detail?id=2311

By the way, I wonder what ContentResolver.startSync() does? Maybe one
has to call this in order to see an up-to-date media DB? (Its
documentation is, as usual, a bit lacking.)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: File size column in image database is always 0 for the newest image

2009-03-27 Thread matthias

Oh and, how did you resolve a content URI to an image path? I realized
that the read into memory approach does not work for me, because
sometimes when I go through an open-read-close-open-read cycle for the
image stream, I get an IOException (funny enough, not always).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: File size column in image database is always 0 for the newest image

2009-03-27 Thread matthias

okay, one solution is to do something like this:

String path = Environment.getExternalStorageDirectory
().getAbsolutePath()
+ /dcim/Camera/ + [value of DISPLAY_NAME column for
this image];

and then do a new File(path).length()

but I'm not sure if that path value is portable between Android
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: File size column in image database is always 0 for the newest image

2009-03-27 Thread matthias

ah my bad, I missed that. Very confusing tho, since the documentation
says about that column:


public static final String DATA

The data stream for the file

Type: DATA STREAM
Constant Value: _data


that sounds to me more like a BLOB than a path!


On Mar 27, 2:45 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 Read my post from yesterday at 10am again :-)

 Execute a query using your content-uri, and use the returned cursor to
 obtain the physical file-path (use the ImageColumns.DATA).

 On Mar 27, 9:27 am, matthias m.kaepp...@googlemail.com wrote:

  okay, one solution is to do something like this:

          String path = Environment.getExternalStorageDirectory
  ().getAbsolutePath()
                  + /dcim/Camera/ + [value of DISPLAY_NAME column for
  this image];

  and then do a new File(path).length()

  but I'm not sure if that path value is portable between Android
  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: No callback when list item is touched.

2009-03-27 Thread matthias

I have a similar problem: When putting different widgets in a
listview, things get out of hand.

I had three custom relative layouts and a spinner in that listview,
and everything worked fine. I then added another spinner and a button,
and now the spinners do not update their focused/clicked state anymore
(they respond to click/touch events, but they do not visually appear
as being clicked). The button however, still behaves normally but only
until I select an item from a spinner; after that, the button also
stops updating its state when being clicked.

Is there any general rule to obey to when putting things with custom
click handlers in listviews?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] File size column in image database is always 0 for the newest image

2009-03-26 Thread Matthias

Hi,

I am uploading images to our webservice from the phone, and thus I
need to know the exact size of an image. I noticed that with some
photos from the G1, the webservice always failed, and found out that
it's due to the file size always being 0 for the latest image in the
database.

Is this a known bug? What else can I do to find out the size of an
image on the phone without going through the DB? I want to avoid
writing the whole image to a byte buffer just to find out its size...

here is some code to play with:

ContentResolver contentResolver = getContentResolver
();
Cursor c = contentResolver.query(
Uri.parse(content://media/external/images/
media),
new String[] { Images.ImageColumns._ID,
Images.ImageColumns.DISPLAY_NAME,
Images.ImageColumns.SIZE }, null,
null, null);
while (c.moveToNext()) {
Log.d(PHOTO, c.getLong(0) +   + c.getString(1)
+  
+ c.getLong(2));
}
c.close();

This gives me 0 in the third column for the last entry (that's the
newest photo).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: File size column in image database is always 0 for the newest image

2009-03-26 Thread matthias

Hi,

thanks for the swift reply!

Hm, if the workaround you suggest is slow, maybe I am better off with
writing the image to a byte buffer and taking its size after all? I
just tested that solution, and it was much faster than I expected.
Since I upload images in a background service, it may not even be a
noticeable overhead to the user.

But still, this is an annoyance, did you already raise a bug for this?

Cheers,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: File size column in image database is always 0 for the newest image

2009-03-26 Thread matthias

Hi,

On Mar 26, 4:04 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 You still may need to do this, though.

 With my application; if i don't do the MediaScanner thing, the
 'Pictures' application will crash!
 You may find the same problem. Try to insert an image (with the SIZE
 being 0), then close your app and start the stock 'Pictures'
 application. Check if it crashes or not.

 If it does, you should do the MediaScanner thing. You don't want to
 get angry customers :-)

I see. I do not insert images into the database myself though. I only
load them; but if the user takes a picture and then wants to select it
from the gallery app, then its size is also 0, that's why I was having
these problems.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Bundles and serializable objects - what is actually stored?

2009-03-25 Thread matthias

Thanks for your in-depth answer, that was really helpful.

Cheers,
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ListActivity.onListItemClick() only responds to trackball/dpad clicks

2009-03-24 Thread matthias

Hi,

On Mar 23, 7:52 pm, droozen droozenr...@gmail.com wrote:
 Have you tried following the Notepad tutorial and this line in your
 onCreate method?

         registerForContextMenu(getListView());


Why would I want to do that, I do not need a context menu. Maybe I
didn't make myself clear enough about the problems I run into. It's
really simple actually: I have a ListActivity, and in the list that is
hosted by this activity I render list items using a custom
RelativeLayout. Nothing fancy at all.

Now, of course I want those items to be selectable and clickable by
the user. And that doesn't work. The user has to scroll to an item
first using the dpad/trackball to focus it, and only then is able to
click it. I want the item to be directly pressable, however, using a
touch motion. But that event never reaches the list view, and thus
onListItemClick() is not called. It seems that for some reason, my
list items consume all touch gestures before they are able to
propagate up to the view and be able to be interpreted as a click. But
that's just a wild guess. I have absolutely no idea how this is even
possible, especially since it works in other ListActivities I 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: ListActivity.onListItemClick() only responds to trackball/dpad clicks

2009-03-24 Thread matthias

I found the problem:

Removing the call to textView.setMovementMethod
(LinkMovementMethod.getInstance()); in a TextView I use in the list
item layout fixed the problem.

Is that expected behavior? I think about raising a bug about 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
-~--~~~~--~~--~--~---



  1   2   >