[android-developers] Scrolling ListView manually by pixels

2010-07-14 Thread yuku
Hi,

I want to make use of the trackball or d-pad to scroll my ListView
smoothly.
Without implementing anything, by default the list scrolls by one
item, which is not appropriate for my app, since list items have
different heights and I just want to scroll it by a fixed amount.

Is there anything to call to let's say, emulate a 10 pixel drag down?

Thanks.
Yuku

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Motorola Droid - QCIF Camera Preview and Capture

2010-07-14 Thread Ignas
I have heard rumors that this problem is not visible on Motorola
Milestone, which seems to be a very similar HW. Can someone confirm if
the same problem persists in Milestone? I would think that the camera
and related components should be the same. Thus, this seems like a
driver problem. Hopefully, 2.2 update might solve the problem.

On Jul 8, 4:52 pm, kao alexander.o.krutya...@gmail.com wrote:
 i've faced the same issue with the droid's camera. and i think i can
 add few details.

 1. reboot droid and start droid's native camera application
 preview is ok (every time after reboot)
 2. exit the camera app and start modified (forQCIF) sample app
 preview is bad.
 3. exit the sample app and start native camera app again (no reboot)
 preview is bad. and it stays bad until you reboot the droid.

 so it seems that all we need is to force camera's reset as it happens
 during droid startup. does anyone know how to do this?

 On Jun 23, 6:09 am, Ignas ignas.limanaus...@gmail.com wrote:



  Hello,

  I am seeing a very annoying behavior onMotorolaDroid when trying to
  do a simple camera preview atQCIFresolution. And I was wondering if
  someone experienced something similar. Is there a workaround? Am I
  doing something wrong?

  Let me explain the situation.

  Firstly, right after boot-up, using native camera application there is
  nothing out of ordinary, I see preview each time and it is all
  perfectly well for as long as needed as many times as I want.

  The interesting behavior starts when I use the slightly modified API
  Demos (full app available in Android SDK, modified file is attached).
  My goal is to preview (and later capture) video atQCIF(176 x 144)
  resolution.

  Using CameraPreview module in API Demos application I can start
  preview and capture normally only the first time – picture is clear,
  focused, normal colors, etc. Preview and all is nice. The second time
  I do preview I see a very over-exposed picture, I need to turn it away
  from any light source to see anything, otherwise it is all white. And
  even in the shadow, everything is grainy, as if picture is taken with
  too sensitive settings (high ISO) with too long exposure. The third
  time, it is the opposite – the preview and capture is way too dark. I
  need to point the camera directly into the light source to see even a
  faintest picture. Pointing out of the window does not help, it has to
  be straight into the lamp or sun. The effect is like taking pictures
  with much too low ISO setting – it is way too underexposed.

  The overexposed and underexposed sessions interchange, but it is not
  clear-cut which one appears first. So far the prevailing pattern is
  that overexposed one starts first. Now surprise comes when I try using
  native camera application. The pattern continues! It is as if hardware
  or or software (camera process) got tainted with theQCIF. This
  continues until I reboot the device.

  Another interesting point is that if I allow device to rest,
  symptoms are much less pronounced after 10 minutes, then in 15 minutes
  they become barely visible. However, it all comes back after the first
  time I capture inQCIF. Nothing like this is visible when resolution
  is higher, say, CIF, VGA or similar. The problem is that, for my
  purposes I need it to beQCIF.

  This does look like a problem in HW, drivers, or somewhere around OS.
  Any ideas, workarounds, tricks?

  If it is not too much to ask, can somebody try the code modifications
  below to try on your device? I am curious which devices are working
  properly and which are not. Shall we have a vote?

  === Device Information ===
  Firmware version: 2.1-update-1
  Baseband version: C_01.3E.03P
  Kernel version: 2.6.29-omap1-g7fa8788 android-bu...@apa26 #1
  Build number: ESE81

  === To reproduce ===
  Open CameraPreview.java from SDK root/samples/android-7/ApiDemos/src/
  com/example/android/apis/graphics, and add the following method:
      @Override
      protected void onMeasure(int w, int h) {
          super.onMeasure(w, h);
          setMeasuredDimension(176, 144);
      }

  Also in the surfaceChanged method, add the following line:
          parameters.setPreviewFrameRate(15);

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 there any way to parse JSON object into ArrayList or Map...

2010-07-14 Thread Sohan badaya
Hi,
Is there any way to parse JSON object, that comes from facebook server
in a response, into ArrayList or Map so that i can set values in my
ListView.
 I am finding difficulty in parsing because JSON
object itself contains JSONArray and this Array can contain JSONObject
may be in recurcive order.

Please suggest me any way to solve this problem.

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] Gps issues in real phone

2010-07-14 Thread arindam

Hello everybody,

 I use the following code to play with gps. In
emulator its working with sending manually gps data
but in real phone when i installed it only showing the gps icon but no
data is coming.I am not able to understand whats wrong in this code.
In real phone I enable Gps and in Map application I can able to see my
current Location.

Here is the Java code :

import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.Toast;

public class UseGps extends Activity
{

/** Called when the activity is first created. */

@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
/* Use the LocationManager class to obtain GPS locations */
LocationManager mlocManager =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);
LocationListener mlocListener = new MyLocationListener();
mlocManager.requestLocationUpdates( 
LocationManager.GPS_PROVIDER, 0,
0, mlocListener);
}
/* Class My Location Listener */
public class MyLocationListener implements LocationListener
{

public void onLocationChanged(Location loc)
{
loc.getLatitude();
loc.getLongitude();
String Text = My current location is:  + Latitud =  
+
loc.getLatitude() + Longitud =  + loc.getLongitude();

Toast.makeText( getApplicationContext(),Text,Toast.LENGTH_SHORT).show();
}
public void onProviderDisabled(String provider)
{
Toast.makeText( getApplicationContext(),Gps
Disabled,Toast.LENGTH_SHORT ).show();
}
public void onProviderEnabled(String provider)
{
Toast.makeText( getApplicationContext(),Gps
Enabled,Toast.LENGTH_SHORT).show();
}
public void onStatusChanged(String provider, int status, Bundle
extras)
{

}

}

}




Here is the Manifest file:

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.android.location1
  android:versionCode=1
  android:versionName=1.0
application android:icon=@drawable/icon android:label=@string/
app_name
activity android:name=.UseGps
  android:label=@string/app_name
intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity

/application
uses-sdk android:minSdkVersion=3 /

uses-permission android:name=android.permission.INTERNET /
uses-permission
android:name=android.permission.ACCESS_NETWORK_STATE /
uses-permission
android:name=android.permission.ACCESS_FINE_LOCATION /uses-
permission
/manifest










Thanks  regards
Arindam Ghosh

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

2010-07-14 Thread Maxood
Thank you Robert! We make games on FB and iPhone. We have a growing
Android team.Have a look at our apps here and let me know how we can
benefit each other:

http://www.avenuesocial.com/mob-app.php


Maqsood

http://www.twitter.com/maxood


On Jul 9, 11:09 am, Robert Green rbgrn@gmail.com wrote:
 Check out libgdx, it has lots of integration pieces that will make it
 fairly quick to get a game prototyped and 
 working.http://apistudios.com/hosted/marzec/badlogic/wordpress/?page_id=307

 On Jul 6, 10:46 am, Renan Lima renan.lim...@gmail.com wrote:



  Hey all!

  I´m new on Android 3D game development.
  I would like to know if there any engine/ API/ platform
  about 3D development that I could use. Or any tip which
  you could give me, like where I could start looking for.

  Thank you all!

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


[android-developers] how to Change SMS Preference or setting

2010-07-14 Thread Nandan .
hi friends,,,

in my application i m trying to change default android SMS Setting through
programming.

But i havent find any document to how to change Messages Setting in android.

i have seen package android.provider.Settings but in this package i hav'nt
find any setting regarding SMS.

With Regrads
Bhavesh-

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

RE: [android-developers] Re: Bounce animation

2010-07-14 Thread Ericson, Anders
Bouncing as you describe it is not supported in ListView. It is possible to 
lift the ListView class from the platform and modify it to support it (most of 
the necessary changes are in AbsListView btw), but I don't recommend that 
approach. Instead, I would recommend that you implement your own list view.

I've made a tutorial for how to make a custom list view (which has support for 
bounce) which is available here: 
http://blogs.sonyericsson.com/developerworld/category/tutorials/3d-list/

If you're not interested in changing appearance, you can probably skip part 2.

Good luck

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of Sandy
Sent: den 13 juli 2010 17:38
To: Android Developers
Subject: [android-developers] Re: Bounce animation

Can someone please comment on this?

Also, when height of one vertical list item is increased, it should
result in the slide animation of the rest of the items in the list
view (basically other items should slide down). I have noticed that
list view does not support this, but any other suggestions on what is
the best approach to achieve this?

Thanks,
Sandy

On Jul 12, 5:38 pm, Sandy snarr...@gmail.com wrote:
 I've noticed that in froyo on nexus 1, app menu thumbnail list can be
 scrolled up and down and, as it's scrolled, the applications roll up
 into a 3D cube instead of disappearing from the screen. Once the
 bottom of the application thumbnail list is hit, the screen bounces
 off similar to the iPhone functionality.

 Is the bounce effect at the boundaries of the list available on a
 vertical ListView? If not, is it easy to customize this in on vertical
 lists?

 Thanks,
 Sandy

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Rapid Android Development with AML, looking for feedback

2010-07-14 Thread Maxood
Hi Jeff,
That'll be a great contribution to the Android Framework. I'll be
happy to know more about it. Going through the examples on the website
here :http://www.amlcode.com/examples/

I would come up with questions and queries later on.Wishing you best
of luck with your ongoing research.

Maqsood
http://www.twitter.com/maxood

On Jul 13, 8:14 pm, Jeff Rowberg jeffrowb...@gmail.com wrote:
 Hello again everyone,

 Due to the response I got from DZone, I've migrated my AML project to
 its own website, which you can find here:

 http://www.amlcode.com

 My quest for feedback and input from the Android development community
 is still going on though, so if anyone has any suggestions, ideas,
 criticism, anything at all, I'm wide open to what you have to say.
 Specifically, here's what I'm trying to find out:

 1. Would you use this for your own app?
 2. What would it need to do in order to be most useful?

     Jeff

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

2010-07-14 Thread Ericson, Anders
Hi,

You can inject motion events to your ListView that corresponds to a 10 pixel 
drag. Create an ACTION_DOWN event and then an ACTION_UP event 10 pixels apart 
and then send them to the ListView using onTouchEvent(). You might need to have 
a ACTION_MOVE event as well. 

/Anders

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of yuku
Sent: den 14 juli 2010 08:12
To: Android Developers
Subject: [android-developers] Scrolling ListView manually by pixels

Hi,

I want to make use of the trackball or d-pad to scroll my ListView
smoothly.
Without implementing anything, by default the list scrolls by one
item, which is not appropriate for my app, since list items have
different heights and I just want to scroll it by a fixed amount.

Is there anything to call to let's say, emulate a 10 pixel drag down?

Thanks.
Yuku

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: how to setup vold.conf for USB mass storage device

2010-07-14 Thread FrankG
I assume, that you must explain a little bit more, what are you trying
to do :

For me it sounds, that you would like to  attach an external usb
storage to your andorid device, right ?
What kind of device is it ?

BTW .. it think android-platform is better group for such questions,
as a normal developer has no
chance to change vold.conf.

Good luck !

  Frank

On 14 Jul., 02:22, rhardy rha...@austin.polycom.com wrote:
 Can anyone tell me how to setup vold.conf for ums.  I can't find any
 documentation on it.  I want vold to mount a hotplugged USB storage
 device and broadcast notifications (intents) when it is plugged and
 unplugged.

 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: soft keyboard selection from app?

2010-07-14 Thread jamesc
Hi

I had issues with the X10s IME in that it ignored particular IME flags
(http://developer.sonyericsson.com/wportal/devworld/forum?
cc=gblc=en).  You might be suffering from a similar issue.  I suggest
that you post to the SE forum and ask them directly (they confirmed my
findings).

Off the top of my head (I've not got the code in front of me at the
moment) I did find that I got the (my) required behaviour by passing
in Type_NULL (or something like that) into the IME configuration
method.  So, you *may* want to play about with the arguments and see
what comes out.  This, however, then leads to the issue that you've
got different config flags for different IMEs, and as far as I know,
you cannot determine which IME is actually in use.  You can, however,
find out which IMEs are present on the device, so you could apply some
sort of workaround if the device is an SE device (but that may affect
users of the standard Android IME on the SE phone...).

I'm not sure that you can enforce the use of the standard Android IME
because that's the responsibility of the user/security issue (also, it
might be a bit 'odd' when the IME is different to what they're
currently using).  I suppose you could show the IME picker and also
tell the user why you're doing that (but, again, that's not the best
solution).

I'd be interested to hear how you get on.

One last thing, you might want to get hold of Swype and Swiftkey to
try those IMEs out too...


On Jul 13, 9:19 pm, ddum...@gmail.com ddum...@gmail.com wrote:
 So Sony appears to have included their own IME with their xperia
 phones.

 I have an edit box for numerical input that i have specified as number|
 numberDecimal|phone
 It allows for easy number entry and allows users to enter in decimal
 numbers.   However the IME in the xperia phones is missing the decimal
 key.
 Is there a way to specify it should only be using the android IME?

 Can I specify resources for specific phones similar to how I can
 control resources for versions of android?

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


[android-developers] Re: Mount USB Drive

2010-07-14 Thread FrankG
What kind of app is DoubleTwist ?

I assume that DoubleTwist will broken if the mobile
will support different usb modi and the app has no chance to know.
which one is the actual one.

Good luck ! Frank



On 13 Jul., 15:21, Boozel boozelcl...@gmail.com wrote:
 I do not know how to do it but it must be possible since apps like
 DoubleTwist can do this.

 On Jul 13, 11:09 am, perumal316 perumal...@gmail.com wrote:



  Hi All,

  I want my application to automatically mount the phone into USB
  storage drive if USB cable is connected.

  Is there code to do it? I tried searching but couldn't find any info
  on it.

  Thanks In Advance,
  Perumal- Zitierten Text ausblenden -

 - Zitierten Text anzeigen -

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


[android-developers] checkbox in listview

2010-07-14 Thread Narendra Bagade
Hi All,

I have put checkbox in listview and displaying on the screen.

can  anyone tell me how to get checkbox even when user click on checkbox of
listview.

Thanks in advance.

.

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

[android-developers] event of checkbox is selcted/unselected

2010-07-14 Thread Narendra Bagade
Hi All,

How do I listen to the event when a checkbox is selcted/unselected?


-- 
Regards,

Narendra B
9422785229,
Nagpur.

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

[android-developers] Tab host problem. new screen comes in full screen tabs are not displayed

2010-07-14 Thread Arun
Hi All,

I am writting an application using tabhost and tab widget
initially on first screen it works fine
but when on click of tab widget when i load another xml
it comes in full screen and tabs are not displayed

Please correct me how can i make sure tabs appears on every screen.

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


[android-developers] HttpPost and byte[] on Android?

2010-07-14 Thread Serdel
Hello,

I am dealing with http post method on Android. I have successfully
send simple string pairs using HttpClient and HttpPost class with the
NameValuePair as entity. However now I want to send a simple array of
bytes[]. Unfortunately the only entities I have found for the HttpPost
class are the NameValuePair and FileEntity. However my byte[] is not
from a file. Wirting it to a file and then sending by the FileEntity
seems to be pointless and stupid. How can I send this array using
default HttpClient and HttpPost class??

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


[android-developers] AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread TjerkW
Basically i have an AppWidgetProvider which starts a Service on
update. That service starts a thread and at the end it updates the
widget by calling AppWidgetManager.updateAppWidget.

But i get a NullPointerException? What am i doing wrong? The Service
is not in a different process..


07-14 10:30:29.936: INFO/HyvesWidgetProvider(12077): updateAppWidget
appWidgetId=63
07-14 10:30:35.156: DEBUG/dalvikvm(12077): threadid=14: still
suspended after undo (sc=1 dc=1 s=Y)
07-14 10:30:35.156: DEBUG/dalvikvm(12077): GC_EXPLICIT freed 4078
objects / 373584 bytes in 97ms
07-14 10:30:36.711: WARN/dalvikvm(12077): threadid=14: thread exiting
with uncaught exception (group=0x4001d7f0)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): FATAL EXCEPTION:
Thread-16
07-14 10:30:36.796: ERROR/AndroidRuntime(12077):
java.lang.NullPointerException
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.widget.RemoteViews
$ReflectionAction.writeToParcel(RemoteViews.java:399)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.widget.RemoteViews.writeToParcel(RemoteViews.java:1003)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.android.internal.appwidget.IAppWidgetService$Stub
$Proxy.updateAppWidgetIds(IAppWidgetService.java:374)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
246)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
265)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetProvider.updateAppWidget(HyvesWidgetProvider.java:
75)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.onUserInfoRetrieved(HyvesWidgetService.java:
162)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.access
$2(HyvesWidgetService.java:149)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService
$2.onItemRetrieved(HyvesWidgetService.java:123)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService
$2.onItemRetrieved(HyvesWidgetService.java:1)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.proxy.content.CachePolicyImpl.getItemById(CachePolicyImpl.java:
33)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.proxy.content.BaseSourcesInfo.getItemById(BaseSourcesInfo.java:
90)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.onBuzzItemRetrieved(HyvesWidgetService.java:
120)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.access
$0(HyvesWidgetService.java:118)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService
$1.onItemRetrieved(HyvesWidgetService.java:96)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService
$1.onItemRetrieved(HyvesWidgetService.java:1)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.proxy.content.CachePolicyImpl.getItemByParentIdAndPosition(CachePolicyImpl.java:
68)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.proxy.content.BaseSourcesInfo.getItemByParentIdAndPosition(BaseSourcesInfo.java:
98)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.onUpdate(HyvesWidgetService.java:
89)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.run(HyvesWidgetService.java:
83)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
java.lang.Thread.run(Thread.java:1096)

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

2010-07-14 Thread Kostya Vasilyev

Are you calling updateAppWidget from the worker thread?

If so, don't. UI calls can only be made from the UI thread.

Use a Handler / Runnable to post data calculated by the worker thread to 
the UI thread and call updateAppWidget from there.


-- Kostya

14.07.2010 12:37, TjerkW пишет:

Basically i have an AppWidgetProvider which starts a Service on
update. That service starts a thread and at the end it updates the
widget by calling AppWidgetManager.updateAppWidget.

But i get a NullPointerException? What am i doing wrong? The Service
is not in a different process..


07-14 10:30:29.936: INFO/HyvesWidgetProvider(12077): updateAppWidget
appWidgetId=63
07-14 10:30:35.156: DEBUG/dalvikvm(12077): threadid=14: still
suspended after undo (sc=1 dc=1 s=Y)
07-14 10:30:35.156: DEBUG/dalvikvm(12077): GC_EXPLICIT freed 4078
objects / 373584 bytes in 97ms
07-14 10:30:36.711: WARN/dalvikvm(12077): threadid=14: thread exiting
with uncaught exception (group=0x4001d7f0)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): FATAL EXCEPTION:
Thread-16
07-14 10:30:36.796: ERROR/AndroidRuntime(12077):
java.lang.NullPointerException
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.widget.RemoteViews
$ReflectionAction.writeToParcel(RemoteViews.java:399)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.widget.RemoteViews.writeToParcel(RemoteViews.java:1003)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.android.internal.appwidget.IAppWidgetService$Stub
$Proxy.updateAppWidgetIds(IAppWidgetService.java:374)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
246)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
265)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetProvider.updateAppWidget(HyvesWidgetProvider.java:
75)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.onUserInfoRetrieved(HyvesWidgetService.java:
162)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.access
$2(HyvesWidgetService.java:149)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService
$2.onItemRetrieved(HyvesWidgetService.java:123)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService
$2.onItemRetrieved(HyvesWidgetService.java:1)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.proxy.content.CachePolicyImpl.getItemById(CachePolicyImpl.java:
33)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.proxy.content.BaseSourcesInfo.getItemById(BaseSourcesInfo.java:
90)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.onBuzzItemRetrieved(HyvesWidgetService.java:
120)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.access
$0(HyvesWidgetService.java:118)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService
$1.onItemRetrieved(HyvesWidgetService.java:96)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService
$1.onItemRetrieved(HyvesWidgetService.java:1)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.proxy.content.CachePolicyImpl.getItemByParentIdAndPosition(CachePolicyImpl.java:
68)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.proxy.content.BaseSourcesInfo.getItemByParentIdAndPosition(BaseSourcesInfo.java:
98)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.onUpdate(HyvesWidgetService.java:
89)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.run(HyvesWidgetService.java:
83)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
java.lang.Thread.run(Thread.java:1096)

   



--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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


[android-developers] Re: OpenGL ES libraries

2010-07-14 Thread Indicator Veritatis
Most OpenGL programmers learned the C API before even thinking of
doing it in Java, so there is not much demand for such a wrapper.

On Jul 13, 7:23 am, Sundog sunns...@gmail.com wrote:
 I looked around for info on this in the group but couldn't find any...
 so far in my OpenGL programming I've just done everything directly,
 but I was curious if anyone had written any wrapper libraries for it
 besides min3d. Min3d is great (or is getting there) but it's GPL'd,
 making it unsuitable for a commercial product (if my understanding of
 the license is correct).

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


[android-developers] Widget won't update. Process is bad

2010-07-14 Thread balachmar
I get the following in the logs:
07-14 10:33:44.016: WARN/ActivityManager(78): Unable to launch app ...
for broadcast Intent { act=android.appwidget.action.APPWIDGET_ENABLED
cmp=... }: process is bad
07-14 10:33:44.026: WARN/ActivityManager(78): finishReceiver called
but none active
07-14 10:33:44.026: WARN/ActivityManager(78): Unable to launch app ...
for broadcast Intent { act=android.appwidget.action.APPWIDGET_UPDATE
cmp=... (has extras) }: process is bad
07-14 10:33:44.036: WARN/ActivityManager(78): finishReceiver called
but none active

I have seen quite a few threads here with the same problem, however,
none had a solution.
A reboot of the phone actually made it work without a problem. This
started after an update of the original widget was distributed through
the market.

Any ideas how to fix this?

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


[android-developers] Re: Android market hiding apps with bluetooth permissions from Android 1.5 and 1.6

2010-07-14 Thread Joe

I can see why Google wouldn't want to complicate the permissions for a
user. I am not suggesting they let the user choose which permissions
to allow. An obvious issue with doing that is that users could break
your app by crippling the permissions, and then complain it doesn't
work and give you a bad rating on the market. That is really a
separate topic/argument.

Any way back to my issue:

Apps are (or were) filtered from the market based on screen size and
android version.

They were not filtered based on permissions. It seems some confusion
has crept in. When i say in my app is android:minSdkVersion=3 - i
mean it :)

The bluetooth permissions have been around since the start, they are
nothing new.

This is obviously a mistake recently introduced on the Android
Market.

Anyone coding a bluetooth app should have made it backwards compatible
(as mine was) OR have set their minSdkVersion=5



On Jul 14, 10:39 am, DonFrench dcfre...@gmail.com wrote:
 Ok, I clicked the star and added my support.

 On Jul 13, 12:17 pm, Jonas Petersson jonas.peters...@xms.se wrote:



  On 07/13/2010 09:05 PM, DonFrench wrote:
     [Joe's app ]

   So Bluetooth is not necessary to benefit from using your app but those
   whose phones support it can reap the additional Bluetooth benefits
   that you so thoughtfully added, is that it?.   Since your app is still
   valuable even without Bluetooth functionality, people with pre-2.0
   phones should not be prohibited from purchasing it, right?   Well, you
   make a good point.

  IMHO, the above case is very similar to the enhancement request I added
  almost 6 months ago:

 http://code.google.com/p/android/issues/detail?id=6266

  Some permissions are non-critical for the application and it should be
  possible to flag them as such and then let the application find out
  whether it was given or not and adjust accordingly.

  So far only 51 people seem to have agreed with me, so either I'm wrong
  or most people have not realized why this would be significant enhancement.

                          Best / Jonas

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


[android-developers] Does anybody know why PackageManager.getApplicationIcon() doesn't work in Android 2.2 Froyo?

2010-07-14 Thread Alex Xin
Hi, all

We found that PackageManager.getApplicationIcon always return default app
icon in Android 2.2 Froyo. But works perfect in previous Android release
like 1.6/2.1

Does anybody knows why? Does Google change this API's behavior in 2.2?

Thanks!

Alex

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

[android-developers] Re: Camera capture without a preview...

2010-07-14 Thread String
I don't know definitively, but it's been said here before that this
isn't possible. The explanation was that it's a security measure, to
prevent the camera running without the user's knowledge - which makes
good sense.

String

On Jul 14, 4:40 am, ashughes ashug...@gmail.com wrote:
 I would also like to know how to do this. Have you figured it out?
 Does anyone know how to take a picture in the background (such as a
 service) without needing a preview?

 Thanks,
 Andrew

 On Jun 30, 12:04 am, SaiKiranVeluri saikiran.vel...@gmail.com wrote:



  Hi,

  Is it possible to capture an imagewithoutshowing the camerapreview?, i have 
  a requirement that i should be able to capture the
  image from a thread or from a service,withoutdisturbing the
  foreground application, where i do not want to show the camerapreview, but 
  still i want to capture the image in background and store
  it in the device.

  So is it possible to do using the Android 2.2 SDK version?

  Thanks in advance,

  Regards,
  Sai Kiran V.

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

2010-07-14 Thread String
What's xcode?

On Jul 13, 10:37 pm, rahul jain jainwolver...@gmail.com wrote:
 Hi there !,

 Whats the xcode equivalent for android ? ..like i would like to see
 crash viewer, log viewer and etc.

 Thanks.

 RJ

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


Re: [android-developers] Re: Android market hiding apps with bluetooth permissions from Android 1.5 and 1.6

2010-07-14 Thread Jonas Petersson


On 07/14/2010 10:54 AM, Joe wrote:

I can see why Google wouldn't want to complicate the permissions for a
user. I am not suggesting they let the user choose which permissions
to allow. An obvious issue with doing that is that users could break
your app by crippling the permissions, and then complain it doesn't
work and give you a bad rating on the market. That is really a
separate topic/argument.


I think you misunderstood what I asked for: what I'm after is that the 
DEVELOPER should have the ability to flag a particular permission as 
optional. Market can use this for filtering - in your case an optional 
BlueTooth permission would allow users with no bluetooth library 
(theoretically 1.x) to install the application. For a user who installs 
it on a device WITH bluetooth, the normal installation warning screen 
would allow that option to be deselected. The application will have to 
check whether it actually got the optional permission - if it doesn´t it 
deserves a bad rating.


Although this is not exactly your problem at the moment it certainly is 
closely related. IMHO.



Any way back to my issue:

Apps are (or were) filtered from the market based on screen size and
android version.

They were not filtered based on permissions.


I wouldn't place any bets on that one. I'm pretty sure that for instance 
the Barcode Scanner program is filtered out for devices that lack auto 
focus for instance. This may not exactly be permissions, but rather a 
device profile (I've noted that new/prerelease phones often see a lot 
less of the apps on Market), but exactly how it works may be something 
that we really shouldn't know too many details of since I would expect 
it to change (hopefully improve) over time.



It seems some confusion
has crept in. When i say in my app is android:minSdkVersion=3 - i
mean it :)

The bluetooth permissions have been around since the start, they are
nothing new.

This is obviously a mistake recently introduced on the Android
Market.

Anyone coding a bluetooth app should have made it backwards compatible
(as mine was) OR have set their minSdkVersion=5


Well, the good old Bluetooth File Transfer app seems to work. I've not 
got a 1.6 device handy, but the one installed on my Milestone has target 
sdk set to 4 and it asks for BT admin plus create BT connections.



On Jul 14, 10:39 am, DonFrenchdcfre...@gmail.com  wrote:

Ok, I clicked the star and added my support.


Excellent! Anyone else?

Best / Jonas

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

2010-07-14 Thread yuku
I tried:

long now = SystemClock.uptimeMillis();
lv.dispatchTouchEvent(MotionEvent.obtain(now, now,
MotionEvent.ACTION_DOWN, 10, 130, 0));
lv.dispatchTouchEvent(MotionEvent.obtain(now+1, now+1,
MotionEvent.ACTION_MOVE, 10, 10, 0));
lv.dispatchTouchEvent(MotionEvent.obtain(now+2, now+2,
MotionEvent.ACTION_UP, 10, 10, 0));

to scroll 120 pixels up, but nothing happened. Is it wrong?

The smoothScrollBy(int, int) sometimes work, sometimes don't. Strange.

On Jul 14, 3:34 pm, Ericson, Anders
anders.eric...@sonyericsson.com wrote:
 Hi,

 You can inject motion events to your ListView that corresponds to a 10 pixel 
 drag. Create an ACTION_DOWN event and then an ACTION_UP event 10 pixels apart 
 and then send them to the ListView using onTouchEvent(). You might need to 
 have a ACTION_MOVE event as well.

 /Anders



 -Original Message-
 From: android-developers@googlegroups.com 
 [mailto:android-develop...@googlegroups.com] On Behalf Of yuku
 Sent: den 14 juli 2010 08:12
 To: Android Developers
 Subject: [android-developers] Scrolling ListView manually by pixels

 Hi,

 I want to make use of the trackball or d-pad to scroll my ListView
 smoothly.
 Without implementing anything, by default the list scrolls by one
 item, which is not appropriate for my app, since list items have
 different heights and I just want to scroll it by a fixed amount.

 Is there anything to call to let's say, emulate a 10 pixel drag down?

 Thanks.
 Yuku

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

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


[android-developers] Re: Getting phone number from default SMS activity

2010-07-14 Thread Nishant
Hi,

You can use the following code:

Intent sendIntent= new Intent(Intent.ACTION_VIEW);
sendIntent.putExtra(sms_body, smsBody);
sendIntent.putExtra(address, phoneNumber1;phoneNumber2;...);
sendIntent.setType(vnd.android-dir/mms-sms);
startActivity(sendIntent);

Regards,
Nishant Shah

On Jul 14, 10:52 am, Amit amitmishr...@gmail.com wrote:
 Hi All,

 I have started the default SMS application and specified the SMS text
 to be sent through following code-

 intent = new Intent(Intent.ACTION_VIEW, Uri.parse(sms:));
 intent.putExtra(sms_body, SMS Text);
 startActivity(intent);

 It worked fine and sends the message to selected number from contact
 list.

 My requirement is that i want to know the number to which my SMS was
 sent?

 Please help me...its urgent.

 Thanks in advance.

 Amit

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


[android-developers] fmpeg using android-ndk

2010-07-14 Thread TeddybearCrisis
Hi Guys,

I followed this tutorial: 
http://slworkthings.wordpress.com/2010/02/23/ffmpeg-and-android-mk/
as it was referenced here:
http://groups.google.com/group/android-developers/browse_thread/thread/4a6de9f74238e16e/2d2a7cad0154a289?lnk=gstq=ffmpeg#2d2a7cad0154a289

Now I'm stuck in between .configure and make - maybe you can help me
out.

I created a modified configure script like this:


#!/bin/bash

NDK=/home/sgreve/Projekte/android-ndk-r4
PREBUILT=$NDK/build/prebuilt/linux-x86/arm-eabi-4.2.1
PROJHOME=pwd

./configure --target-os=linux \
--arch=armv41 \
--enable-cross-compile \
--cc=$PREBUILT/bin/arm-eabi-gcc \
--cross-prefix=$PREBUILT/bin/arm-eabi- \
--nm=$PREBUILT/bin/arm-eabi-nm \
--extra-cflags=-fPIC -DANDROID  \
--enable-static \
--disable-shared \
--disable-asm \
--disable-yasm \
--prefix=$PROJHOME \
--extra-ldflags=-Wl,-T,$PREBUILT/arm-eabi/lib/ldscripts/armelf.x -Wl,-
rpath-link=$NDK/build/platforms/android-3/arch-arm/usr/lib -L$NDK/
build/platforms/android-3/arch-arm/usr/lib -nostdlib $NDK/build/
prebuilt/linux-x86/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/crtbegin.o
$NDK/build/prebuilt/linux-x86/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/
crtend.o -lc -lm -ldl

# exclude all subdir.mak and config.mak includes
# in all the makefiles
for file in $(find . -name Makefile)
do
echo modifying $file
sed -i 's/include config.mak/#include config.mak/g' $file
sed -i 's/include config.mak/#include subdir.mak/g' $file
sed -i 's/##/#/g' $file
done

exit


From my point of view this scirpt does well as it finishes saying:

License: LGPL version 2.1 or later
Creating config.mak and config.h...
config.h is unchanged
libavutil/avconfig.h is unchanged
( ... + my modified output )


But when I then try to use ndk-build it says:

/home/sgreve/workspace/ffmpeg-android/jni/libavcodec/../av.mk:3: /home/
sgreve/workspace/ffmpeg-android/jni/libavcodec/../config-arm.mak: No
such file or directory
/home/sgreve/workspace/ffmpeg-android/jni/libavformat/../av.mk:3: /
home/sgreve/workspace/ffmpeg-android/jni/libavformat/../config-
arm.mak: No such file or directory
/home/sgreve/workspace/ffmpeg-android/jni/libavutil/../av.mk:3: /home/
sgreve/workspace/ffmpeg-android/jni/libavutil/../config-arm.mak: No
such file or directory
/home/sgreve/workspace/ffmpeg-android/jni/libpostproc/../av.mk:3: /
home/sgreve/workspace/ffmpeg-android/jni/libpostproc/../config-
arm.mak: No such file or directory
/home/sgreve/workspace/ffmpeg-android/jni/libswscale/../av.mk:3: /home/
sgreve/workspace/ffmpeg-android/jni/libswscale/../config-arm.mak: No
such file or directory
make: *** Keine Regel, um »/home/sgreve/workspace/ffmpeg-android/jni/
libswscale/../config-arm.mak« zu erstellen.  Schluss.


Which makes some kind of sense as there are no config-arm.mak files :)

The ffmpeg sources are stored in
EmptyEclipseProjectPath/jni/
and I call ndk-build from EmptyEclipseProjectPath

Maybe you can give me some hints
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] App Widget Updating Issue on 1.6 and 2.1?????

2010-07-14 Thread Gulfam
Hi All,

I have developed an app widget, on which i am displaying text which
i am getting from network.
I have set update time daily as android:updatePeriodMillis=8640,
my widget is updating properly on 1.5 sdk but not updating on 1.6 and
2.1, below is my code, please update me where am worng,

My Menifest Entries Below

 receiver android:name=.MainWidgetProvider android:label=@string/
app_name
intent-filter
action 
android:name=android.appwidget.action.APPWIDGET_UPDATE /

/intent-filter
meta-data android:name=android.appwidget.provider
   
android:resource=@xml/widget_provider
/
/receiver
activity android:name=.QuoteViewScreen
intent-filter
action
android:name=com.main.MainWidgetProvider.ACTION_WIDGET_CONFIGURE/
/intent-filter
/activity
service android:name=.MainWidgetProvider$UpdateWidgetService/
*
My Widget class where i am handling data

public static String ACTION_WIDGET_CONFIGURE = ConfigureWidget;
private static String currentQuoteId=0;
private static String imei=null;
private static String quoteDirection=;
public static RemoteViews remoteViews;

@Override
public void onUpdate(Context context, AppWidgetManager
appWidgetManager, int[] appWidgetIds) {

context.startService(new Intent(context,
UpdateWidgetService.class));
remoteViews = new RemoteViews(context.getPackageName(),
R.layout.widgetprovider_screen);
Intent mainQuoteViewIntent = new Intent(context,
QuoteViewScreen.class);
mainQuoteViewIntent.setAction(ACTION_WIDGET_CONFIGURE);
PendingIntent mainQuoteViewPendingIntent =
PendingIntent.getActivity(context, 0, mainQuoteViewIntent, 0);

remoteViews.setOnClickPendingIntent(R.id.widget_layout,
mainQuoteViewPendingIntent);
remoteViews.setOnClickPendingIntent(R.id.widget_logo,
mainQuoteViewPendingIntent);
remoteViews.setOnClickPendingIntent(R.id.widgetquote_textview,
mainQuoteViewPendingIntent);
remoteViews.setOnClickPendingIntent(R.id.seperator_line,
mainQuoteViewPendingIntent);

appWidgetManager.updateAppWidget(appWidgetIds, remoteViews);


}
@Override
public void onReceive(Context context, Intent intent) {
super.onReceive(context, intent);
}

public static class UpdateWidgetService extends IntentService {
QuoteObject quoteObject;
public UpdateWidgetService() {
super(MainWidgetProvider$UpdateWidgetService);
}

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

@Override
public void onHandleIntent(Intent intent) {
ComponentName me = new ComponentName(this,
MainWidgetProvider.class);
AppWidgetManager mgr = 
AppWidgetManager.getInstance(this);
mgr.updateAppWidget(me, updateWidget(this));
}

private RemoteViews updateWidget(Context context) {
imei = CQuoteUtility.getPhoneIMEI(context);
quoteObject = new QuoteObject();
getQuoteFromServer();
remoteViews.setTextViewText(R.id.widgetquote_textview,
\+quoteObject.getQuoteText()+\ +quoteObject.getQuoteAuthor());
setQuoteRatings(remoteViews, 
quoteObject.getQuoteRating());
currentQuoteId = quoteObject.getQid();
return(remoteViews);
}

}
}

Why its not updating on 1.6 and 2.1 but working fine on 1.5.

One more thing how can i set the time from out side this XML file
appwidget-provider  /. means how to set the time from setting as
updating time will be hourly, daily,
user can select any one from a UI,??

Thanks in advance,
Gulfam


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

2010-07-14 Thread TjerkW
Well it worked if i just did it from the AppWidgetProvider.onUpdate.
And this service i wrote uses the same approach as Jeff Sharkey
(Android Team Developer)
uses in his example Widget:

http://code.google.com/p/android-sky/source/browse/trunk/Sky/src/org/jsharkey/sky/UpdateService.java

So what am i doing wrong? Should i still submit it to a handler?
Can you explain me how todo that?

On Jul 14, 10:44 am, Kostya Vasilyev kmans...@gmail.com wrote:
 Are you calling updateAppWidget from the worker thread?

 If so, don't. UI calls can only be made from the UI thread.

 Use a Handler / Runnable to post data calculated by the worker thread to
 the UI thread and call updateAppWidget from there.

 -- Kostya

 14.07.2010 12:37, TjerkW пишет:





  Basically i have an AppWidgetProvider which starts a Service on
  update. That service starts a thread and at the end it updates the
  widget by calling AppWidgetManager.updateAppWidget.

  But i get a NullPointerException? What am i doing wrong? The Service
  is not in a different process..

  07-14 10:30:29.936: INFO/HyvesWidgetProvider(12077): updateAppWidget
  appWidgetId=63
  07-14 10:30:35.156: DEBUG/dalvikvm(12077): threadid=14: still
  suspended after undo (sc=1 dc=1 s=Y)
  07-14 10:30:35.156: DEBUG/dalvikvm(12077): GC_EXPLICIT freed 4078
  objects / 373584 bytes in 97ms
  07-14 10:30:36.711: WARN/dalvikvm(12077): threadid=14: thread exiting
  with uncaught exception (group=0x4001d7f0)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077): FATAL EXCEPTION:
  Thread-16
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):
  java.lang.NullPointerException
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  android.widget.RemoteViews
  $ReflectionAction.writeToParcel(RemoteViews.java:399)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  android.widget.RemoteViews.writeToParcel(RemoteViews.java:1003)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.android.internal.appwidget.IAppWidgetService$Stub
  $Proxy.updateAppWidgetIds(IAppWidgetService.java:374)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
  246)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
  265)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetProvider.updateAppWidget(HyvesWidgetPro 
  vider.java:
  75)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService.onUserInfoRetrieved(HyvesWidget 
  Service.java:
  162)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService.access
  $2(HyvesWidgetService.java:149)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService
  $2.onItemRetrieved(HyvesWidgetService.java:123)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService
  $2.onItemRetrieved(HyvesWidgetService.java:1)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.proxy.content.CachePolicyImpl.getItemById(CachePolicyImpl 
  .java:
  33)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.proxy.content.BaseSourcesInfo.getItemById(BaseSourcesInfo 
  .java:
  90)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService.onBuzzItemRetrieved(HyvesWidget 
  Service.java:
  120)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService.access
  $0(HyvesWidgetService.java:118)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService
  $1.onItemRetrieved(HyvesWidgetService.java:96)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService
  $1.onItemRetrieved(HyvesWidgetService.java:1)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.proxy.content.CachePolicyImpl.getItemByParentIdAndPositio 
  n(CachePolicyImpl.java:
  68)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.proxy.content.BaseSourcesInfo.getItemByParentIdAndPositio 
  n(BaseSourcesInfo.java:
  98)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService.onUpdate(HyvesWidgetService.jav 
  a:
  89)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService.run(HyvesWidgetService.java:
  83)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  java.lang.Thread.run(Thread.java:1096)

 --
 Kostya Vasilev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to 

[android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread TjerkW
B.t.w it worked fine on the Emulator intially (no widget where loaded
previously)

On Jul 14, 10:44 am, Kostya Vasilyev kmans...@gmail.com wrote:
 Are you calling updateAppWidget from the worker thread?

 If so, don't. UI calls can only be made from the UI thread.

 Use a Handler / Runnable to post data calculated by the worker thread to
 the UI thread and call updateAppWidget from there.

 -- Kostya

 14.07.2010 12:37, TjerkW пишет:





  Basically i have an AppWidgetProvider which starts a Service on
  update. That service starts a thread and at the end it updates the
  widget by calling AppWidgetManager.updateAppWidget.

  But i get a NullPointerException? What am i doing wrong? The Service
  is not in a different process..

  07-14 10:30:29.936: INFO/HyvesWidgetProvider(12077): updateAppWidget
  appWidgetId=63
  07-14 10:30:35.156: DEBUG/dalvikvm(12077): threadid=14: still
  suspended after undo (sc=1 dc=1 s=Y)
  07-14 10:30:35.156: DEBUG/dalvikvm(12077): GC_EXPLICIT freed 4078
  objects / 373584 bytes in 97ms
  07-14 10:30:36.711: WARN/dalvikvm(12077): threadid=14: thread exiting
  with uncaught exception (group=0x4001d7f0)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077): FATAL EXCEPTION:
  Thread-16
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):
  java.lang.NullPointerException
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  android.widget.RemoteViews
  $ReflectionAction.writeToParcel(RemoteViews.java:399)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  android.widget.RemoteViews.writeToParcel(RemoteViews.java:1003)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.android.internal.appwidget.IAppWidgetService$Stub
  $Proxy.updateAppWidgetIds(IAppWidgetService.java:374)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
  246)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
  265)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetProvider.updateAppWidget(HyvesWidgetPro 
  vider.java:
  75)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService.onUserInfoRetrieved(HyvesWidget 
  Service.java:
  162)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService.access
  $2(HyvesWidgetService.java:149)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService
  $2.onItemRetrieved(HyvesWidgetService.java:123)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService
  $2.onItemRetrieved(HyvesWidgetService.java:1)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.proxy.content.CachePolicyImpl.getItemById(CachePolicyImpl 
  .java:
  33)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.proxy.content.BaseSourcesInfo.getItemById(BaseSourcesInfo 
  .java:
  90)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService.onBuzzItemRetrieved(HyvesWidget 
  Service.java:
  120)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService.access
  $0(HyvesWidgetService.java:118)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService
  $1.onItemRetrieved(HyvesWidgetService.java:96)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService
  $1.onItemRetrieved(HyvesWidgetService.java:1)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.proxy.content.CachePolicyImpl.getItemByParentIdAndPositio 
  n(CachePolicyImpl.java:
  68)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.proxy.content.BaseSourcesInfo.getItemByParentIdAndPositio 
  n(BaseSourcesInfo.java:
  98)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService.onUpdate(HyvesWidgetService.jav 
  a:
  89)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  com.hyves.android.widget.HyvesWidgetService.run(HyvesWidgetService.java:
  83)
  07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
  java.lang.Thread.run(Thread.java:1096)

 --
 Kostya Vasilev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com

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


Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Kostya Vasilyev

But what about the thread?

14.07.2010 14:09, TjerkW пишет:

B.t.w it worked fine on the Emulator intially (no widget where loaded
previously)

On Jul 14, 10:44 am, Kostya Vasilyevkmans...@gmail.com  wrote:
   

Are you calling updateAppWidget from the worker thread?

If so, don't. UI calls can only be made from the UI thread.

Use a Handler / Runnable to post data calculated by the worker thread to
the UI thread and call updateAppWidget from there.

-- Kostya

14.07.2010 12:37, TjerkW пишет:





 

Basically i have an AppWidgetProvider which starts a Service on
update. That service starts a thread and at the end it updates the
widget by calling AppWidgetManager.updateAppWidget.
   
 

But i get a NullPointerException? What am i doing wrong? The Service
is not in a different process..
   
 

07-14 10:30:29.936: INFO/HyvesWidgetProvider(12077): updateAppWidget
appWidgetId=63
07-14 10:30:35.156: DEBUG/dalvikvm(12077): threadid=14: still
suspended after undo (sc=1 dc=1 s=Y)
07-14 10:30:35.156: DEBUG/dalvikvm(12077): GC_EXPLICIT freed 4078
objects / 373584 bytes in 97ms
07-14 10:30:36.711: WARN/dalvikvm(12077): threadid=14: thread exiting
with uncaught exception (group=0x4001d7f0)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): FATAL EXCEPTION:
Thread-16
07-14 10:30:36.796: ERROR/AndroidRuntime(12077):
java.lang.NullPointerException
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.widget.RemoteViews
$ReflectionAction.writeToParcel(RemoteViews.java:399)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.widget.RemoteViews.writeToParcel(RemoteViews.java:1003)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.android.internal.appwidget.IAppWidgetService$Stub
$Proxy.updateAppWidgetIds(IAppWidgetService.java:374)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
246)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
265)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetProvider.updateAppWidget(HyvesWidgetPro 
vider.java:
75)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.onUserInfoRetrieved(HyvesWidget 
Service.java:
162)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.access
$2(HyvesWidgetService.java:149)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService
$2.onItemRetrieved(HyvesWidgetService.java:123)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService
$2.onItemRetrieved(HyvesWidgetService.java:1)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.proxy.content.CachePolicyImpl.getItemById(CachePolicyImpl 
.java:
33)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.proxy.content.BaseSourcesInfo.getItemById(BaseSourcesInfo 
.java:
90)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.onBuzzItemRetrieved(HyvesWidget 
Service.java:
120)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.access
$0(HyvesWidgetService.java:118)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService
$1.onItemRetrieved(HyvesWidgetService.java:96)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService
$1.onItemRetrieved(HyvesWidgetService.java:1)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.proxy.content.CachePolicyImpl.getItemByParentIdAndPositio 
n(CachePolicyImpl.java:
68)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.proxy.content.BaseSourcesInfo.getItemByParentIdAndPositio 
n(BaseSourcesInfo.java:
98)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.onUpdate(HyvesWidgetService.jav a:
89)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.run(HyvesWidgetService.java:
83)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
java.lang.Thread.run(Thread.java:1096)
   

--
Kostya Vasilev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com
 
   



--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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


[android-developers] Re: Getting phone number from default SMS activity

2010-07-14 Thread Amit
Thanks Nishant,

I think you havn't got my question.

My question is that after the default SMS application has been
launched, user has entered the number and pressed the Send button.

After the message has been sent successfully, i want to know the
number that user has entered.

Regards
Amit

On Jul 14, 2:45 pm, Nishant nishant.s...@indianic.com wrote:
 Hi,

 You can use the following code:

 Intent sendIntent= new Intent(Intent.ACTION_VIEW);
 sendIntent.putExtra(sms_body, smsBody);
 sendIntent.putExtra(address, phoneNumber1;phoneNumber2;...);
 sendIntent.setType(vnd.android-dir/mms-sms);
 startActivity(sendIntent);

 Regards,
 Nishant Shah

 On Jul 14, 10:52 am, Amit amitmishr...@gmail.com wrote:



  Hi All,

  I have started the default SMS application and specified the SMS text
  to be sent through following code-

  intent = new Intent(Intent.ACTION_VIEW, Uri.parse(sms:));
  intent.putExtra(sms_body, SMS Text);
  startActivity(intent);

  It worked fine and sends the message to selected number from contact
  list.

  My requirement is that i want to know the number to which my SMS was
  sent?

  Please help me...its urgent.

  Thanks in advance.

  Amit

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

2010-07-14 Thread draf...@gmail.com
I am having some trouble with implementing my own observer in Java on
the Android platform.

I have created a class call NetworkPathJni that uses an Observer
interface class called NetworkPathJniObserver to notify other objects
of changes.

Here is the code for NetworkPathJni.java

---

public class NetworkPathJni {

NetworkPathJniObserver networkPathJniObserver;

  public NetworkPathJni(NetworkPathJniObserver aObserver){

networkPathJniObserver = aObserver;
Log.d(Phone, NetworkPathJni Created );

  }

  public void NetworkPathStateChanged(int aAvailabilityState){
  Log.d(Phone, NetworkPathStateChanged new state =  +
aAvailabilityState );
  TAvailabilityState availabilityState =
intToAvailability(aAvailabilityState);
  Log.d(Phone, Is SipNetworkPath alive? +
networkPathJniObserver.isAlive());
 
networkPathJniObserver.NetworkPathStateChanged(availabilityState);
  Log.d(Phone, NetworkPathStateChanged end );
  Log.d(Phone, Is SipNetworkPath alive? (2) +
networkPathJniObserver.isAlive());

  }

---

And here is the code for the observer

---

public interface NetworkPathJniObserver {

void NetworkPathStateChanged(TAvailabilityState aAvailabilityState);

boolean isAlive();
}

---

The observer is implemented as follows in a class called
SipNetworkPath

---

public class SipNetworkPath implements NetworkPathInterface,
NetworkPathJniObserver{

NetworkPathObserverInterface observer;
NetworkPathJni networkPathJni;

public SipNetworkPath(NetworkPathObserverInterface aObserver){
domainType = aDomainType;
observer = aObserver;
networkPathJni = new NetworkPathJni(this);
Log.d(Phone, SipNetworkPath created );
}

//NetworkPathJniObserver

@Override
public void NetworkPathStateChanged(TAvailabilityState
availabilityState) {
Log.d(SipNetworkPath, SipNetworkPath - Do networkpathstate
changed!);
}

@Override
public boolean isAlive() {
return true;

}

---

And SipNetworkPath is instanciated as follows

---

public class WifiNetworkPath extends SipNetworkPath{

public WifiNetworkPath(NetworkPathObserverInterface aObserver) {
super(aObserver);
}

---

The logging shows that both NetworkPathJni and SipNetworkPath get
created and that NetworkPathStateChanged(int aAvailabilityState) is
called.

Within that method all the logging comes back but the method does not
get called in the observer and I get false when I ask Is
SipNetworkPath alive? in the logging.

Is the observer class losing reference or something or is there a
mistake in my way of doing this? Does Android kill off objects that
are not part of an Activity or a Service instantly or something along
thoese lines that might be causing the problem?

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


Re: [android-developers] how to Change SMS Preference or setting

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 3:17 AM, Nandan . bhavesh2...@gmail.com wrote:
 in my application i m trying to change default android SMS Setting through
 programming.

What do you consider to be default android SMS Setting?

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

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

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


Re: [android-developers] Adding contact bug

2010-07-14 Thread Atul Raut
Hi Fina,

Yes it is  a bug.
We were resolving it will give you fix soon.

Regards
Atul

On Fri, Jun 25, 2010 at 6:59 AM, Fina Mesina fina.mes...@gmail.com wrote:

 Hello!

 Has anyone encountered an error adding a new contact from edit contact
 screen?

 I've encountered this in the emulator and I want to confirm if this is
 a bug or not.

 I've attached the logcat stacktrace.

 Thanks

 Fina

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

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

Re: [android-developers] AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 4:37 AM, TjerkW tje...@gmail.com wrote:
 Basically i have an AppWidgetProvider which starts a Service on
 update. That service starts a thread and at the end it updates the
 widget by calling AppWidgetManager.updateAppWidget.

Turn the Service into an IntentService, and get rid of your own
thread. IntentService gives you your work on a background thread
automatically. See:

http://github.com/commonsguy/cw-advandroid/tree/master/AppWidget/Microblog/

 But i get a NullPointerException? What am i doing wrong? The Service
 is not in a different process..

That is impossible to say without seeing your code.

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

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

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


Re: [android-developers] not able to compile code get from the git repository.

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 1:48 AM, kamiomar kamio...@gmail.com wrote:
 Can anybody tell why i am not able to compile the code get from the
 git repository. i think some libraries missing.

 Example:
  i get Email Client code from the git repository.
  http://android.git.kernel.org/platform/packages/apps/Email.git

 Import the project in my eclipse and set the android SDK version and
 then compile the code, its showing some errors.

 How can i resolve it.

You cannot compile individual applications out of the source code
repository, since they were not written to the SDK. You have to build
those applications as part of a firmware image.

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

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

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


Re: [android-developers] event of checkbox is selcted/unselected

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 4:03 AM, Narendra Bagade
bagadenaren...@gmail.com wrote:
 How do I listen to the event when a checkbox is selcted/unselected?

setOnCheckedChangeListener()

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

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

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


[android-developers] Re: Getting phone number from default SMS activity

2010-07-14 Thread Nishant
Hi,

Use startActivityForResult(intent, requestCode)
May be it will help you.

Regards,
Nishant Shah

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

2010-07-14 Thread TjerkW
Okay am i now using a IntentService without a thread


But now i get an ANR on a broadcast:

07-14 13:38:49.503: WARN/ActivityManager(59): Timeout of broadcast
BroadcastRecord{43f724c0 android.appwidget.action.APPWIDGET_ENABLED} -
receiver=android.os.binderpr...@43deed00
07-14 13:38:49.513: WARN/ActivityManager(59): Receiver during timeout:
ResolveInfo{43f72438 com.hyves.android.widget.HyvesWidgetProvider p=0
o=0 m=0x0}
07-14 13:38:49.523: INFO/Process(59): Sending signal. PID: 309 SIG: 3
07-14 13:38:49.523: INFO/dalvikvm(309): threadid=3: reacting to signal
3
07-14 13:38:49.732: INFO/dalvikvm(309): Wrote stack traces to '/data/
anr/traces.txt'
07-14 13:38:49.732: INFO/Process(59): Sending signal. PID: 59 SIG: 3
07-14 13:38:49.732: INFO/dalvikvm(59): threadid=3: reacting to signal
3
07-14 13:38:49.953: INFO/dalvikvm(59): Wrote stack traces to '/data/
anr/traces.txt'
07-14 13:38:49.953: INFO/Process(59): Sending signal. PID: 105 SIG: 3
07-14 13:38:49.953: INFO/dalvikvm(105): threadid=3: reacting to signal
3
07-14 13:38:50.013: INFO/dalvikvm(105): Wrote stack traces to '/data/
anr/traces.txt'
07-14 13:38:50.023: INFO/Process(59): Sending signal. PID: 116 SIG: 3
07-14 13:38:50.023: INFO/dalvikvm(116): threadid=3: reacting to signal
3
07-14 13:38:50.033: INFO/dalvikvm(116): Wrote stack traces to '/data/
anr/traces.txt'
07-14 13:38:50.043: INFO/Process(59): Sending signal. PID: 121 SIG: 3
07-14 13:38:50.043: INFO/dalvikvm(121): threadid=3: reacting to signal
3
07-14 13:38:50.073: INFO/dalvikvm(121): Wrote stack traces to '/data/
anr/traces.txt'
07-14 13:38:50.083: INFO/Process(59): Sending signal. PID: 295 SIG: 3
07-14 13:38:50.083: INFO/dalvikvm(295): threadid=3: reacting to signal
3
07-14 13:38:50.303: INFO/Process(59): Sending signal. PID: 219 SIG: 3
07-14 13:38:50.323: INFO/dalvikvm(219): threadid=3: reacting to signal
3
07-14 13:38:50.503: INFO/Process(59): Sending signal. PID: 171 SIG: 3
07-14 13:38:50.703: INFO/Process(59): Sending signal. PID: 238 SIG: 3
07-14 13:38:50.733: INFO/dalvikvm(238): threadid=3: reacting to signal
3
07-14 13:38:50.903: INFO/Process(59): Sending signal. PID: 260 SIG: 3
07-14 13:38:51.113: INFO/Process(59): Sending signal. PID: 272 SIG: 3
07-14 13:38:51.213: INFO/dalvikvm(272): threadid=3: reacting to signal
3
07-14 13:38:51.313: INFO/Process(59): Sending signal. PID: 203 SIG: 3
07-14 13:38:51.522: INFO/Process(59): Sending signal. PID: 194 SIG: 3
07-14 13:38:51.633: INFO/dalvikvm(194): threadid=3: reacting to signal
3
07-14 13:38:51.723: INFO/Process(59): Sending signal. PID: 248 SIG: 3
07-14 13:38:51.883: INFO/dalvikvm(248): threadid=3: reacting to signal
3
07-14 13:38:51.913: INFO/dalvikvm(171): threadid=3: reacting to signal
3
07-14 13:38:51.923: INFO/Process(59): Sending signal. PID: 110 SIG: 3
07-14 13:38:51.923: INFO/dalvikvm(110): threadid=3: reacting to signal
3
07-14 13:38:51.983: INFO/dalvikvm(110): Wrote stack traces to '/data/
anr/traces.txt'
07-14 13:38:51.993: INFO/Process(59): Sending signal. PID: 210 SIG: 3
07-14 13:38:52.053: DEBUG/dalvikvm(309): GC_FOR_MALLOC freed 4504
objects / 509560 bytes in 177ms
07-14 13:38:52.092: INFO/dalvikvm(210): threadid=3: reacting to signal
3
07-14 13:38:52.302: ERROR/ActivityManager(59): ANR in
com.hyves.android.application
07-14 13:38:52.302: ERROR/ActivityManager(59): Reason: Broadcast of
Intent { act=android.appwidget.action.APPWIDGET_ENABLED
cmp=com.hyves.android.application/
com.hyves.android.widget.HyvesWidgetProvider }
07-14 13:38:52.302: ERROR/ActivityManager(59): Load: 3.16 / 1.11 /
0.39
07-14 13:38:52.302: ERROR/ActivityManager(59): CPU usage from 17434ms
to 101ms ago:
07-14 13:38:52.302: ERROR/ActivityManager(59):   zygote: 77% = 75%
user + 2% kernel / faults: 2350 minor 56 major
07-14 13:38:52.302: ERROR/ActivityManager(59):   system_server: 11% =
9% user + 2% kernel / faults: 2144 minor 23 major
07-14 13:38:52.302: ERROR/ActivityManager(59):   ndroid.settings: 5% =
1% user + 3% kernel / faults: 4591 minor 111 major
07-14 13:38:52.302: ERROR/ActivityManager(59):   ndroid.launcher: 1% =
0% user + 1% kernel / faults: 1212 minor 11 major
07-14 13:38:52.302: ERROR/ActivityManager(59):   adbd: 0% = 0% user +
0% kernel / faults: 30 minor
07-14 13:38:52.302: ERROR/ActivityManager(59):   m.android.phone: 0% =
0% user + 0% kernel / faults: 315 minor
07-14 13:38:52.302: ERROR/ActivityManager(59):   putmethod.latin: 0% =
0% user + 0% kernel / faults: 245 minor 1 major
07-14 13:38:52.302: ERROR/ActivityManager(59):   logcat: 0% = 0% user
+ 0% kernel / faults: 57 minor
07-14 13:38:52.302: ERROR/ActivityManager(59):   com.svox.pico: 0% =
0% user + 0% kernel / faults: 192 minor
07-14 13:38:52.302: ERROR/ActivityManager(59):   e.process.gapps: 0% =
0% user + 0% kernel / faults: 54 minor
07-14 13:38:52.302: ERROR/ActivityManager(59):   roid.alarmclock: 0% =
0% user + 0% kernel / faults: 153 minor
07-14 13:38:52.302: ERROR/ActivityManager(59):   com.android.mms: 0% =
0% user + 0% kernel / faults: 148 minor
07-14 13:38:52.302: 

[android-developers] Is it possible to make an app choose a particular APN automatically?

2010-07-14 Thread GoatHunter
Is it possible to make an app choose a particular APN automatically?

Or at least direct the user to the APN selection screen?

Also I've been wondering, can an APN be used from any cell provider?
Let's say I have two providers: A and B, can I use APN-B within A ?

Thanks beforehand

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


Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 7:44 AM, TjerkW tje...@gmail.com wrote:
 07-14 13:38:49.503: WARN/ActivityManager(59): Timeout of broadcast
 BroadcastRecord{43f724c0 android.appwidget.action.APPWIDGET_ENABLED} -
 receiver=android.os.binderpr...@43deed00
 07-14 13:38:49.513: WARN/ActivityManager(59): Receiver during timeout:
 ResolveInfo{43f72438 com.hyves.android.widget.HyvesWidgetProvider p=0
 o=0 m=0x0}

   �...@override
    public void onUpdate(Context context, AppWidgetManager manager,
 int[] appWidgetIds) {
        log(onUpdate);
        // If no specific widgets requested, collect list of all
        if (appWidgetIds == null) {
            appWidgetIds = manager.getAppWidgetIds(
                    new ComponentName(context,
 HyvesWidgetProvider.class));
        }

        // Request update for these widgets and launch updater service
        HyvesWidgetService.requestUpdate(appWidgetIds);
        context.startService(new Intent(context,
 HyvesWidgetService.class));
    }

I have no idea what:

HyvesWidgetService.requestUpdate(appWidgetIds);

does, but that would seem to be taking too long.


 And code from the IntentService


    /**
     * Start this service, creating a background processing thread, if
 not
     * already running. If started with {...@link #ACTION_UPDATE_ALL},
 will
     * automatically add all widgets to the requested update queue.
     */
   �...@override
    protected void onHandleIntent(Intent intent) {
        // If requested, trigger update of all widgets
        if (ACTION_UPDATE_ALL.equals(intent.getAction())) {

            AppWidgetManager manager =
 AppWidgetManager.getInstance(this);
            Log.d(TAG, Requested UPDATE_ALL action);
            requestUpdate(manager.getAppWidgetIds(new
 ComponentName(this, HyvesWidgetProvider.class)));
        }

        onUpdate();
    }


 onUpdate calls an asynchronous api call, and a callback updates tthe
 widget.

Wait, whoa, what? You are already in a background thread. Is
onUpdate() forking yet another thread?

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

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

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


[android-developers] Re: HttpPost and byte[] on Android?

2010-07-14 Thread Dinesh Harjani

I believe this will be very helpful:
http://evgeny-goldin.com/blog/2010/05/01/uploading-files-multipart-post-apache/

Download the source for the FileUpload (it should contain the
MultiPartEntity) and add it to your project as a library. Then you can
add all the byte[] that you want, but remember to add these libraries
to your server as well or you won't be able to recover your data.

Thanks for reminding me about FileEntity, by the way.



On Jul 14, 9:15 am, Serdel adam.lichwierow...@gmail.com wrote:
 Hello,

 I am dealing with http post method on Android. I have successfully
 send simple string pairs using HttpClient and HttpPost class with the
 NameValuePair as entity. However now I want to send a simple array of
 bytes[]. Unfortunately the only entities I have found for the HttpPost
 class are the NameValuePair and FileEntity. However my byte[] is not
 from a file. Wirting it to a file and then sending by the FileEntity
 seems to be pointless and stupid. How can I send this array using
 default HttpClient and HttpPost class??

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

2010-07-14 Thread TjerkW
Request update is a very fast method

   /**
 * Request updates for the given widgets. Will only queue them up,
you are
 * still responsible for starting a processing thread if needed,
usually by
 * starting the parent service.
 */
public static void requestUpdate(int[] appWidgetIds) {
synchronized (lock) {
for (int appWidgetId : appWidgetIds) {
HyvesWidgetService.appWidgetIds.add(appWidgetId);
}
}
}


Yeah the onUpdate (may) fork antother thread.
I now solved it by waiting in the IntentService thread on an object
using a lock:

lock.wait();

and then if it is done i call lock.notify().

This should work i think... i'm trying it out right now.

On Jul 14, 2:00 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Wed, Jul 14, 2010 at 7:44 AM, TjerkW tje...@gmail.com wrote:
  07-14 13:38:49.503: WARN/ActivityManager(59): Timeout of broadcast
  BroadcastRecord{43f724c0 android.appwidget.action.APPWIDGET_ENABLED} -
  receiver=android.os.binderpr...@43deed00
  07-14 13:38:49.513: WARN/ActivityManager(59): Receiver during timeout:
  ResolveInfo{43f72438 com.hyves.android.widget.HyvesWidgetProvider p=0
  o=0 m=0x0}
    �...@override
     public void onUpdate(Context context, AppWidgetManager manager,
  int[] appWidgetIds) {
         log(onUpdate);
         // If no specific widgets requested, collect list of all
         if (appWidgetIds == null) {
             appWidgetIds = manager.getAppWidgetIds(
                     new ComponentName(context,
  HyvesWidgetProvider.class));
         }

         // Request update for these widgets and launch updater service
         HyvesWidgetService.requestUpdate(appWidgetIds);
         context.startService(new Intent(context,
  HyvesWidgetService.class));
     }

 I have no idea what:

 HyvesWidgetService.requestUpdate(appWidgetIds);

 does, but that would seem to be taking too long.







  And code from the IntentService

     /**
      * Start this service, creating a background processing thread, if
  not
      * already running. If started with {...@link #ACTION_UPDATE_ALL},
  will
      * automatically add all widgets to the requested update queue.
      */
    �...@override
     protected void onHandleIntent(Intent intent) {
         // If requested, trigger update of all widgets
         if (ACTION_UPDATE_ALL.equals(intent.getAction())) {

             AppWidgetManager manager =
  AppWidgetManager.getInstance(this);
             Log.d(TAG, Requested UPDATE_ALL action);
             requestUpdate(manager.getAppWidgetIds(new
  ComponentName(this, HyvesWidgetProvider.class)));
         }

         onUpdate();
     }

  onUpdate calls an asynchronous api call, and a callback updates tthe
  widget.

 Wait, whoa, what? You are already in a background thread. Is
 onUpdate() forking yet another thread?

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

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

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


[android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread TjerkW
Works on the emulator.. but on my nexus one i still get the nasty
nullpointerexception deep inside the Android apis


07-14 14:33:53.105: ERROR/HyvesWidgetService(13806): Failed updating
widget: 68, due to java.lang.NullPointerException
07-14 14:33:53.105: WARN/System.err(13806):
java.lang.NullPointerException
07-14 14:33:53.115: WARN/System.err(13806): at
android.widget.RemoteViews
$ReflectionAction.writeToParcel(RemoteViews.java:399)
07-14 14:33:53.115: WARN/System.err(13806): at
android.widget.RemoteViews.writeToParcel(RemoteViews.java:1003)
07-14 14:33:53.115: WARN/System.err(13806): at
com.android.internal.appwidget.IAppWidgetService$Stub
$Proxy.updateAppWidgetIds(IAppWidgetService.java:374)
07-14 14:33:53.125: WARN/System.err(13806): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
246)
07-14 14:33:53.125: WARN/System.err(13806): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
265)
07-14 14:33:53.125: WARN/System.err(13806): at
com.hyves.android.widget.HyvesWidgetProvider.updateAppWidget(HyvesWidgetProvider.java:
75)
07-14 14:33:53.135: WARN/System.err(13806): at
com.hyves.android.widget.HyvesWidgetService.onHandleIntent(HyvesWidgetService.java:
115)
07-14 14:33:53.135: WARN/System.err(13806): at
android.app.IntentService
$ServiceHandler.handleMessage(IntentService.java:59)
07-14 14:33:53.145: WARN/System.err(13806): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-14 14:33:53.145: WARN/System.err(13806): at
android.os.Looper.loop(Looper.java:123)


On Jul 14, 2:00 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Wed, Jul 14, 2010 at 7:44 AM, TjerkW tje...@gmail.com wrote:
  07-14 13:38:49.503: WARN/ActivityManager(59): Timeout of broadcast
  BroadcastRecord{43f724c0 android.appwidget.action.APPWIDGET_ENABLED} -
  receiver=android.os.binderpr...@43deed00
  07-14 13:38:49.513: WARN/ActivityManager(59): Receiver during timeout:
  ResolveInfo{43f72438 com.hyves.android.widget.HyvesWidgetProvider p=0
  o=0 m=0x0}
    �...@override
     public void onUpdate(Context context, AppWidgetManager manager,
  int[] appWidgetIds) {
         log(onUpdate);
         // If no specific widgets requested, collect list of all
         if (appWidgetIds == null) {
             appWidgetIds = manager.getAppWidgetIds(
                     new ComponentName(context,
  HyvesWidgetProvider.class));
         }

         // Request update for these widgets and launch updater service
         HyvesWidgetService.requestUpdate(appWidgetIds);
         context.startService(new Intent(context,
  HyvesWidgetService.class));
     }

 I have no idea what:

 HyvesWidgetService.requestUpdate(appWidgetIds);

 does, but that would seem to be taking too long.







  And code from the IntentService

     /**
      * Start this service, creating a background processing thread, if
  not
      * already running. If started with {...@link #ACTION_UPDATE_ALL},
  will
      * automatically add all widgets to the requested update queue.
      */
    �...@override
     protected void onHandleIntent(Intent intent) {
         // If requested, trigger update of all widgets
         if (ACTION_UPDATE_ALL.equals(intent.getAction())) {

             AppWidgetManager manager =
  AppWidgetManager.getInstance(this);
             Log.d(TAG, Requested UPDATE_ALL action);
             requestUpdate(manager.getAppWidgetIds(new
  ComponentName(this, HyvesWidgetProvider.class)));
         }

         onUpdate();
     }

  onUpdate calls an asynchronous api call, and a callback updates tthe
  widget.

 Wait, whoa, what? You are already in a background thread. Is
 onUpdate() forking yet another thread?

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

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

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


Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 8:35 AM, TjerkW tje...@gmail.com wrote:
 Works on the emulator.. but on my nexus one i still get the nasty
 nullpointerexception deep inside the Android apis

At this point, I am fairly lost with your code. I don't know why you
need onUpdate() to fork a thread. Make sure that you keep your code
that gets the AppWidgetManager, creates/populates the RemoteViews, and
calls updateAppWidget() all in a contiguous block of code, called on
one thread, and it should work fine (barring supplying null values to
methods on RemoteViews or something).

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

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

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


Re: [android-developers] Re: how to check if the current thread is in the ui thread?

2010-07-14 Thread TreKing
On Tue, Jul 13, 2010 at 9:58 PM, DanH danhi...@ieee.org wrote:

 You'd be amazed how many exceptions are thrown loading a single class.


At the risk of veering farther off-topic: care to elaborate on this?
Do you mean Android, Java, or code in general?

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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Fixing a performance issue on a financial calculator program

2010-07-14 Thread Connie
With Canvas if you have to create the table (in bit map form)
dynamically does that take a bunch of time?

Connie

On Jul 13, 8:50 pm, Zsolt Vasvari zvasv...@gmail.com wrote:
 In my app, in a generic report viewer, I just draw the lines on a
 Canvas.  It's very fast and lightweight.   If you send me an e-mail, I
 can send you my code.

 On Jul 14, 2:02 am, Mark Murphy mmur...@commonsware.com wrote:



  On Tue, Jul 13, 2010 at 1:21 PM, Connie Walsh

  connie.walshc...@gmail.com wrote:
   I am writing a financial calculator and part of my code is printing
   out an amortization table for 25 - 30 years. Some times there can be
   up to 2000 rows on the page. Here is my code to do this part:

  Ack!

   Should I try to add them as the person scrolls down?

  You should use a ListView. This will automatically handle scrolling,
  will let you recycle your rows to minimize memory consumption, will
  only process the rows presently visible to increase execution speed,
  etc.

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

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

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


[android-developers] Button pressed color

2010-07-14 Thread Ajay
Hi,
   Is there a way I could get the color that is used when a button is
pressed? I know that the button uses a default selector xml that
consists of the pressed image. But, I am having some custom buttons
for which I want it to be close to the default image used for pressed
state.

Thank you,
AJ

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

2010-07-14 Thread TreKing
On Tue, Jul 13, 2010 at 6:07 PM, Tommy droi...@gmail.com wrote:

 I would really like to get the same effect that the webview offers if i
 were to look at these image from a URL.


So just load the image in a WebView ... ?

Besides that, what are you setting your layout parameters in the image view
to?
What are you setting the scale
typehttp://developer.android.com/reference/android/widget/ImageView.html#setScaleType(android.widget.ImageView.ScaleType)to?

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

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

2010-07-14 Thread TjerkW
Okay i have that now and i still get the nullpointerexception on an
Nexus One.

I still use a separate thread because the client libray i use does a
asyncrhonous api call.
But i syncrhonize it by an object lock.

So it should work fine.. but it doesnt.

On Jul 14, 2:50 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Wed, Jul 14, 2010 at 8:35 AM, TjerkW tje...@gmail.com wrote:
  Works on the emulator.. but on my nexus one i still get the nasty
  nullpointerexception deep inside the Android apis

 At this point, I am fairly lost with your code. I don't know why you
 need onUpdate() to fork a thread. Make sure that you keep your code
 that gets the AppWidgetManager, creates/populates the RemoteViews, and
 calls updateAppWidget() all in a contiguous block of code, called on
 one thread, and it should work fine (barring supplying null values to
 methods on RemoteViews or something).

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

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

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


[android-developers] C2DM example ChromeToPhone, contents of dataMessagingToken.txt

2010-07-14 Thread Chister Nordvik
Hi.

I've been working/struggling with the C2DM examples to get them to
work in my setup. I have almost everything in place but I can't send
messages to the device because I haven't a  ClientLogin Auth token. In
the ChromeToPhone example this seems to be stored in
dataMessagingToken.txt.

It's been a long day struggling with this, so does anyone know how I
get the token to store in this file? Will this token never change so
it's safe to store it in a textfile?

-Christer

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


Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Kostya Vasilyev

From what thread are you ultimately calling

AppWidgetManager.updateAppWidget

?

It has to be the UI thread, I think you should check to make sure.

-- Kostya

14.07.2010 16:35, TjerkW пишет:

Works on the emulator.. but on my nexus one i still get the nasty
nullpointerexception deep inside the Android apis


07-14 14:33:53.105: ERROR/HyvesWidgetService(13806): Failed updating
widget: 68, due to java.lang.NullPointerException
07-14 14:33:53.105: WARN/System.err(13806):
java.lang.NullPointerException
07-14 14:33:53.115: WARN/System.err(13806): at
android.widget.RemoteViews
$ReflectionAction.writeToParcel(RemoteViews.java:399)
07-14 14:33:53.115: WARN/System.err(13806): at
android.widget.RemoteViews.writeToParcel(RemoteViews.java:1003)
07-14 14:33:53.115: WARN/System.err(13806): at
com.android.internal.appwidget.IAppWidgetService$Stub
$Proxy.updateAppWidgetIds(IAppWidgetService.java:374)
07-14 14:33:53.125: WARN/System.err(13806): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
246)
07-14 14:33:53.125: WARN/System.err(13806): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
265)
07-14 14:33:53.125: WARN/System.err(13806): at
com.hyves.android.widget.HyvesWidgetProvider.updateAppWidget(HyvesWidgetProvider.java:
75)
07-14 14:33:53.135: WARN/System.err(13806): at
com.hyves.android.widget.HyvesWidgetService.onHandleIntent(HyvesWidgetService.java:
115)
07-14 14:33:53.135: WARN/System.err(13806): at
android.app.IntentService
$ServiceHandler.handleMessage(IntentService.java:59)
07-14 14:33:53.145: WARN/System.err(13806): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-14 14:33:53.145: WARN/System.err(13806): at
android.os.Looper.loop(Looper.java:123)


On Jul 14, 2:00 pm, Mark Murphymmur...@commonsware.com  wrote:
   

On Wed, Jul 14, 2010 at 7:44 AM, TjerkWtje...@gmail.com  wrote:
 

07-14 13:38:49.503: WARN/ActivityManager(59): Timeout of broadcast
BroadcastRecord{43f724c0 android.appwidget.action.APPWIDGET_ENABLED} -
receiver=android.os.binderpr...@43deed00
07-14 13:38:49.513: WARN/ActivityManager(59): Receiver during timeout:
ResolveInfo{43f72438 com.hyves.android.widget.HyvesWidgetProvider p=0
o=0 m=0x0}
@Override
public void onUpdate(Context context, AppWidgetManager manager,
int[] appWidgetIds) {
log(onUpdate);
// If no specific widgets requested, collect list of all
if (appWidgetIds == null) {
appWidgetIds = manager.getAppWidgetIds(
new ComponentName(context,
HyvesWidgetProvider.class));
}
   
 

// Request update for these widgets and launch updater service
HyvesWidgetService.requestUpdate(appWidgetIds);
context.startService(new Intent(context,
HyvesWidgetService.class));
}
   

I have no idea what:

HyvesWidgetService.requestUpdate(appWidgetIds);

does, but that would seem to be taking too long.







 

And code from the IntentService
   
 

/**
 * Start this service, creating a background processing thread, if
not
 * already running. If started with {...@link #ACTION_UPDATE_ALL},
will
 * automatically add all widgets to the requested update queue.
 */
@Override
protected void onHandleIntent(Intent intent) {
// If requested, trigger update of all widgets
if (ACTION_UPDATE_ALL.equals(intent.getAction())) {
   
 

AppWidgetManager manager =
AppWidgetManager.getInstance(this);
Log.d(TAG, Requested UPDATE_ALL action);
requestUpdate(manager.getAppWidgetIds(new
ComponentName(this, HyvesWidgetProvider.class)));
}
   
 

onUpdate();
}
   
 

onUpdate calls an asynchronous api call, and a callback updates tthe
widget.
   

Wait, whoa, what? You are already in a background thread. Is
onUpdate() forking yet another thread?

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

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



--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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


Re: [android-developers] C2DM example ChromeToPhone, contents of dataMessagingToken.txt

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 8:57 AM, Chister Nordvik cnord...@gmail.com wrote:
 I've been working/struggling with the C2DM examples to get them to
 work in my setup. I have almost everything in place but I can't send
 messages to the device because I haven't a  ClientLogin Auth token. In
 the ChromeToPhone example this seems to be stored in
 dataMessagingToken.txt.

 It's been a long day struggling with this, so does anyone know how I
 get the token to store in this file?

I haven't tried getting Chrome2Phone working, but in general, I'd use
a text editor. :-)

Here's a curl script to get the token:

http://github.com/commonsguy/cw-advandroid/blob/master/Push/C2DM/auth.sh

(though you may need to change GOOGLE to HOSTED depending on what sort
of account you're using)

This will dump LID, SID, and Auth.

 Will this token never change so
 it's safe to store it in a textfile?

It should be good for a couple of weeks. Google is recommending that
you not store your account credentials on your server, but arrange to
update the Auth value by some other means. They will also send down a
replacement Auth value via a custom HTTP header if they think your
current one is getting stale.

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

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

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


Re: [android-developers] how to add fixed view to PreferenceActivity

2010-07-14 Thread TreKing
On Tue, Jul 13, 2010 at 7:46 PM, mkhwang middl...@gmail.com wrote:

 there is a PreferenceActivity that was aleady developped and is
 typecally like 'Settings' of android.


That's the way it should be, for most cases.


 by the way, the customer is requiring to change U/I like IPhone


Kindly remind the customer that Android is not the iPhone and that they look
and behave differently. If they want an app that looks like iPhone they can
make an iPhone app.


 but It's very difficult to add  fix two views in PreferenceActivity.
 do you have the solution?


Solution? No. Haven't bothered to change the PreferenceActivity to look like
iPhone because there's no point to that. However, I would assume that you
can get the PreferenceActivity's main layout and dynamically add any views
you wish just like any other view. I would start playing with that.

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

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

[android-developers] PopupWindow Does not show

2010-07-14 Thread Conny
Log.d(NameView, NameViewDropDown Clicked);
View nameDetailsView = inflate(context,
R.layout.nameDetailsPopup, null);
PopupWindow nameDetailsPopup = new 
PopupWindow(nameDetailsView);
nameDetailsPopup.setContentView(nameDetailsView);
TextView nameLongDescription = (TextView) 
nameDetailsView
.findViewById(R.id.nameLongDescription);
nameLongDescription.setText(DummyLongName);
TextView nameMerchantName = (TextView) nameDetailsView
.findViewById(R.id.nameMerchantName);
nameMerchantName.setText(DummyMiddleName);
TextView nameItemNumber = (TextView) nameDetailsView
.findViewById(R.id.nameItemNumber);
nameItemNumber.setText(DummySurName);
TextView nameSKU = (TextView) nameDetailsView
.findViewById(R.id.nameSKU);
nameSKU.setText(DummySKU);
TextView nameItemInfo = (TextView) nameDetailsView
.findViewById(R.id.nameItemInfo);
nameItemInfo.setText(DummyItemInfo);
//nameDetailsPopup.showAsDropDown(nameName);
nameDetailsPopup.setFocusable(true) ;

For some reason, its not showing up on the UI.

I intend to show this as a dropdown just below the button that drops
this down.

Siddharth

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

2010-07-14 Thread TreKing
On Tue, Jul 13, 2010 at 9:11 PM, XiaoDar darylpainb...@gmail.com wrote:

 i've been palying with facebok-android api for a few days now


You might be better served on a group or forum dedicated to the FaceBook
api.

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

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

Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 9:01 AM, Kostya Vasilyev kmans...@gmail.com wrote:
 From what thread are you ultimately calling

 AppWidgetManager.updateAppWidget

 ?

 It has to be the UI thread, I think you should check to make sure.

No, it doesn't. I have a few examples where updating the app widget
from any thread is fine, such as the one I linked to earlier:

http://github.com/commonsguy/cw-advandroid/tree/master/AppWidget/Microblog/

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

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

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


[android-developers] Re: C2DM example ChromeToPhone, contents of dataMessagingToken.txt

2010-07-14 Thread Chister Nordvik
 I haven't tried getting Chrome2Phone working, but in general, I'd use
 a text editor. :-)

Haven't thought of that!

 Here's a curl script to get the token:
 http://github.com/commonsguy/cw-advandroid/blob/master/Push/C2DM/auth.sh

Thanks!. You saved me a lot cursing at lacking documentation (or maybe
it's just me not finding it, same result)

  Will this token never change so
  it's safe to store it in a textfile?

 It should be good for a couple of weeks. Google is recommending that
 you not store your account credentials on your server, but arrange to
 update the Auth value by some other means. They will also send down a
 replacement Auth value via a custom HTTP header if they think your
 current one is getting stale.

I will find some way of updating this then. Shouldn't examples do this
the best practice way and not confuse people like me? :-)

Again, thanks a lot Mark. It's really great that you spend time
answering all kinds of questions on this forum.

-Christer

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

2010-07-14 Thread TjerkW
Im calling it from the IntentService onHandleIntent method which
should run in its own worker thread as the apidocs explain.

It works on the emulator.
However on the Nexus One i get the nullpointer exception on calling
manager.updateAppWidget ...
See the stacktrace in a previous post.

On Jul 14, 3:12 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Wed, Jul 14, 2010 at 9:01 AM, Kostya Vasilyev kmans...@gmail.com wrote:
  From what thread are you ultimately calling

  AppWidgetManager.updateAppWidget

  ?

  It has to be the UI thread, I think you should check to make sure.

 No, it doesn't. I have a few examples where updating the app widget
 from any thread is fine, such as the one I linked to earlier:

 http://github.com/commonsguy/cw-advandroid/tree/master/AppWidget/Micr...

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

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

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


Re: [android-developers] Re: C2DM example ChromeToPhone, contents of dataMessagingToken.txt

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 9:14 AM, Chister Nordvik cnord...@gmail.com wrote:
 Thanks!. You saved me a lot cursing at lacking documentation (or maybe
 it's just me not finding it, same result)

It's documented, but it's a general-purpose Google authentication
system, nothing much specific to C2DM other than the service name.

 Shouldn't examples do this
 the best practice way and not confuse people like me? :-)

Aw, that'd be *boring*! :-)

 Again, thanks a lot Mark. It's really great that you spend time
 answering all kinds of questions on this forum.

Happy to (try to) help!

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

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

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


[android-developers] Object reference changes value seemingly at random

2010-07-14 Thread Jonhoo
Hey hey!

I've just started developing my second Android application. It is
pretty straightforward, but useful nonetheless.
All it does is allow the user to record key-value pairs for later
reference (for things you can't be bothered to remember such as bank
account numbers, PGP fingerprints, etc..)

While doing this, however, I have been completely stumped by a bug..:
I'll try to explain as best I can.
My main, and only, activity extends ListActivity, and each element in
the list is a LinearLayout containing two TextViews, one with the key
and the other with the value.
The main class (Tuples) holds a pointer called activeElement, which
points to the latest element to have been either clicked or long
clicked.
--
lv.setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView? parent, View view, int
position, long id) {
Tuples.this.activeElement = (LinearLayout) view;
// More code...
--

Furthermore, I have three dialogs, one which shows details for a list
item when clicked, one which opens a simple select list of Edit or
Delete on long click, and finally, an edit dialog (which also serves
as a new element dialog).
At this point, the logic for editing things is very simple: When an
element is edited, its old row is deleted, and a new one is created
with the new values.

The code reads as follows (this is on the AlertDialog.Builder I use to
build the dialog in onCreateDialog):
--
.setPositiveButton(R.string.save, new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// Save!
AlertDialog ad = (AlertDialog) dialog;
EditText tk = (EditText) ad.findViewById(R.id.tuple_key);
EditText tv = (EditText) ad.findViewById(R.id.tuple_value);

// Delete old one
Tuples.this.deleteElement ( Tuples.this.activeElement );

// Add new one
Tuples.this.add ( tk.getText().toString(),
tv.getText().toString() );
}
})
--

Here comes the really weird part though - when I run the program,
everything works fine, except that on edit, it is not the element I
long click on that is deleted, but the last element in list?
I have put debugging statements all over the place, and it seems as
though it changes value just before the onClick on the dialog OK
button is clicked.
The variable is not changed anywhere in my code (I have put debugging
statements on all activeElement = statements), and at the end of
onPrepareDialog, activeElement points to the correct element.
Can anyone think of what might be causing this? I'll provide more code
if needed.

Hope for a helpful answer =)
Jon

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


Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Kostya Vasilyev

Mark,

AFAIK, all UI methods are supposed to be called from the UI thread, are 
widget calls an exception to this rule?


-- Kostya

14.07.2010 17:12, Mark Murphy пишет:

On Wed, Jul 14, 2010 at 9:01 AM, Kostya Vasilyevkmans...@gmail.com  wrote:
   

 From what thread are you ultimately calling

AppWidgetManager.updateAppWidget

?

It has to be the UI thread, I think you should check to make sure.
 

No, it doesn't. I have a few examples where updating the app widget
from any thread is fine, such as the one I linked to earlier:

http://github.com/commonsguy/cw-advandroid/tree/master/AppWidget/Microblog/

   



--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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


[android-developers] Re: problem accessing widget in Preference widgetLayout

2010-07-14 Thread GodsMoon
I think you need to do findPreference instead of findViewById.
so like:
ib = (Preference) findPreference(displayimagekey);

Hope that helps.


On Jun 1, 3:20 pm, Noah noah.belc...@gmail.com wrote:
 Did you ever get this resolved? I'm having the same problem.

 Thanks

 On Apr 18, 1:27 am, hacksoft hacks...@gmail.com wrote:



  Hi,

  I can't seem to get a handle to the embedded widget (via widgetLayout)
  in my preference.

  My Preference XML is:

  PreferenceScreen
          xmlns:android=http://schemas.android.com/apk/res/android;
          android:key=first_preferencescreen

                  EditTextPreference android:key=displayname
                                                  android:title=Display Name
                                                  android:summary=Choose a 
  display name /

           Preference android:id=@+id/displayimageview
                                          android:key=displayimagekey
                          android:title=Display Image
                          android:summary=Select Display Image
                          android:widgetLayout=@layout/displayimage
                           /

  /PreferenceScreen

  My widget XML is:

          LinearLayout xmlns:android=http://schemas.android.com/apk/res/
  android
                  android:layout_width=wrap_content
                  android:layout_height=wrap_content
                  android:orientation=horizontal
                  

          ImageButton android:id=@+id/displayimagebutton
                          android:layout_width=wrap_content
                          android:layout_height=wrap_content
                          android:padding=1dp
                  /

       /LinearLayout

  I'm trying to get a handle on the displayimagebutton to embed an
  ImageButton in a preference row.

  My java code is:
            View v1 = null;
            v1 = findViewById(R.layout.preferences);
            ImageButton ib = null;
            if (v1 == null)
                    Log.d(SUBSYSTEM_TAG, v1 = null);
            else
            {
                    ib = 
  (ImageButton)v1.findViewById(R.id.displayimagebutton);
            }

  I can't seem to get a view to the preferences I setup in
  preferences.xml.  in my OnCreate() I'm calling:
   addPreferencesFromResource(R.layout.preferences);

  and this seems to work fine since the preferences layout is
  represented on the screen.  However I can't get a View to this layout
  as my java code is trying above, so I can find the embedded widget.

  I've tried: v1 = findViewById(R.id.displayimageview);
  but that just returns null also.

  Any ideas on how I can get the ImageButton reference to my
  displayimagebutton?

  I'm really disappointed on the lack of an Android example for this.

  Thanks!

  John Roberts

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

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


Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 9:27 AM, Kostya Vasilyev kmans...@gmail.com wrote:
 AFAIK, all UI methods are supposed to be called from the UI thread, are
 widget calls an exception to this rule?

An app widget has nothing to do with the UI...from your application's
standpoint.

The home screen probably has to apply the RemoteViews commands on its
main application thread. When you call updateAppWidget(), all you are
doing is passing a data structure to the home screen application via
IPC, and that can happen from any thread you like.

On Wed, Jul 14, 2010 at 9:18 AM, TjerkW tje...@gmail.com wrote:
 Im calling it from the IntentService onHandleIntent method which
 should run in its own worker thread as the apidocs explain.

 It works on the emulator.
 However on the Nexus One i get the nullpointer exception on calling
 manager.updateAppWidget ...
 See the stacktrace in a previous post.

At this point, I am going to recommend you create a separate project,
implement a bog-simple app widget, get that working, and slowly start
introducing features until you get to your target. I have no other
advice on how to get your existing code base working. Sorry!

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

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

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


[android-developers] How to Change label of activity dynamically?

2010-07-14 Thread dilu
Hi,

When we create a new activity, in the Android.manifest file, we can
set some text for the activity's label. It looks like:

activity class=MyActivity android:label=Some text here!

Is there anyway to access that programatically and change it during
runtime?
Regards
Dileep

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

2010-07-14 Thread TreKing
On Tue, Jul 13, 2010 at 9:26 PM, Stephen Lebed srle...@gmail.com wrote:

 I've read that, in the past, people were having issues when the
 dev switched the copy protection setting from off to on.  Is this still
 an issue?


From off to on? Probably. From on to off? Not sure. I never bothered with
copy protection and am quite glad I didn't, but if it were me, I'd get rid
of it, deal with the issues, if any, and never look back. It will probably
be worth it in the long run, IMO.

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

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

2010-07-14 Thread TjerkW
Hmm yeah,.. im trying to make a simple widget now and adding more
stuff.

However maybe this output from LogCat also helps:


07-14 15:57:58.845: ERROR/ActivityManager(59): ANR in
com.hyves.android.application
07-14 15:57:58.845: ERROR/ActivityManager(59): Reason: Broadcast of
Intent { act=android.appwidget.action.APPWIDGET_UPDATE
cmp=com.hyves.android.application/
com.hyves.android.widget.HyvesWidgetProvider (has extras) }
07-14 15:57:58.845: ERROR/ActivityManager(59): Load: 2.37 / 0.97 /
0.49
07-14 15:57:58.845: ERROR/ActivityManager(59): CPU usage from 476365ms
to 80ms ago:
07-14 15:57:58.845: ERROR/ActivityManager(59):   system_server: 4% =
3% user + 0% kernel / faults: 14885 minor 282 major


On Jul 14, 3:27 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 Mark,

 AFAIK, all UI methods are supposed to be called from the UI thread, are
 widget calls an exception to this rule?

 -- Kostya

 14.07.2010 17:12, Mark Murphy пишет:





  On Wed, Jul 14, 2010 at 9:01 AM, Kostya Vasilyevkmans...@gmail.com  wrote:

   From what thread are you ultimately calling

  AppWidgetManager.updateAppWidget

  ?

  It has to be the UI thread, I think you should check to make sure.

  No, it doesn't. I have a few examples where updating the app widget
  from any thread is fine, such as the one I linked to earlier:

 http://github.com/commonsguy/cw-advandroid/tree/master/AppWidget/Micr...

 --
 Kostya Vasilev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com

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


Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Kostya Vasilyev
Right, actual views live in a separate process altogether and 
RemoteViews is marshalled to this process... That's understood.


But an AppWidgetProvider is a broadcast receiver, and its methods are 
called on a certain thread within the containing process. Is it safe to 
call updateAppWidget and other methods (such as getAppWidgetIds) from a 
different, arbitrary thread?


Or, this can be restated as: is AppWidgetManager thread-safe?

If so, is this by design, or is it not guaranteed and happens to work in 
some configurations and not in others?


-- Kostya

14.07.2010 17:41, Mark Murphy пишет:

On Wed, Jul 14, 2010 at 9:27 AM, Kostya Vasilyevkmans...@gmail.com  wrote:
   

  AFAIK, all UI methods are supposed to be called from the UI thread, are
  widget calls an exception to this rule?
 

An app widget has nothing to do with the UI...from your application's
standpoint.

The home screen probably has to apply the RemoteViews commands on its
main application thread. When you call updateAppWidget(), all you are
doing is passing a data structure to the home screen application via
IPC, and that can happen from any thread you like.
   



--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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


Re: [android-developers] why does AlarmManagerService.java call remove first in a set alarm?

2010-07-14 Thread Satya Komatineni
I would have probably seen that if the operation indicated by the
pendingintent is used as a key.

But I am saying an explicit removal of the alarm containing the
operation (pending intent).

See the code (little) below.

Moreover what one is doing is

alarms.put(at 11pm, foo)
alarms.put(at 12 pm, foo)

Conceptually I would have understood if I did

pendingintent.gooff(at 11);
pendingintent.gooff(at 12);

*** AlarmManagerService.java extract

160 public void setRepeating(int type, long triggerAtTime, long interval,
 161 PendingIntent operation) {
 162 if (operation == null) {
 163 Slog.w(TAG, set/setRepeating ignored because there
is no intent);
 164 return;
 165 }
 166 synchronized (mLock) {
 167 Alarm alarm = new Alarm();
 168 alarm.type = type;
 169 alarm.when = triggerAtTime;
 170 alarm.repeatInterval = interval;
 171 alarm.operation = operation;
 172
 173 // Remove this alarm if already scheduled.
 174 removeLocked(operation);
 175
 176 if (localLOGV) Slog.v(TAG, set:  + alarm);
 177
 178 int index = addAlarmLocked(alarm);
 179 if (index == 0) {
 180 setLocked(alarm);
 181 }
 182 }
 183 }


AlarmManagerService doest maintain separate 'alarm' objects with every
set even with the same equivalent intent. It then physically removes
one of the alarm objects that were scheduled earlier.

Is this to avoid a later confusion between two alarms with the same intent??

Anyway thanks for chiming in

Satya


On Wed, Jul 14, 2010 at 1:58 AM, Dianne Hackborn hack...@android.com wrote:
 If they are the same intent, they can not be uniquely distinguished, so the
 more recent one replaces the previous.
 It's like doing:
 HashMapString, Foo alarms;
 Foo foo1 = new Foo();
 Foo foo2 = new Foo();
 alarms.put(mything, foo1);
 alarms.put(mything, foo2);
 The second call replaces the value of the first.

 On Tue, Jul 13, 2010 at 8:04 PM, Satya Komatineni
 satya.komatin...@gmail.com wrote:

 It was a bit baffling (Probably there is a good reason, and it doesnt
 take much to baffle me)

 AlarmManager am;
 ...
 PendingIntent pi;


 am.set(pi, ...) at 11pm
 am.set(pi,...) at 2pm

 Same pending intent with the same intent and  request code, in
 otherwords they resolve to same intent on equals.

 Although I know what happens (being the latest one takes precedence),
 I would have expected my broadcast receiver to be called twice.

 I thought something funny is happening in the PendingIntent.

 However when I looked at the AlarmManagerService.java I have noticed
 that the set.. methods are calling a remove using the
 PendingIntent that is passed in, essentially cancelling the one
 before.

 Why is that??

 It is late, my head hurts, I am hoping someone will throw some light.

 Thanks a bunch
 Satya

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


Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 10:00 AM, TjerkW tje...@gmail.com wrote:
 Hmm yeah,.. im trying to make a simple widget now and adding more
 stuff.

 However maybe this output from LogCat also helps:


 07-14 15:57:58.845: ERROR/ActivityManager(59): ANR in
 com.hyves.android.application
 07-14 15:57:58.845: ERROR/ActivityManager(59): Reason: Broadcast of
 Intent { act=android.appwidget.action.APPWIDGET_UPDATE
 cmp=com.hyves.android.application/
 com.hyves.android.widget.HyvesWidgetProvider (has extras) }

This should only happen if onUpdate() of your AppWidgetProvider is
taking too long. This may be tied to some of the funky thread locking
you're trying to do.

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

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

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


[android-developers] Re: Button pressed color

2010-07-14 Thread String
On the default (Google) UI, the current pressed-button color is
#ffc700. But that is liable to change in the future, and is probably
already different on other, OEM-applied UIs. I got that number from
just sampling a screen capture; I couldn't find it anywhere in the
SDK.

String
On Jul 14, 1:52 pm, Ajay aja...@gmail.com wrote:
 Hi,
    Is there a way I could get the color that is used when a button is
 pressed? I know that the button uses a default selector xml that
 consists of the pressed image. But, I am having some custom buttons
 for which I want it to be close to the default image used for pressed
 state.

 Thank you,
 AJ

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


Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 10:04 AM, Kostya Vasilyev kmans...@gmail.com wrote:
 But an AppWidgetProvider is a broadcast receiver, and its methods are called
 on a certain thread within the containing process. Is it safe to call
 updateAppWidget and other methods (such as getAppWidgetIds) from a
 different, arbitrary thread?

 Or, this can be restated as: is AppWidgetManager thread-safe?

 If so, is this by design, or is it not guaranteed and happens to work in
 some configurations and not in others?

AppWidgetManager is merely a wrapper around an IPC call, if you look
at the source code, and similar constructs elsewhere in Android (most
*Manager classes) work fine from background threads.

So, AFAICT, it should be fine from a background thread. That being
said, I am not a Googler (nor do I play one on TV)...

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

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

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


Re: [android-developers] Where should I change a ListView's backing data from?

2010-07-14 Thread TreKing
On Tue, Jul 13, 2010 at 9:19 PM, CodeFusion cboots1...@gmail.com wrote:

 My question is where should my ClickEvent handlers for those buttons be?


You're probably looking for something more concrete than it depends and
it's up to you, but that's probably how it's going to go since there is no
context to the rest of your app and design.


 Should I put them right in my custom view code since I have all the
 information I need?


Sure, why not? If that's the easiest thing to do, just do it.


 Should I start an ASyncTask that deletes the item and updates the adapter
 data and calls onDataSetChanged() etc?


Are your operations taking that long? If not AsyncTask might be overkill ...


 Should all of this be bubbled up through events to my ListActivity?


Sounds needlessly complicated.


 I could probably make it work at any level, but at what level along this
 hierarchy (Activity ListView-Adapter-ListItemView) is the proper place to
 edit/delete backing data for the ListView?


Given that the adapter is responsible for the data supplied to the ListView,
I tend to give it more responsibility as far as adding / deleting / altering
said data. That way it can control refreshing itself as necessary and it
give other classes a simpler interface to deal with than, say, getting the
adapter, getting it's data, modifying it, then calling
notifyingDataSetChanged().

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

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

Re: [android-developers] How to Change label of activity dynamically?

2010-07-14 Thread Mark Murphy
setTitle()

On Wed, Jul 14, 2010 at 9:53 AM, dilu discover.dile...@gmail.com wrote:
 Hi,

 When we create a new activity, in the Android.manifest file, we can
 set some text for the activity's label. It looks like:

    activity class=MyActivity android:label=Some text here!

 Is there anyway to access that programatically and change it during
 runtime?
 Regards
 Dileep

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




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

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

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


[android-developers] Re: OpenGL ES libraries

2010-07-14 Thread Sundog
It's not a matter of mastery of the interface, it's a matter of
maximizing development time and effort, at least in my case. If you do
much OpenGL programming, you've built your own such support objects
and code just to avoid reinventing the wheel every time. That's more
what I was looking for, just more fleshed-out than I've done on my
own.

On Jul 14, 2:50 am, Indicator Veritatis mej1...@yahoo.com wrote:
 Most OpenGL programmers learned the C API before even thinking of
 doing it in Java, so there is not much demand for such a wrapper.

 On Jul 13, 7:23 am, Sundog sunns...@gmail.com wrote:

  I looked around for info on this in the group but couldn't find any...
  so far in my OpenGL programming I've just done everything directly,
  but I was curious if anyone had written any wrapper libraries for it
  besides min3d. Min3d is great (or is getting there) but it's GPL'd,
  making it unsuitable for a commercial product (if my understanding of
  the license is correct).

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


Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Tjerk Gmail
Aaah cool i didnt think of that problem!
On Jul 14, 2010, at 4:15 PM, Mark Murphy wrote:

 On Wed, Jul 14, 2010 at 10:00 AM, TjerkW tje...@gmail.com wrote:
 Hmm yeah,.. im trying to make a simple widget now and adding more
 stuff.
 
 However maybe this output from LogCat also helps:
 
 
 07-14 15:57:58.845: ERROR/ActivityManager(59): ANR in
 com.hyves.android.application
 07-14 15:57:58.845: ERROR/ActivityManager(59): Reason: Broadcast of
 Intent { act=android.appwidget.action.APPWIDGET_UPDATE
 cmp=com.hyves.android.application/
 com.hyves.android.widget.HyvesWidgetProvider (has extras) }
 
 This should only happen if onUpdate() of your AppWidgetProvider is
 taking too long. This may be tied to some of the funky thread locking
 you're trying to do.
 
 -- 
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy
 
 _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
 Available!
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

Tjerk Wolterink
T +31645300385
tje...@gmail.com
http://twitter.com/tjerkw
http://tjerkwolterink.hyves.nl



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


Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Kostya Vasilyev

... which is in turn caused by a crash:

07-14 10:30:36.796: ERROR/AndroidRuntime(12077): FATAL EXCEPTION:
Thread-16
07-14 10:30:36.796: ERROR/AndroidRuntime(12077):
java.lang.NullPointerException
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.widget.RemoteViews
$ReflectionAction.writeToParcel(RemoteViews.java:399)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.widget.RemoteViews.writeToParcel(RemoteViews.java:1003)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.android.internal.appwidget.IAppWidgetService$Stub
$Proxy.updateAppWidgetIds(IAppWidgetService.java:374)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
246)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
265)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetProvider.updateAppWidget(HyvesWidgetProvider.java:
75)

That is, updateAppWidget starts writing the RemoteViews object into a 
Parcel, and crashes. Obviously the onUpdate() never returns, thus the ANR.


This runs on a separate thread, as can be seen further in the stack trace:

07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.run(HyvesWidgetService.java:
83)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
java.lang.Thread.run(Thread.java:1096)


Either it's really a threading problem, or else some data related to 
RemoteViews is null (such as updateViews.setTextViewText(R.id.xxx, 
null), or even the RemoteViews object itself is null). The latter one 
should be easy to check by stepping through in the debugger.


-- Kostya

14.07.2010 18:28, Tjerk Gmail пишет:

Aaah cool i didnt think of that problem!
On Jul 14, 2010, at 4:15 PM, Mark Murphy wrote:

   

On Wed, Jul 14, 2010 at 10:00 AM, TjerkWtje...@gmail.com  wrote:
 

Hmm yeah,.. im trying to make a simple widget now and adding more
stuff.

However maybe this output from LogCat also helps:


07-14 15:57:58.845: ERROR/ActivityManager(59): ANR in
com.hyves.android.application
07-14 15:57:58.845: ERROR/ActivityManager(59): Reason: Broadcast of
Intent { act=android.appwidget.action.APPWIDGET_UPDATE
cmp=com.hyves.android.application/
com.hyves.android.widget.HyvesWidgetProvider (has extras) }
   

This should only happen if onUpdate() of your AppWidgetProvider is
taking too long. This may be tied to some of the funky thread locking
you're trying to do.

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

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

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

Tjerk Wolterink
T +31645300385
tje...@gmail.com
http://twitter.com/tjerkw
http://tjerkwolterink.hyves.nl



   



--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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


[android-developers] Re: Button pressed color

2010-07-14 Thread Ajay
Yes, the pressed images are already different with different OEM
applied UIs. Even I could not find it in SDK or some other posts...

Still looking out for an answer...

On Jul 14, 7:16 pm, String sterling.ud...@googlemail.com wrote:
 On the default (Google) UI, the current pressed-button color is
 #ffc700. But that is liable to change in the future, and is probably
 already different on other, OEM-applied UIs. I got that number from
 just sampling a screen capture; I couldn't find it anywhere in the
 SDK.

 String
 On Jul 14, 1:52 pm, Ajay aja...@gmail.com wrote:

  Hi,
     Is there a way I could get the color that is used when a button is
  pressed? I know that the button uses a default selector xml that
  consists of the pressed image. But, I am having some custom buttons
  for which I want it to be close to the default image used for pressed
  state.

  Thank you,
  AJ



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


Re: [android-developers] Gps issues in real phone

2010-07-14 Thread TreKing
On Wed, Jul 14, 2010 at 1:59 AM, arindam arindam2gh...@gmail.com wrote:

 In emulator its working with sending manually gps data but in real phonewhen 
 i installed it only showing the
 gps icon but no data is coming.


Go outside?

You are specifically requesting only GPS data, so it will only work when it
is available, which is usually outside in with an unobstructed view of the
sky. If you're testing this indoors, it probably won't work very well, if at
all.

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

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

Re: [android-developers] Re: xcode equivalent for android development

2010-07-14 Thread TreKing
On Wed, Jul 14, 2010 at 4:05 AM, String sterling.ud...@googlemail.comwrote:

 What's xcode?


xcode http://tinyurl.com/dyruxl

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

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

2010-07-14 Thread TreKing
On Wed, Jul 14, 2010 at 2:56 AM, Narendra Bagade
bagadenaren...@gmail.comwrote:

 I have put checkbox in listview and displaying on the screen.


OK


 can  anyone tell me how to get checkbox even when user click on checkboxof
 listview.


This makes no sense. Please clarify.

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

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

2010-07-14 Thread ydario
Hello Xavier,


 make sure you have the libs project in your library project (even if
 it's empty)

this fixed my ant builds from terminal, but not from Eclipse.
I have added my buildfiles to Ant eclipse page, but now clicking the
run button gives the same NullPointer problem.

Is there a way to fix this also for Eclipse?

thanks,

Yuri

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

2010-07-14 Thread Tina
Hi, all!
My application creates directory on SD card for syncronisation
purpose.
Tell me please, is there any way to delete this directory on
uninstall?
May be I could add some string to Manifest or catch uninstall event
or something else?

Any help will be very useful,
Tina

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

2010-07-14 Thread Open
I've started seeing reports like this too.  The screen dimming is the
only thing I can think of too, but the stack trace just isn't very
much in terms of debugging information.


On Jun 29, 7:13 am, GJTorikian gjtorik...@gmail.com wrote:
 Howdy—

 I'm getting crash reports from my app out in the wild. Problem is, I
 don't know what's causing it. The only place I'm using WebKit is when
 constructing an -in-app help browser. Here's the full stack trace:

 java.lang.NullPointerException
         at android.webkit.WebView.onWindowFocusChanged(WebView.java:4177)
         at android.view.View.dispatchWindowFocusChanged(View.java:3788)
         at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:
 658)
         at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:
 662)
         at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:
 662)
         at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:
 662)
         at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:
 662)
         at android.view.ViewRoot.handleMessage(ViewRoot.java:1921)
         at android.os.Handler.dispatchMessage(Handler.java:99)
         at android.os.Looper.loop(Looper.java:123)
         at android.app.ActivityThread.main(ActivityThread.java:4627)
         at java.lang.reflect.Method.invokeNative(Native Method)
         at java.lang.reflect.Method.invoke(Method.java:521)
         at com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:868)
         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
         at dalvik.system.NativeStart.main(Native Method)

 The help browser window takes the full screen, with a bar at the
 bottom for help and done buttons. The only way I can conceive of
 the help window losing focus is if someone clicks outside of the bar,
 or the screen dims. Will catching and throwing the NPE be sufficient
 for eliminating this error, or do I need to add some further metadata
 in the Android Manifest XML?

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


[android-developers] Apps with 1 million downloads

2010-07-14 Thread Neilz
Hi. I'd like to know how many apps there are on the market which have
exceeded the million download mark.

Is there any way to find out this information?

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: checkbox in listview

2010-07-14 Thread Narendra Bagade
can  anyone tell me how to get checkbox event when user click on checkbox of
listview.

On Wed, Jul 14, 2010 at 1:26 PM, Narendra Bagade
bagadenaren...@gmail.comwrote:

 Hi All,

 I have put checkbox in listview and displaying on the screen.

 can  anyone tell me how to get checkbox even when user click on checkbox of
 listview.

 Thanks in advance.

 .




-- 
Regards,

Narendra B
9422785229,
Nagpur.

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

2010-07-14 Thread jason.delport
Hi Group,

I have a problem with using ListView headers when scrolling with the
trackball.

I have replicated the problem by adding the below code to the List1
activity in the APIDemos (the top_story layout just wraps a TextView
in a LinearLayout).

LayoutInflater inflater = (LayoutInflater)
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v1 = inflater.inflate(R.layout.top_story, null);
getListView().addHeaderView(v1,null,false);

Basically the problem is that the entire header view changes size when
trying to drag it up in touch mode after you have scrolled down (far
enough to make the header disappear off screen) and then back up the
list with the trackball. This issue doesn't occur if you are only
using the list in touch mode.

Any advice or recommendations?

Thanks in advance.

Cheers,

Jason

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

2010-07-14 Thread TjerkW
Thanks... it was not a threading issue... i was calling

 views.setImageViewBitmap(R.id.profile_image, icon);

with a null icon Most stupid mistake ever.
But i think it would be better if android throws a better exception
with a clear message.

Anyways... solved!
And a lot learned today!

Thanks to you all!

On Jul 14, 4:46 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 ... which is in turn caused by a crash:

 07-14 10:30:36.796: ERROR/AndroidRuntime(12077): FATAL EXCEPTION:
 Thread-16
 07-14 10:30:36.796: ERROR/AndroidRuntime(12077):
 java.lang.NullPointerException
 07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
 android.widget.RemoteViews
 $ReflectionAction.writeToParcel(RemoteViews.java:399)
 07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
 android.widget.RemoteViews.writeToParcel(RemoteViews.java:1003)
 07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
 com.android.internal.appwidget.IAppWidgetService$Stub
 $Proxy.updateAppWidgetIds(IAppWidgetService.java:374)
 07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
 android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
 246)
 07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
 android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
 265)
 07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
 com.hyves.android.widget.HyvesWidgetProvider.updateAppWidget(HyvesWidgetPro 
 vider.java:
 75)

 That is, updateAppWidget starts writing the RemoteViews object into a
 Parcel, and crashes. Obviously the onUpdate() never returns, thus the ANR.

 This runs on a separate thread, as can be seen further in the stack trace:

 07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
 com.hyves.android.widget.HyvesWidgetService.run(HyvesWidgetService.java:
 83)
 07-14 10:30:36.796: ERROR/AndroidRuntime(12077):     at
 java.lang.Thread.run(Thread.java:1096)

 Either it's really a threading problem, or else some data related to
 RemoteViews is null (such as updateViews.setTextViewText(R.id.xxx,
 null), or even the RemoteViews object itself is null). The latter one
 should be easy to check by stepping through in the debugger.

 -- Kostya

 14.07.2010 18:28, Tjerk Gmail пишет:





  Aaah cool i didnt think of that problem!
  On Jul 14, 2010, at 4:15 PM, Mark Murphy wrote:

  On Wed, Jul 14, 2010 at 10:00 AM, TjerkWtje...@gmail.com  wrote:

  Hmm yeah,.. im trying to make a simple widget now and adding more
  stuff.

  However maybe this output from LogCat also helps:

  07-14 15:57:58.845: ERROR/ActivityManager(59): ANR in
  com.hyves.android.application
  07-14 15:57:58.845: ERROR/ActivityManager(59): Reason: Broadcast of
  Intent { act=android.appwidget.action.APPWIDGET_UPDATE
  cmp=com.hyves.android.application/
  com.hyves.android.widget.HyvesWidgetProvider (has extras) }

  This should only happen if onUpdate() of your AppWidgetProvider is
  taking too long. This may be tied to some of the funky thread locking
  you're trying to do.

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

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

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

  Tjerk Wolterink
  T +31645300385
  tje...@gmail.com
 http://twitter.com/tjerkw
 http://tjerkwolterink.hyves.nl

 --
 Kostya Vasilev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com

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


Re: [android-developers] Re: checkbox in listview

2010-07-14 Thread TreKing
On Wed, Jul 14, 2010 at 10:23 AM, Narendra Bagade
bagadenaren...@gmail.comwrote:

 can  anyone tell me how to get checkbox event when user click on checkbox
 of listview.


You already asked this and Mark already answered you.

On Wed, Jul 14, 2010 at 6:00 AM, Mark Murphy mmur...@commonsware.com
 wrote:

 On Wed, Jul 14, 2010 at 4:03 AM, Narendra Bagade
 bagadenaren...@gmail.com wrote:
  How do I listen to the event when a checkbox is selcted/unselected?

 setOnCheckedChangeListener()


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

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

2010-07-14 Thread TreKing
On Wed, Jul 14, 2010 at 10:19 AM, Neilz neilhorn...@gmail.com wrote:

 Is there any way to find out this information?


Using Google.com, which leads to this:
http://www.androlib.com/appstatsdownloads.aspx

http://www.androlib.com/appstatsdownloads.aspxThough the stats only are
for  250,000, which is presumably as high as the Market goes. That, or none
have hit the million mark yet, though I doubt that.

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

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

Re: [android-developers] How to delete directory from SD card on uninstall?

2010-07-14 Thread Mark Murphy
On Wed, Jul 14, 2010 at 11:14 AM, Tina tina...@gmail.com wrote:
 Hi, all!
 My application creates directory on SD card for syncronisation
 purpose.
 Tell me please, is there any way to delete this directory on
 uninstall?

In Android 2.2+, if you use getExternalFilesDir() or
getExternalCacheDir(), those directories will be removed when your app
is uninstalled.

 May be I could add some string to Manifest or catch uninstall event
 or something else?

There is no uninstall event that your app can catch, sorry.

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

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

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


[android-developers] Re: How can I find unneeded permission?

2010-07-14 Thread deg
You're right Dianne; I misspoke.

But it does require someone with a big enough itch to scratch;
either directly (someone supporting a large pool of apps) or
indirectly (someone with incentive to improve the development tool-
chain). I just meant Google as an example of the latter, but any
motivated tool hacker could do it.

I wish I could step in and say I'll do it since I'm being so noisy
about the need. But, unfortunately, neither my immediate need nor my
spare time are great enough to justify it.

David

On Jul 14, 3:29 am, Dianne Hackborn hack...@android.com wrote:
 On Tue, Jul 13, 2010 at 11:54 AM, deg d...@degel.com wrote:
  But, I do hope that some toolmeister inside Google sees this thread
  and picks up the gauntlet someday.

 You don't need Google to do such things.

 --
 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: Button pressed color

2010-07-14 Thread Matty
What are your custom buttons?  Why not make them extend the Button
class so you inherit the default behavior?  I have created some
default buttons, but I only did so to selectively override default
behavior.

Try inspecting (new Button(this)).getBackground();

and see if that helps you.





On Jul 14, 8:52 am, Ajay aja...@gmail.com wrote:
 Hi,
    Is there a way I could get the color that is used when a button is
 pressed? I know that the button uses a default selector xml that
 consists of the pressed image. But, I am having some custom buttons
 for which I want it to be close to the default image used for pressed
 state.

 Thank you,
 AJ

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


Re: [android-developers] Re: AppWidgetManager updateAppWidget throws NullPointerException

2010-07-14 Thread Kostya Vasilyev

It does -

07-14 10:30:36.796: ERROR/AndroidRuntime(12077):
java.lang.NullPointerException


How more specific can you get?

-- Kostya

14.07.2010 19:42, TjerkW пишет:

Thanks... it was not a threading issue... i was calling

  views.setImageViewBitmap(R.id.profile_image, icon);

with a null icon Most stupid mistake ever.
But i think it would be better if android throws a better exception
with a clear message.

Anyways... solved!
And a lot learned today!

Thanks to you all!

On Jul 14, 4:46 pm, Kostya Vasilyevkmans...@gmail.com  wrote:
   

... which is in turn caused by a crash:

07-14 10:30:36.796: ERROR/AndroidRuntime(12077): FATAL EXCEPTION:
Thread-16
07-14 10:30:36.796: ERROR/AndroidRuntime(12077):
java.lang.NullPointerException
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.widget.RemoteViews
$ReflectionAction.writeToParcel(RemoteViews.java:399)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.widget.RemoteViews.writeToParcel(RemoteViews.java:1003)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.android.internal.appwidget.IAppWidgetService$Stub
$Proxy.updateAppWidgetIds(IAppWidgetService.java:374)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
246)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:
265)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetProvider.updateAppWidget(HyvesWidgetPro 
vider.java:
75)

That is, updateAppWidget starts writing the RemoteViews object into a
Parcel, and crashes. Obviously the onUpdate() never returns, thus the ANR.

This runs on a separate thread, as can be seen further in the stack trace:

07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
com.hyves.android.widget.HyvesWidgetService.run(HyvesWidgetService.java:
83)
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
java.lang.Thread.run(Thread.java:1096)

Either it's really a threading problem, or else some data related to
RemoteViews is null (such as updateViews.setTextViewText(R.id.xxx,
null), or even the RemoteViews object itself is null). The latter one
should be easy to check by stepping through in the debugger.

-- Kostya

14.07.2010 18:28, Tjerk Gmail пишет:





 

Aaah cool i didnt think of that problem!
On Jul 14, 2010, at 4:15 PM, Mark Murphy wrote:
   
 

On Wed, Jul 14, 2010 at 10:00 AM, TjerkWtje...@gmail.comwrote:
 
 

Hmm yeah,.. im trying to make a simple widget now and adding more
stuff.
   
 

However maybe this output from LogCat also helps:
   
 

07-14 15:57:58.845: ERROR/ActivityManager(59): ANR in
com.hyves.android.application
07-14 15:57:58.845: ERROR/ActivityManager(59): Reason: Broadcast of
Intent { act=android.appwidget.action.APPWIDGET_UPDATE
cmp=com.hyves.android.application/
com.hyves.android.widget.HyvesWidgetProvider (has extras) }
   
 

This should only happen if onUpdate() of your AppWidgetProvider is
taking too long. This may be tied to some of the funky thread locking
you're trying to do.
 
 

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

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

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

Tjerk Wolterink
T +31645300385
tje...@gmail.com
http://twitter.com/tjerkw
http://tjerkwolterink.hyves.nl
   

--
Kostya Vasilev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com
 
   



--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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


[android-developers] Detecting button type of front nav keys

2010-07-14 Thread GodsMoon
I posted this on Stack Overflow and didn't get an answer. Anybody here
have an answer?

I would like to detect if the navigation keys of the front of the
phone (Home,Menu,Back,Search) are hard-keys (ex. G1) or soft-keys (ex.
Nexus One).

This api 
http://d.android.com/reference/android/content/res/Configuration.html#keyboard
gets close but is related to the keyboard and not the front facing
keys.

KeyEvent (http://d.android.com/reference/android/view/KeyEvent.html)
has a FLAG_VIRTUAL_HARD_KEY flag, I can only detect that after the key
is pressed. I'd like to find out what type of buttons the user has
without asking the user to press a key first.

I would have expected such an api to be under
http://d.android.com/reference/android/hardware/package-summary.html
but android.hardware has very little info about the actual hardware of
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


[android-developers] Re: Button pressed color

2010-07-14 Thread String
On Jul 14, 3:48 pm, Ajay aja...@gmail.com wrote:

 Yes, the pressed images are already different with different OEM
 applied UIs. Even I could not find it in SDK or some other posts...

OK, I wasn't sure of that - my devices are all stock Android. In which
case, you've answered your own question; there is no pressed color.
There are only pressed images, and they can use any background they
like: a solid color, a gradient, a pattern, whatever. I'd be extremely
surprised if there's any useful, general way to get a color value.

String

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


[android-developers] Re: xcode equivalent for android development

2010-07-14 Thread String
Sorry, forgot the sarcasm / tag. It just bugs me at some level that
iOS/OSX knowledge is assumed on an *Android* discussion group.

String

On Jul 14, 4:00 pm, TreKing treking...@gmail.com wrote:
 On Wed, Jul 14, 2010 at 4:05 AM, String sterling.ud...@googlemail.comwrote:

  What's xcode?

 xcode http://tinyurl.com/dyruxl

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

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


[android-developers] TelephonyManager.getLine1Number()

2010-07-14 Thread jotobjects
My colleague reports his G1 returns null from this call.  The emulator
returns some number (is it hardcoded?).  This post on StackOverflow
indicates that some (but not all) devices return the correct phone
number -

http://stackoverflow.com/questions/2443524/getline1number-return-null-but-not-always

 Is there any other and/or better way to get the phone number for the
device?

Does the device need to know its own number for sending SMS messages,
or is the sending number provided by the network carrier?

TIA if anyone has experience with this question

On Jul 13, 6:00 pm, jotobjects jotobje...@gmail.com wrote:
 Sorry to reply to my own posting.  I'm asking because my project is
 using the Telephony API getLine1Number() and I'm wondering if the
 telephone number is the same on all emulators or if it can be changed
 somehow for testing without getting the same number every time.
 Anybody have experience with that question?

 On Jul 12, 10:20 pm, jotobjects jotobje...@gmail.com wrote:

  In Settings it shows a phone number for the device when running the
  emulator.  It shows the same phone number with several different
  AVD's.  Is this number the same across all development systems (i.e.,
  is it hardcoded or random or...)?  Can it be set to some specific
  number and how to do that?

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


  1   2   3   >