[android-developers] Re: layout inflator

2010-11-08 Thread Lisa
hi Hendrik Greving, (^o^)/ sorry not very good English. m(u_u)m

maybe it would be good that instead of parent send null as a parameter
thus,

title = View.inflate(mContext, R.layout.main_settings_title, null);

sorry for my bad English. m(_ _)m

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 check whether table is existed or not in database?

2010-11-08 Thread pramod.deore
Hi, I want to know how to check whether certain table is existed or
not in a database?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 check whether table is existed or not in database?

2010-11-08 Thread Kumar Bibek
Run this query

SELECT name FROM sqlite_master
WHERE type='table'
ORDER BY name;


On Mon, Nov 8, 2010 at 2:42 PM, pramod.deore deore.pramo...@gmail.comwrote:

 Hi, I want to know how to check whether certain table is existed or
 not in a database?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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: USB Connection Check

2010-11-08 Thread FrankG
Hi Boardy,

I have my doubts that you will get it working in a portable way across
different mobiles.
The usb implementation will be to different. The newer phones will
provide additional
and complex usb mode ( multiple cdc+acm+ adb + ?, mtp , pictbridge ),
some will change
the usbmode on the fly ( load a driver from a automounted cdrom image
on the phone and switch
after installation in a complex usb mode ) .. and for this the
different manufacturers will adapt the kernel
to framework communication and add components to the framework.

In principle the new froyo vold listens  for a sysfs file /sys/
devices/virtual/switch/usb_mass_storage/state .
If their is the state online , then  the VolumeManager will send a
BroadCast-Message which is IMHO propagated
via the ServiceManager to the rest of the framework and the
MountService. The MountService will send a Notification which you
could catch .

Good luck !

  Frank

On 6 Nov., 21:30, Boardy board.christop...@gmail.com wrote:
 Hi all,

 I am currently looking into developing an application for the android
 platform. I was wondering if there was a way in order to perform an
 action when the phone is connected via usb. I want it to perform an
 action depending on the connection state, i.e. do action A if not
 connected to PC, do action B if connected to USB in charge mode, do
 action C if connected via USB Disk etc.

 Is this possible.

 Thank for your help

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


[android-developers] Re: gps is off even though location updates are requested

2010-11-08 Thread kamiseq
hi,
I did some research and I ve found out that the problem is with
orientation sensor and not with gps.
I also found http://code.google.com/p/android/issues/detail?id=3708
this and they shows some work arounds, can somebody tell me more about
this, has anyone experience with this issue??

Im working on 2.1 and I dont think I will get update to 2.2 soon

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


[android-developers] Re: gps is off even though location updates are requested

2010-11-08 Thread kamiseq
one more link 
https://sites.google.com/a/bug-br.org.br/android/technical-documents/sensors-and-standby-mode

just in case it may help anyone

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


[android-developers] Account Sync Exception ...

2010-11-08 Thread GPU
Hi ,

I am getting Null pointer Exception from the SyncStorageEngine.

Version : Donut

The below are the authority lists before account updation.(Youtube
accountis different)

 accountName = [to...@googlemail.com], authorityName = [gmail-ls]
 accountName = [to...@googlemail.com], authorityName = [calendar]
accountName = [to...@googlemail.com], authorityName = [contacts]
 accountName = [to...@googlemail.com], authorityName =
[subscribedfeeds]
 accountName = [tom1...@youtube.com], authorityName = [contacts]
 accountName = [to...@googlemail.com], authorityName =
[com.pants.android.rss.sc.lite.RSSItem]

This is the exception trace from log-cat,

W/dalvikvm( 1235): threadid=87: thread exiting with uncaught exception
(group=0x2aac9a08)
E/AndroidRuntime( 1235): Uncaught handler: thread Thread-44 exiting
due to uncaught exception
E/AndroidRuntime( 1235): *** EXCEPTION IN SYSTEM PROCESS.  System will
crash.
D/MountListener( 1235): handleEvent volume_mounted:/sdcard
E/AndroidRuntime( 1235): java.lang.NullPointerException at
android.content.SyncStorageEngine.writeAccountInfoLocked(SyncStorageEngine.java:
1226)
E/AndroidRuntime( 1235):  at
android.content.SyncStorageEngine.doDatabaseCleanup(SyncStorageEngine.java:
627)
E/AndroidRuntime( 1235):  at android.content.SyncManager
$5.onAccountsUpdated(SyncManager.java:316)
E/AndroidRuntime( 1235):  at android.accounts.AccountMonitor
$AccountUpdater.run(AccountMonitor.java:82)

As per my source the writeAccountInfoLocked() at line no 1226 is

 out.attribute(null, id, Integer.toString(authority.ident));

So it should be the authority is Null.

Please tell me why this exception is coming?...Only in some devices
this happening  this crashing the system server.

As per my analysis :
When boot time the accounts will be updated from
GoogleLoginService ,and the accounts will be sync with the sync.xml,by
writeAccountInfoLocked().

somthing wrong in the below code!!!? in
SyncStorageEngine.writeAccountInfoLocked()
final int N = mAuthorities.size();
for (int i=0; iN; i++) {
AuthorityInfo authority = mAuthorities.get(i);//Is
it right? The key vaules are 0.N ,but the
//doDatabaseCleanup() mAuthorities removal based on checking the
Accountinfo.ident,

What happen if any authority removed in between 0...N ,by
doDatabaseCleanup().



Thanks  Regards
Rajesh Gopu

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


[android-developers] Re: Custom checkable view

2010-11-08 Thread Marc Poppleton
Ok, problem solved after having looked at the source of the
CheckedTextView. I had to override the onCreateDrawableState and
drawableStateChanged methods and it now works.

On 5 nov, 15:30, Marc Poppleton marc.popple...@gmail.com wrote:
 Hi there,

 I'm writing a little custom view which can be in two states : checked,
 not checked. According to the state it is in, it's background changes.
 Quite straightforward sort of behavior.
 My class extends FrameLayout and implements the Checkable interface.
 In my toogle method I just calls the setChecked method with a boolean
 corresponding to the new state. My setChecked method simply sets a
 mChecked boolean and calls the refreshDrawableState method. Pressing
 the view should then toggle it back and forth between the states
 check, unchecked.
 The background of the FrameLayout is given a StateListDrawable in
 which I've defined a drawable item for the following states :
 state_pressed, state_focused, state_checked=true, state_checked=false.
 When I press my custom view, the background changes all right back and
 forth between the state_pressed=true and state_checked=false items.
 But state_checked=true is never called.

 What am I doing wrong?

 Thank you for your help,

 Marc

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 check whether table is existed or not in database?

2010-11-08 Thread pramod.deore
Hi Bibek, Once again Thanks.
I had tried that as
 final  String ALL_TABLES = SELECT name FROM  +
sqlite_master WHERE type='table' ORDER BY name;

 Cursor cur = sampleDB.rawQuery(ALL_TABLES, null);

But now I don't understand how to retrieve the name of tables from
cursor.


On Nov 8, 2:34 pm, Kumar Bibek coomar@gmail.com wrote:
 Run this query

 SELECT name FROM sqlite_master
 WHERE type='table'
 ORDER BY name;

 On Mon, Nov 8, 2010 at 2:42 PM, pramod.deore deore.pramo...@gmail.comwrote:

  Hi, I want to know how to check whether certain table is existed or
  not in a database?

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  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

 --
 Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.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] layout inflator

2010-11-08 Thread Daniel Drozdzewski
Hendrik,

You should not return null out of getView.
Try finding out more info, how view recycling works in ListViews.

The right answer will depend on many details of your design.

My attempt:

In the default case (in your scenario it is everything else than view
at position 0), simply return convertView, ONLY WHEN each view in your
list is exactly the same and the contenst of all items exactly are the
same OR when you are 100% sure that you are NEVER going to recycle any
views (no view will ever too high or too low to get displayed), which
is VERY hard to be sure of.

If your list is something like:

0: TITLE
1: Item 1
2: Item 2
...

i.e. each list item has a different content, then you have to do a bit
more work in your getView(). You have to populate the view behind each
item with information specific for this view at this particular
position.

Other things to look at:
- if your items are static throughout the life of the application and
there are not too many of them, try using ScrollView.
- have a look at ListView.addHeaderView(View) method to add item(s)
with different view than the most of the items of the ListView.

Daniel





On Sun, Nov 7, 2010 at 9:57 PM, Hendrik Greving fourhend...@gmail.com wrote:
 I am implementing a ListAdapter and in getView, I am returning

 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
     switch (position) {
     case 0:
         if (title == null) {
             title = View.inflate(mContext, R.layout.main_settings_title,
 parent);
         }
         return title;
     }
     return null;
 }

 inflate is throwing a UnsupportedOperationException

 The resource is posted below. What am I doing wrong?

 ?
 xml version=1.0 encoding=utf-8?
 
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_width=fill_parent
 android:layout_height=fill_parent
 TextView android:id=@+id/menutitle
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:background=#44
 android:gravity=center_horizontal|top
 android:text=Settings
 android:textColor=#ee
 android:textStyle=bold
 android:shadowColor=#00
 android:shadowRadius=3.
 android:shadowDx=3.0
 android:shadowDy=3.0
 android:textSize=7pt
 android:paddingBottom=20dip
 android:paddingTop=20dip/
 /
 LinearLayout

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



-- 
Daniel Drozdzewski

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


[android-developers] want to align an image button bottom right

2010-11-08 Thread Alok Upadhyay
Hii,
  how to align an imagebutton bottom right.My code is as follows:

FrameLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent
android:gravity=center_horizontal
android:background=@drawable/help

ImageButton
android:id=@+id/done android:src=@drawable/btn_done
android:layout_width=wrap_content
android:layout_height=wrap_content android:layout_gravity=bottom
/

i am getting my image left side in the bottom but i want the
imagebutton right at the bottom!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ListView.setOnItemClickListener() fails to catch selection events for custom list items

2010-11-08 Thread Filip Havlicek
Hi Bob,

could you separate your problem from the rest of your project and send a new
project to us demonstrating the problem? It's getting kinda hard to look at
the code from the little snippets you are posting.

Best regards,
Filip Havlicek

2010/11/7 FractalBob ruom...@gmail.com

 I did; it didn't help.

 I also went back and changed my code a little bit:

 public class NewsChannel implements OnClickListener, OnKeyListener {
  .
  .
  .

  news_channel_text =
 (TextView)news_content.findViewById(R.id.news_channel_text);
  news_channel_text.setOnClickListener(this);
  news_channel_text.setOnKeyListener(this);
  .
  .
  .
public void onClick(View v)
{
log.debug(Click event);
}

public boolean onKey (View v, int keyCode, KeyEvent event)
{
log.debug(onKey);
return true;
}
 }

 and set breakpoints in each listener. The breakpoint gets hit in
 onCLick() (as it always had), but never in onKey(), even if I unset
 the OnClickListener.

 I've been struggling with this problem for nearly a week now and it's
 driving me nuts.



 On Nov 4, 3:03 pm, Filip Havlicek havlicek.fi...@gmail.com wrote:
  Try removing the listener from TextView(s) and see if that makes any
  difference.
 
  2010/11/4 FractalBob ruom...@gmail.com
 
 
 
 
 
 
 
   However, I don't implement any interfaces; is the the problem? If so,
   what should I implement?
 
   On Nov 4, 11:09 am, Kumar Bibek coomar@gmail.com wrote:
Have you set your list items to be focussable? Mean are some of your
   views
in your item layout focussable?
 
On 04-Nov-2010 11:35 PM, FractalBob ruom...@gmail.com wrote:
 
I think the reason it's still not working is because I'm not sure
 what
interface onListItemClick implements, so I tried
 
public class NewsListActivity extends ListActivity implements
OnClickListener
 
and I implemented onClick, to no avail.
 
Anyone know what I should specify for implements?
 
On Nov 4, 6:29 am, FractalBob ruom...@gmail.com wrote:
 
 Thanks for your suggestion, Filip. I a...
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   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.comandroid-developers%2Bunsubs
 cr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

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


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

[android-developers] Protecting service from getting killed.

2010-11-08 Thread Raj
Hi All,
I have a service in my application, that keeps running in the device
to interact with our server.
I found that there are certain application available in Android Market
app, that can kill the services running in a given application.

Is there any way to protect our service getting killed by the 3rd
party applications? This can be certainly done if we run the
application as a system process. But is it possible while running
under dalvik?

Regards,
Rajan

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

2010-11-08 Thread Kumar Bibek
As of now there is no way of preventing that. But, as far as I have heard
and read, future OS versions would disable this feature wherein 3rd party
apps can kill other services.

On Mon, Nov 8, 2010 at 4:57 PM, Raj lal.ra...@gmail.com wrote:

 Hi All,
 I have a service in my application, that keeps running in the device
 to interact with our server.
 I found that there are certain application available in Android Market
 app, that can kill the services running in a given application.

 Is there any way to protect our service getting killed by the 3rd
 party applications? This can be certainly done if we run the
 application as a system process. But is it possible while running
 under dalvik?

 Regards,
 Rajan

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] Protecting service from getting killed.

2010-11-08 Thread Daniel Drozdzewski
On Mon, Nov 8, 2010 at 11:27 AM, Raj lal.ra...@gmail.com wrote:
 Hi All,
 I have a service in my application, that keeps running in the device
 to interact with our server.
 I found that there are certain application available in Android Market
 app, that can kill the services running in a given application.

 Is there any way to protect our service getting killed by the 3rd
 party applications? This can be certainly done if we run the
 application as a system process. But is it possible while running
 under dalvik?

 Regards,
 Rajan


Rajan,

You should make you service deal with kills rather than making it kill-proof.
Better still, try running your service as a timer triggered polling
simple 1 pass at the time rather than making it bullet proof.

Imagine few applications like yours running on the phone.

Daniel

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


[android-developers] Launch twitter Homepage

2010-11-08 Thread Babita kumari
Hi Developers,

I want to launch Twitter in my application . I want to know that, Is it
possible to launch twitter in my app using any API?
If it's possible , please post the code snippet.
I should be able to see the real twitter home page( not directly invoking
the url).

please reply soon , its very very urgent.

Thanks

Babita

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

2010-11-08 Thread Sarwar Erfan
puty try catch around

ImageButton o1 = (ImageButton) findViewById(R.id.next);
o1.setOnClickListener(this);

R.id.next : is it really an ImageButton?

You have got ClassCastException.

Regards
Sarwar Erfan




On Nov 8, 1:27 pm, Alok Upadhyay maddy.luck...@gmail.com wrote:
 i have two class as trial.java and ImageWoLab0.java(Image without
 lable 0).When i run my application i am getting error as : The
 application has stopped unexpectedly!!

 public void onClick(View v)
 {
     switch (v.getId())
     {
     case R.id.btnSequence:
         Intent intent1 = new Intent();
         intent1.setClass(this,ImageWoLab0.class);       /*To open new
 Screen/Activity */
                                                                             /
 *Passing a key/value(Condition) to Activity2.class*/
         startActivity(intent1);                     /*open the new
 screen/Activity*/
         break;

     case R.id.btnVideo:
         Intent intent2 = new Intent();
         intent2.setClass(this,Activity2.class);
         intent2.putExtra(String_key, value1);
         startActivity(intent2);
         break;

     case R.id.btnInfo:
         Intent intent3 = new Intent();
         intent3.setClass(this,Activity2.class);

         intent3.putExtra(String_key, value2);
         startActivity(intent3);
         break;
     }
 othar class as:

 public class ImageWoLab0 extends Activity implements OnClickListener
 { private static String TAG = tag;

 @Override
 public void onCreate(Bundle savedInstanceState)
 {
     Log.i(TAG, abc);
     super.onCreate(savedInstanceState);
     setContentView(R.layout.image0);
     ImageButton o1 = (ImageButton) findViewById(R.id.next);
     o1.setOnClickListener(this);

 }

 @Override
 public void onClick(View v)
 {
     switch (v.getId())
     {
     case R.id.next:
         Intent intent1 = new Intent();
         intent1.setClass(this,ImageWoLab1.class);
         startActivity(intent1);
         break;

     }

 }
 }

 i have check image in drawable folder,manifest file(activity
 entry),layout file properly.i have clean again and again even rebuild
 again still the same messageis displaying.i am getting log as:sorry if
 i have not send log in right format(first time i am using logcat):

 11-08 12:48:55.084: INFO/tag(334): abc
 11-08 12:48:55.154: WARN/dalvikvm(334): threadid=1: thread exiting
 with uncaught exception (group=0x4001d800) 11-08 12:48:55.204: ERROR/
 AndroidRuntime(334): FATAL EXCEPTION: main 11-08 12:48:55.204: ERROR/
 AndroidRuntime(334): java.lang.RuntimeException: Unable to start
 activity ComponentInfo{com.example.Trial/
 com.example.Trial.ImageWoLab0}: java.lang.ClassCastException:
 android.widget.ImageView 11-08 12:48:55.204: ERROR/
 AndroidRuntime(334): at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2663) 11-08 12:48:55.204: ERROR/AndroidRuntime(334): at
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
 2679) 11-08 12:48:55.204: ERROR/AndroidRuntime(334): at
 android.app.ActivityThread.access$2300(ActivityThread.java:125) 11-08
 12:48:55.204: ERROR/AndroidRuntime(334): at android.app.ActivityThread
 $H.handleMessage(ActivityThread.java:2033) 11-08 12:48:55.204: ERROR/
 AndroidRuntime(334): at
 android.os.Handler.dispatchMessage(Handler.java:99) 11-08
 12:48:55.204: ERROR/AndroidRuntime(334): at
 android.os.Looper.loop(Looper.java:123) 11-08 12:48:55.204: ERROR/
 AndroidRuntime(334): at
 android.app.ActivityThread.main(ActivityThread.java:4627) 11-08
 12:48:55.204: ERROR/AndroidRuntime(334): at
 java.lang.reflect.Method.invokeNative(Native Method) 11-08
 12:48:55.204: ERROR/AndroidRuntime(334): at
 java.lang.reflect.Method.invoke(Method.java:521) 11-08 12:48:55.204:
 ERROR/AndroidRuntime(334): at com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:868) 11-08 12:48:55.204:
 ERROR/AndroidRuntime(334): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 11-08
 12:48:55.204: ERROR/AndroidRuntime(334): at
 dalvik.system.NativeStart.main(Native Method) 11-08 12:48:55.204:
 ERROR/AndroidRuntime(334): Caused by: java.lang.ClassCastException:
 android.widget.ImageView 11-08 12:48:55.204: ERROR/
 AndroidRuntime(334): at
 com.example.Trial.ImageWoLab0.onCreate(ImageWoLab0.java:21) 11-08
 12:48:55.204: ERROR/AndroidRuntime(334): at
 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
 1047) 11-08 12:48:55.204: ERROR/AndroidRuntime(334): at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2627) 11-08 12:48:55.204: ERROR/AndroidRuntime(334): ... 11 more 11-08
 12:48:55.264: WARN/ActivityManager(61): Force finishing activity
 com.example.Trial/.ImageWoLab0 11-08 12:48:55.274: WARN/
 ActivityManager(61): Force finishing activity com.example.Trial/.Trial

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

Re: [android-developers] Re: The application has stopped unexpectedly

2010-11-08 Thread alok upadhyay
thanks,
i was doing wrong actually in xml i had taken imageview while on code i have
taken imagebutton, thats why classcaste exception was there.
Resolved now

On Mon, Nov 8, 2010 at 5:33 PM, Sarwar Erfan erfanonl...@gmail.com wrote:

 puty try catch around

 ImageButton o1 = (ImageButton) findViewById(R.id.next);
 o1.setOnClickListener(this);

 R.id.next : is it really an ImageButton?

 You have got ClassCastException.

 Regards
 Sarwar Erfan




 On Nov 8, 1:27 pm, Alok Upadhyay maddy.luck...@gmail.com wrote:
  i have two class as trial.java and ImageWoLab0.java(Image without
  lable 0).When i run my application i am getting error as : The
  application has stopped unexpectedly!!
 
  public void onClick(View v)
  {
  switch (v.getId())
  {
  case R.id.btnSequence:
  Intent intent1 = new Intent();
  intent1.setClass(this,ImageWoLab0.class);   /*To open new
  Screen/Activity */
 
   /
  *Passing a key/value(Condition) to Activity2.class*/
  startActivity(intent1); /*open the new
  screen/Activity*/
  break;
 
  case R.id.btnVideo:
  Intent intent2 = new Intent();
  intent2.setClass(this,Activity2.class);
  intent2.putExtra(String_key, value1);
  startActivity(intent2);
  break;
 
  case R.id.btnInfo:
  Intent intent3 = new Intent();
  intent3.setClass(this,Activity2.class);
 
  intent3.putExtra(String_key, value2);
  startActivity(intent3);
  break;
  }
  othar class as:
 
  public class ImageWoLab0 extends Activity implements OnClickListener
  { private static String TAG = tag;
 
  @Override
  public void onCreate(Bundle savedInstanceState)
  {
  Log.i(TAG, abc);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.image0);
  ImageButton o1 = (ImageButton) findViewById(R.id.next);
  o1.setOnClickListener(this);
 
  }
 
  @Override
  public void onClick(View v)
  {
  switch (v.getId())
  {
  case R.id.next:
  Intent intent1 = new Intent();
  intent1.setClass(this,ImageWoLab1.class);
  startActivity(intent1);
  break;
 
  }
 
  }
  }
 
  i have check image in drawable folder,manifest file(activity
  entry),layout file properly.i have clean again and again even rebuild
  again still the same messageis displaying.i am getting log as:sorry if
  i have not send log in right format(first time i am using logcat):
 
  11-08 12:48:55.084: INFO/tag(334): abc
  11-08 12:48:55.154: WARN/dalvikvm(334): threadid=1: thread exiting
  with uncaught exception (group=0x4001d800) 11-08 12:48:55.204: ERROR/
  AndroidRuntime(334): FATAL EXCEPTION: main 11-08 12:48:55.204: ERROR/
  AndroidRuntime(334): java.lang.RuntimeException: Unable to start
  activity ComponentInfo{com.example.Trial/
  com.example.Trial.ImageWoLab0}: java.lang.ClassCastException:
  android.widget.ImageView 11-08 12:48:55.204: ERROR/
  AndroidRuntime(334): at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
  2663) 11-08 12:48:55.204: ERROR/AndroidRuntime(334): at
  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
  2679) 11-08 12:48:55.204: ERROR/AndroidRuntime(334): at
  android.app.ActivityThread.access$2300(ActivityThread.java:125) 11-08
  12:48:55.204: ERROR/AndroidRuntime(334): at android.app.ActivityThread
  $H.handleMessage(ActivityThread.java:2033) 11-08 12:48:55.204: ERROR/
  AndroidRuntime(334): at
  android.os.Handler.dispatchMessage(Handler.java:99) 11-08
  12:48:55.204: ERROR/AndroidRuntime(334): at
  android.os.Looper.loop(Looper.java:123) 11-08 12:48:55.204: ERROR/
  AndroidRuntime(334): at
  android.app.ActivityThread.main(ActivityThread.java:4627) 11-08
  12:48:55.204: ERROR/AndroidRuntime(334): at
  java.lang.reflect.Method.invokeNative(Native Method) 11-08
  12:48:55.204: ERROR/AndroidRuntime(334): at
  java.lang.reflect.Method.invoke(Method.java:521) 11-08 12:48:55.204:
  ERROR/AndroidRuntime(334): at com.android.internal.os.ZygoteInit
  $MethodAndArgsCaller.run(ZygoteInit.java:868) 11-08 12:48:55.204:
  ERROR/AndroidRuntime(334): at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 11-08
  12:48:55.204: ERROR/AndroidRuntime(334): at
  dalvik.system.NativeStart.main(Native Method) 11-08 12:48:55.204:
  ERROR/AndroidRuntime(334): Caused by: java.lang.ClassCastException:
  android.widget.ImageView 11-08 12:48:55.204: ERROR/
  AndroidRuntime(334): at
  com.example.Trial.ImageWoLab0.onCreate(ImageWoLab0.java:21) 11-08
  12:48:55.204: ERROR/AndroidRuntime(334): at
  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
  1047) 11-08 12:48:55.204: ERROR/AndroidRuntime(334): at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
  2627) 11-08 12:48:55.204: ERROR/AndroidRuntime(334): ... 11 more 11-08
  12:48:55.264: WARN/ActivityManager(61): Force finishing activity
  com.example.Trial/.ImageWoLab0 11-08 12:48:55.274: 

Re: [android-developers] Re: Where is the UI state information (used in super.onCreate(Bundle savedInstanceState)) stored ?

2010-11-08 Thread Mark Murphy
On Mon, Nov 8, 2010 at 1:37 AM, Mathias Lin m...@mathiaslin.com wrote:
 That's what I thought. But why is the UI state then not entirely
 cleared?

AFAIK, applications do not hold the saved instance state -- the
operating system does, in its own process.

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

Warescription: Three Android Books, Plus Updates, One Low Price!

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

2010-11-08 Thread Tom / HyperBees
@String
the world is small :)

On Nov 8, 7:43 am, String sterling.ud...@googlemail.com wrote:
 Hi Tom,

 Hah, I actually found out about mopapp from your talk at DroidCon
 London a couple of weeks ago. Thanks for the update!

 String

 On Nov 7, 10:41 pm, Tom / HyperBees tomek.ml...@gmail.com wrote:







  @String
  I use mopapp.com for reporting purposes, great tool, they are in beta.
  Today I did a quick data validation vs Checkout and it seems they
  overstate figures a bit, we're investigating it.

  @Brad
  Are you thinking about a tool for free apps only?

  Cheers,
  Tom

  On Nov 7, 5:44 pm, String sterling.ud...@googlemail.com wrote:

   Take a look athttp://www.mopapp.com. I haven't tried their service,
   but it looks like what you're after.

   String

   On Oct 28, 9:40 am, deg d...@degel.com wrote:

On the Market web page, I can see how many copies of my apps have been
installed.

But, this only shows the current total. If I want to see historical
trends, I need to check the page daily and record the numbers myself
-- an annoyance at best.

Is this info available anywhere on the Market site?
If not, has anyone written a screen-scraping utility (or equivalent)
that can harvest the data into a spreadsheet?

Thanks,
David

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


[android-developers] Mistake in official Sample ?

2010-11-08 Thread Omie
http://developer.android.com/resources/faq/commontasks.html#opennewscreen

Scroll down to Returning a Result from a Screen and look at code sample :

Shouldn't that be requestCode to switch() ?

// Listen for results.
protected void onActivityResult(int requestCode, int resultCode, Intent data){

// See which child activity is calling us back.
switch (*resultCode*) {

case CHOOSE_FIGHTER:
// This is the standard resultCode that is sent back if the

// activity crashed or didn't doesn't supply an explicit result.
if (resultCode == RESULT_CANCELED){

myMessageboxFunction(Fight cancelled);
}

else {
myFightFunction(data);

}
default:
break;

}
}

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

2010-11-08 Thread james pruett
worked great. Thanks Kumar!

On Sun, Nov 7, 2010 at 10:25 PM, Kumar Bibek coomar@gmail.com wrote:

 Properties-Android Tools-Fix Project Properties. This is a simple way of
 doing it. Else, you will have to modify the .classpath variable.

 On Mon, Nov 8, 2010 at 7:33 AM, cellurl gpscru...@gmail.com wrote:

 In Eclipse, after I import an existing project, I don't see the
 Android 1.5 directory.
 I see the libs, src, gen, etc, but I don't know how to get the Android
 one.

 Q: How do I add that?

 Any help appreciated!
 -jim

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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




 --
 Kumar Bibek
 http://techdroid.kbeanie.com
 http://www.kbeanie.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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

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

[android-developers] debugging at user?

2010-11-08 Thread Éva Lovrencsics
Hello Developers!

I have an app, which force closes at one of my users. Other users
haven't got any problem with it. This user has Android 1.6, so no
Report button at force close. I have also 1.6, and my app works
perfectly on my phone.
Do you know what is the best way to debug it at the user? I don't have
any idea, what the problem is. (It crashes at startup.) Can I see the
logs, or what can I do?

Evi

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

2010-11-08 Thread Kumar Bibek
You can ask the user to send you the log. I use SendLog app for this

2010/11/8 Éva Lovrencsics lovi...@gmail.com

 Hello Developers!

 I have an app, which force closes at one of my users. Other users
 haven't got any problem with it. This user has Android 1.6, so no
 Report button at force close. I have also 1.6, and my app works
 perfectly on my phone.
 Do you know what is the best way to debug it at the user? I don't have
 any idea, what the problem is. (It crashes at startup.) Can I see the
 logs, or what can I do?

 Evi

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] Mistake in official Sample ?

2010-11-08 Thread Kumar Bibek
Yup, it seems so.

On Mon, Nov 8, 2010 at 6:59 PM, Omie intelom...@gmail.com wrote:


 http://developer.android.com/resources/faq/commontasks.html#opennewscreen

 Scroll down to Returning a Result from a Screen and look at code sample :

 Shouldn't that be requestCode to switch() ?

 // Listen for results.
 protected void onActivityResult(int requestCode, int resultCode, Intent data){


 // See which child activity is calling us back.
 switch (*resultCode*) {


 case CHOOSE_FIGHTER:
 // This is the standard resultCode that is sent back if the


 // activity crashed or didn't doesn't supply an explicit result.
 if (resultCode == RESULT_CANCELED){


 myMessageboxFunction(Fight cancelled);
 }


 else {
 myFightFunction(data);


 }
 default:
 break;


 }
 }


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] debugging at user?

2010-11-08 Thread Kostya Vasilyev

Éva,

There are applications in Market that allow the user collect the logcat 
and email it (to you).


Another option is to use one of the several available error reporting 
libraries, such as ACRA:


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

Yet another option is to add your own error reporting code, it's pretty 
simple:


- Use Thread.setDefaultUncaughtExceptionHandler early during startup

- When an exception is reported, do something like this:

@Override
public void uncaughtException(Thread t, Throwable e) {
/*
* Build stack trace
*/
Writer result = new StringWriter();
PrintWriter writer = new PrintWriter(result);
e.printStackTrace(writer);

Throwable cause = e.getCause();
while (cause != null) {
writer.append(\nCaused by:\n);
cause.printStackTrace(writer);
cause = cause.getCause();
}
String stackTrace = result.toString();
writer.close();

/* Stack trace is in stackTrace, send as email, or write to sd card */

if (mPrevExceptionHandler != null) {
/*
* Call the default handler: this will notify the user
*/
mPrevExceptionHandler.uncaughtException(t, e);
}
}

-- Kostya

08.11.2010 16:48, Éva Lovrencsics пишет:

Hello Developers!

I have an app, which force closes at one of my users. Other users
haven't got any problem with it. This user has Android 1.6, so no
Report button at force close. I have also 1.6, and my app works
perfectly on my phone.
Do you know what is the best way to debug it at the user? I don't have
any idea, what the problem is. (It crashes at startup.) Can I see the
logs, or what can I do?

Evi




--
Kostya Vasilyev -- 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] How to make a trial version which starts a limited amount of times?

2010-11-08 Thread MobileVisuals
I want to make a trial version, where the application functionality
works a limited amount of times. The consumer will then be given the
option to buy the complete version on Android market. How can I
implement that?

I could write some info to the sdcard after each start of the app and
then read that info on the next start or reinstallation of the app.
But would that work? This thread

http://groups.google.com/group/android-developers/browse_thread/thread/542d3df1ec09d28b/d6879e714e9078a1?lnk=gstq=trial+version#d6879e714e9078a1
:

says that there's no 100% sure way to keep someone from reusing a
trial version. That seems strange. It is possible to make a
functionable trial version in J2ME with the RecordStore class. Why
shouldn't this
be possible in Android?

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


[android-developers] Re: debugging at user?

2010-11-08 Thread Lovievi

Thank you all!

Evi

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

2010-11-08 Thread BuckeyeDroid
Thanks for the response. Can you provide how you implemented this? I
could not find it in your other posts.

Thanks

On Nov 5, 10:51 am, Bret Foreman bret.fore...@gmail.com wrote:
 I just finished implementing something like this. It was not easy.
 ExpandableListView has a few bugs which you will have to code around.
 I've filed one of the bugs in b.android.com, along with a work-around,
 and I've posted the details of another bug in the forum, also
 including a work-around. Just search for my name associated with
 ExpandableListView  and you'll find them.

 On Nov 5, 9:43 am, BuckeyeDroid bill.schric...@gmail.com wrote:

  Is it possible for the child of an ExpandableListView also be a
  parent? For example, I need something like the following:

  ParentA
    ChildA
    ChildB
  ParentB
    ChildC
      GrandchildA??
      GrandchildB??
  ParentC

  Any thoughts, examples, or suggestions are greatly appreciated.

  Bill



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 make a trial version which starts a limited amount of times?

2010-11-08 Thread TreKing
On Mon, Nov 8, 2010 at 9:01 AM, MobileVisuals eyv...@astralvisuals.comwrote:

 Why shouldn't this be possible in Android?


Because there's no where to store installation count information on the
device the user can't wipe and no reliable way to associate a given user /
device to any information if you were to store it online.

Just use the SDcard - the more savvy users will probably figure it out and
learn to delete your trial data, but most people will have no idea. Also,
you can make it such that if they delete the trial information stuff, any
saved data gets wiped too, so they can try the app as often as they want,
but have to start over each time.

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

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

[android-developers] Re: ExpandableListView question

2010-11-08 Thread Bret Foreman
I fill the Child View position with a vertical LinearLayout. The top
row of that layout is a horizontal LinearLayout with two Views, the
expand/collapse icon and the name of the child. The lower rows of the
vertical LinearLayout are the 3rd level items. You will find that text
selection is broken in ExpandableListView so you'll need to implement
that yourself by overriding onDraw in the TextView. You will also find
that onTouch is broken, which means you'll have to implement your own
onTouch highlighting.

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

2010-11-08 Thread TreKing
On Mon, Nov 8, 2010 at 4:43 AM, Alok Upadhyay maddy.luck...@gmail.comwrote:

 android:layout_gravity=bottom


Try android:layout_gravity=*bottom|right*

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

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

[android-developers] Re: How to make a trial version which starts a limited amount of times?

2010-11-08 Thread Pent
  Why shouldn't this be possible in Android?

 Because there's no where to store installation count information on the
 device the user can't wipe and no reliable way to associate a given user /
 device to any information if you were to store it online.

You'd think one integer per package of not-wiped storage wouldn't be
too much to ask.

Pent

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


[android-developers] Re: How to make a trial version which starts a limited amount of times?

2010-11-08 Thread MobileVisuals
So you recommend a solution where I write info to the SDcard and then
read it on the next start or reinstallation of the app?

On 8 Nov, 16:57, Pent tas...@dinglisch.net wrote:
   Why shouldn't this be possible in Android?

  Because there's no where to store installation count information on the
  device the user can't wipe and no reliable way to associate a given user /
  device to any information if you were to store it online.

 You'd think one integer per package of not-wiped storage wouldn't be
 too much to ask.

 Pent

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


Re: [android-developers] Re: How to make a trial version which starts a limited amount of times?

2010-11-08 Thread TreKing
On Mon, Nov 8, 2010 at 10:13 AM, MobileVisuals eyv...@astralvisuals.comwrote:

 So you recommend a solution where I write info to the SDcard and then read
 it on the next start or reinstallation of the app?


Pretty much.

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

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

[android-developers] Re: Where is the UI state information (used in super.onCreate(Bundle savedInstanceState)) stored ?

2010-11-08 Thread Mathias Lin
Hi Mark,

thanks for your reply. Yes, it's probably managed by the system, yet
I'm still wondering:

Below you can see that the browser activity runs in different
processes (#2307, #5536) before and after I killed/restarted it, and
yet it's displaying / restoring the same UI input values entered by
the user, regardless of being in an entire new process.

So, are the two activities in these two processes actually the same
instance? If so, why?
(I was thinking of something like 'task parenting' to be eventually
happening here, but it cannot be, since there's no
android:allowTaskReparenting attribute in the application's manifest
and the default value for an activity for such is false. And it would
also mean that the activity wouldn't really be gone even after kill
has been executed.)


[*** some user input on UI in the browser app ***]

# ps | grep -i browser
ps | grep -i browser
app_27   2307  75131944 25960  afe0da04 S
com.android.browser
# killall -9 com.android.browser
killall -9 com.android.browser

[*** browser is killed, then I press home long, select browser app
from recent apps ***]

# ps | grep -i browser
ps | grep -i browser
app_27   5536  75121868 24316  afe0da04 S
com.android.browser

[*** ... and the UI still shows values from the activity in the
previous #2307 process *** ]




On Nov 8, 8:19 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Mon, Nov 8, 2010 at 1:37 AM, Mathias Lin m...@mathiaslin.com wrote:
  That's what I thought. But why is the UI state then not entirely
  cleared?

 AFAIK, applications do not hold the saved instance state -- the
 operating system does, in its own process.

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

 Warescription: Three Android Books, Plus Updates, One Low Price!

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


[android-developers] French character encoding issues

2010-11-08 Thread Simon MacDonald
Hi all,

I'm wondering if I found a bug in Android.  When I run this code on my
laptop:

 String myData = hockey,marché,football;
 byte[] rawData;
 rawData = myData.getBytes(UTF-8);

System.out.println(UTF-8 decoded: +new String(rawData,UTF-8));
  System.out.println(Default decoded: +new String(rawData));

I get the output:

*UTF-8 decoded: hockey,marché,football*
*Default decoded: hockey,marché,football*

However, when I run the same code in an Android application and view the
output it adb logcat I get:

*D/FileUtils(  485): UTF-8 decoded: hockey,march�,football*
*D/FileUtils(  485): Default decoded: hockey,march�,football*

I get the same issue if I change the locale of my phone to French (Canada)
as well.  It doesn't seem like French characters are getting encoded
properly.

Any thoughts?

Simon Mac Donald
http://hi.im/simonmacdonald

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

2010-11-08 Thread Daniel Drozdzewski
Simon,

Make 100% sure that your source files are UTF-8 encoded.

Daniel



On Mon, Nov 8, 2010 at 4:46 PM, Simon MacDonald
simon.macdon...@gmail.com wrote:
 Hi all,
 I'm wondering if I found a bug in Android.  When I run this code on my
 laptop:
      String myData = hockey,marché,football;
      byte[] rawData;
 rawData = myData.getBytes(UTF-8);

 System.out.println(UTF-8 decoded: +new String(rawData,UTF-8));
      System.out.println(Default decoded: +new String(rawData));
 I get the output:

 UTF-8 decoded: hockey,marché,football
 Default decoded: hockey,marché,football
 However, when I run the same code in an Android application and view the
 output it adb logcat I get:
 D/FileUtils(  485): UTF-8 decoded: hockey,march∩┐╜,football
 D/FileUtils(  485): Default decoded: hockey,march∩┐╜,football
 I get the same issue if I change the locale of my phone to French (Canada)
 as well.  It doesn't seem like French characters are getting encoded
 properly.
 Any thoughts?
 Simon Mac Donald
 http://hi.im/simonmacdonald

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



-- 
Daniel Drozdzewski

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


[android-developers] Re: adb connect

2010-11-08 Thread Koh Chean Siong
First set the port for your device using the command below:
setprop service.adb.tcp.port 
stop adbd
start adbd

Then, you may connect to the device in your PC:
adb connect 192.168.1.100:

Note: 192.168.1.100 is example of IP Address.

Regards,
Koh

On Nov 8, 12:12 pm, kypriakos demet...@ece.neu.edu wrote:
 Hi all -

 which port is the adb connect host:port referring to when
 connecting to a real device? Is that port defaulting to anything
 (may be between  and 5585 odd #) or not?

 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] drawBitmap differences between 2.1 and 2.2

2010-11-08 Thread siliconeagle
I am working on a drawing program that draws to a bitmap in memory
then i draw the relevant portion to the view canvas depending on pan
and zoom settings

So i have run into a snag where if the src rect is outside to bounds
of the canvas in 2.2 the area outside the bounds is not drawn but in
2.1 it stretched the available area of the bitmap to fit the target.

e.g. for src (-40,-40,10,10) - tgt (0,0,50,50)
in 2.2 there is just the area (0,0,10,10) drawn in the bottom right
corner(40,40,50,50)
but int 2.1 the area is stretched so the area (0,0,10,10) is stretched
to (0,0,50,50)

is there a flag or something to turn off the stretching behaviour and
make it behave like the 2.2 version? or do i just have to do the
checks manually and modify the target are to fit what available in the
src?

im hoping that makes sense to someone ...

rob m

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Where is the UI state information (used in super.onCreate(Bundle savedInstanceState)) stored ?

2010-11-08 Thread Mark Murphy
On Mon, Nov 8, 2010 at 11:38 AM, Mathias Lin m...@mathiaslin.com wrote:
 thanks for your reply. Yes, it's probably managed by the system, yet
 I'm still wondering:

 Below you can see that the browser activity runs in different
 processes (#2307, #5536) before and after I killed/restarted it, and
 yet it's displaying / restoring the same UI input values entered by
 the user, regardless of being in an entire new process.

That make sense.

 So, are the two activities in these two processes actually the same
 instance?

That's not possible. Each process has its own VM. However, they might
have the same *instance state* (i.e., Bundle).

I have no real idea what you're trying to accomplish here -- what you
originally posted sounds scary. However, the answer for dealing with
all this in-flight instance state stuff is to reboot the phone. Since
you're running a rooted phone, I would think there's a way to reboot
it.

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

Warescription: Three Android Books, Plus Updates, One Low Price!

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

2010-11-08 Thread Marcin Orlowski
      String myData = hockey,marché,football;

Are using Eclipse? Ensure your project files are UTF-8 encoded. By default
Eclipse uses cp1250 (at least here) and I had similar problem once due
to 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


Re: [android-developers] Re: How to make a trial version which starts a limited amount of times?

2010-11-08 Thread Marcin Orlowski
On 8 November 2010 17:13, MobileVisuals eyv...@astralvisuals.com wrote:
 So you recommend a solution where I write info to the SDcard and then
 read it on the next start or reinstallation of the app?

Or, if you go INTERNET permission for any reason granted, validate
device on your server somehow. Due to ANDROID_ID issues
it probably be much better to check agains i.e. WI-FI MAC anyway.

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


[android-developers] Save webview content for offline browsing

2010-11-08 Thread Edwin
Hello, I would like to implement an apps that allow users save the
webpage including images. Then the users can view the web page again
even there is no network access. However, I found that there is no
such related API to do so. Does anyone have idea or experience?

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: adb connect

2010-11-08 Thread kypriakos

Thanks for the response Sutanto - I was looking for connections of IP
-
I think this is what I could dig out on the device side:

su

setprop service.adb.tcp.port 

stop adbd

start adbd

And to do that I need a terminal app on the device unless I do all
this
via USB - which is what you are saying below.

Cheers

On Nov 8, 1:00 am, Sutanto 苏坦托 tnto.i...@yahoo.com wrote:
    1. Enable debug mode on your devices
    2. Try to run *adb devices command* in you terminal application, you
    should see list of existing emulator or existing real devices which
    connected to you computer.

 On Mon, Nov 8, 2010 at 11:12 AM, kypriakos demet...@ece.neu.edu wrote:

  Hi all -

  which port is the adb connect host:port referring to when
  connecting to a real device? Is that port defaulting to anything
  (may be between  and 5585 odd #) or not?

  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.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Sutantohttp://www.tnto.info

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


[android-developers] Hidden Broken images in Webview

2010-11-08 Thread Edwin
Hello all!! I load a webpage in webview but it results that there is a
broken image. I check the html and load it in PC, everything is ok. I
don't know why..However, I think hidden the broken image is fine. Does
any one know how to disable to show broken images automatically?

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


Re: [android-developers] Save webview content for offline browsing

2010-11-08 Thread Kumar Bibek
Save the HTML content somewhere once it is downloaded along with all other
files and then change the locations of all these files in the original HTML
to point to your local resources.

BTW, Whenever you use a web view, it caches some information like images.
But this is not full proof though.

On Mon, Nov 8, 2010 at 10:55 PM, Edwin edwin...@gmail.com wrote:

 Hello, I would like to implement an apps that allow users save the
 webpage including images. Then the users can view the web page again
 even there is no network access. However, I found that there is no
 such related API to do so. Does anyone have idea or experience?

 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] Hidden Broken images in Webview

2010-11-08 Thread Kumar Bibek
If the images are for some reason not downloaded properly, you will see
these broken images.

On Mon, Nov 8, 2010 at 10:57 PM, Edwin edwin...@gmail.com wrote:

 Hello all!! I load a webpage in webview but it results that there is a
 broken image. I check the html and load it in PC, everything is ok. I
 don't know why..However, I think hidden the broken image is fine. Does
 any one know how to disable to show broken images automatically?

 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] Bluetooth name and address in 1.5

2010-11-08 Thread klavin
I was wondering if its possible to get the bluetooth name and / or
address in 1.5? The BluetoothAdapter class isnt availabel in that
release. Is there another way to get this info on 1.5?
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


Re: [android-developers] Re: Where is the UI state information (used in super.onCreate(Bundle savedInstanceState)) stored ?

2010-11-08 Thread Dianne Hackborn
They don't have the same instance state.  You can use adb shell dumpsys
activity to see the system's activity stack; each of those entries is an
instance of an activity as far as the system is concerned.

Killing a process while its UI is in the background is a normal situation on
the system -- it is what happens when memory is low.  It is expected, and
doesn't impact the instance that the system has on the stack.  (It will just
have to ask the app to re-create it the next time the user visits it.)

Killing a process while it is in the foreground is not normal.  In that case
the system didn't have time to ask it to save its instance state, so it can
not re-start the activity in its last state, so it throws that instance
away.

On Mon, Nov 8, 2010 at 9:14 AM, Mark Murphy mmur...@commonsware.com wrote:

 On Mon, Nov 8, 2010 at 11:38 AM, Mathias Lin m...@mathiaslin.com wrote:
  thanks for your reply. Yes, it's probably managed by the system, yet
  I'm still wondering:
 
  Below you can see that the browser activity runs in different
  processes (#2307, #5536) before and after I killed/restarted it, and
  yet it's displaying / restoring the same UI input values entered by
  the user, regardless of being in an entire new process.

 That make sense.

  So, are the two activities in these two processes actually the same
  instance?

 That's not possible. Each process has its own VM. However, they might
 have the same *instance state* (i.e., Bundle).

 I have no real idea what you're trying to accomplish here -- what you
 originally posted sounds scary. However, the answer for dealing with
 all this in-flight instance state stuff is to reboot the phone. Since
 you're running a rooted phone, I would think there's a way to reboot
 it.

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

 Warescription: Three Android Books, Plus Updates, One Low Price!

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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




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

Re: [android-developers] Protecting service from getting killed.

2010-11-08 Thread Dianne Hackborn
On Mon, Nov 8, 2010 at 3:32 AM, Kumar Bibek coomar@gmail.com wrote:

 As of now there is no way of preventing that. But, as far as I have heard
 and read, future OS versions would disable this feature wherein 3rd party
 apps can kill other services.


Well you could only run on 2.2 devices, where task killers can't do this.

Also these is a big difference between the process simply being killed
(which both the platform and task killers may freely do) and then the
service being restarted, and the entire service being force stopped (which
users can do with the running services UI, and task killers could do prior
to 2.2).  The former is normal  behavior that a service must expect and
handle correctly.  The latter says the user really does not want your
service running and there is not much you can do about it.

-- 
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: Where is the UI state information (used in super.onCreate(Bundle savedInstanceState)) stored ?

2010-11-08 Thread Mathias Lin
Not too scary if you look at my scenario ;-)

I have devices that I rent out to end-users through a hotel/concierge.
These devices hold 1) my app, 2) browser, 3) facebook app.
End-users (hotel guests) can rent the devices and return it to the
hotel. The non-technical hotel concierge needs to be able to clear all
user data with one click from 1) my app before handing it to another
guest, without needing to go through the application settings of each
application, clear data there. For a non-technical person, those would
be too many steps. In fact, the concierge doesn't even have access to
the device settings (he can only move around the mentioned three
apps).
Therefore I need a way to clear the data programmatically via script
(one button click in my app). But I don't want to need a force a
device reboot if that's not really necessary.

I'd like to understand what's happening here, i.e. how can the two
have the same instance state / bundle? Just because the two activities
have the same package / class name? And also, why is there a
difference whether the activity was last in the foreground or not.
Ok..., I'm probably repeating what I already mentioned above.

I know it's kind of a special use-case I'm having here... still trying
to find a good solution hopefully without needing to force a reboot. I
appreciate your input or any other ideas for such scenario. Thanks.


On Nov 9, 1:14 am, Mark Murphy mmur...@commonsware.com wrote:
 On Mon, Nov 8, 2010 at 11:38 AM, Mathias Lin m...@mathiaslin.com wrote:
  thanks for your reply. Yes, it's probably managed by the system, yet
  I'm still wondering:

  Below you can see that the browser activity runs in different
  processes (#2307, #5536) before and after I killed/restarted it, and
  yet it's displaying / restoring the same UI input values entered by
  the user, regardless of being in an entire new process.

 That make sense.

  So, are the two activities in these two processes actually the same
  instance?

 That's not possible. Each process has its own VM. However, they might
 have the same *instance state* (i.e., Bundle).

 I have no real idea what you're trying to accomplish here -- what you
 originally posted sounds scary. However, the answer for dealing with
 all this in-flight instance state stuff is to reboot the phone. Since
 you're running a rooted phone, I would think there's a way to reboot
 it.

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

 Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Where is the UI state information (used in super.onCreate(Bundle savedInstanceState)) stored ?

2010-11-08 Thread Dianne Hackborn
Please leave the lifecycle documentation.  Processes are just transient
entities used to hold running processes; killing a process is not the same
as stopping an application.  You are treating this like a Unix system,
when it is not.

Resetting an application back to its initial state is done with the clear
data button in manage applications, which asks the package manager to erase
*all* of its data, and does a full force stop which in addition to killing
processes also stops services and tells all system services to release any
state they have about the app (such as configured app widgets etc).

You should use the same API that manage apps does for this, which is not
part of the SDK, but you clearly aren't trying to do something in the SDK.
 Which brings up -- your question should be posted to a group like
android-porting since you are doing platform-level stuff.  Posting questions
like this here is not going to get a good response because when people see
questions on this group they are thinking in terms of the SDK, which is not
at all relevant for you.

-- 
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: Fetch Spinner value outside setOnItemSelectedListener

2010-11-08 Thread A. Elk
In the Android 2.2 SDK there's a sample app (new for 2.2) called
Spinner that demonstrates how to do this using SharedPreferences. It
will save the state of the spinner across pause() and resume(), and
also across app shutdown and restart.

Even better, it comes with a test package project called SpinnerTest
that demonstrates the unit test for this.

And best of all, the Activity Testing tutorial uses this app and its
test package to demonstrate unit testing in Android.

Enjoy!

The Elk

On Nov 7, 3:09 pm, sisko adeod...@gmail.com wrote:
 Hi guys,

 I have a spinner successfully working but I am trying to use the
 spinner.setSelection method to remember the previous spinner value
 when the activity is reloaded.

 Outside of setOnItemSelectedListener, is there a function of the
 spinner that can give me the selected index?

 The following code is my function code to both setup the spinner and
 then my attempt to set the spinner with the index previously selected:

 private void setSpinner(int spinnerID){
                 final Spinner spinner   =
 (Spinner)findViewById(R.id.Spinner_gender);
                 int spinner_value;

                 spinner.setOnItemSelectedListener(
                                 new AdapterView.OnItemSelectedListener() {
                                         public void 
 onItemSelected(AdapterView? parent, View
 itemSelected, int selectedItemPosition, long selected){
                                                 spinner_value   =       
 selectedItemPosition;
                                                 Editor editor   =       
 mGameSettings.edit();
                                                 
 editor.putLong(GAME_PREFERENCES_GENDER,
 selectedItemPosition);
                                                 editor.commit();
                                                 
 Toast.makeText(QuizSettingsActivity.this, selected:
 +GAME_PREFERENCES_GENDER+(+ spinner_value +),
 Toast.LENGTH_SHORT).show();
                                         }

                                                 @Override
                                                 public void 
 onNothingSelected(AdapterView? arg0) {
                                                         // TODO 
 Auto-generated method stub

                                                 }

                                         }
                 );

                 ArrayAdapter? adapter   =       
 ArrayAdapter.createFromResource(this,
 spinnerID, android.R.layout.simple_spinner_item);

 adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_it 
 em);
                 spinner.setAdapter(adapter);
                 if( mGameSettings.contains(GAME_PREFERENCES_GENDER) ){
                         spinner.setSelection(spinner_value);
                 }

         }

 All I am trying to do here is use spinner_value to remember the
 selected index so I can set the spinner to that index.
 However, the spinner_value is never holding the desired value at
 spinner.setSelection(spinner_value); in the last lines of code

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


[android-developers] Re: Looking for mobile balance transfer study materials

2010-11-08 Thread Istiaque Ahmed
hello, i think it is possible by using the ussd to transfer balance. i
am yet to try that.

but i am worried about some other thing - how can i access a sim from
a website and execute the necessary commands in that sim?

is there any one to help please?

especially i am looking forward to hear from Kostya.
solutions necessary asap.

thanks in advance


On Nov 7, 1:31 pm, Istiaque Ahmed istiaqu...@gmail.com wrote:
 thanks for ur reply.

 how can i transfer balance from a recharge sim to other non-recharge
 sims?

 May i get specific methods, package etc plz?

 Istiaque Ahmed

 On Oct 30, 8:34 pm, Kostya Vasilyev kmans...@gmail.com wrote:



  Can't speak for the whole world, but --

  The three Russian cellular operators I was referring to are all GSM. And
  yet they use different USSD codes, and different ways to specify the
  amount and destination phone number.

  Provided you have the right network-specific information, I'd start by
  looking at:

 http://developer.android.com/reference/android/telephony/SmsManager.html

 http://developer.android.com/reference/android/telephony/TelephonyMan...

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

  -- Kostya

  30.10.2010 17:37, Istiaque Ahmed пишет:

   ok,, the application is dependent on operators. still i think it will
   differ only on whether the operators use GSM or CDMA. am i right?

   Can you please tell me which package and methods should i use?
   what should be the consecutive steps to implement the app?
   Which language should be used?

   Thanks in advance.
   Istiaque Ahmed

   On Oct 30, 6:48 pm, Kostya Vasilyevkmans...@gmail.com  wrote:
   I would think that these services are operator-dependent.

   Here in Russia the big three cellular network operators all have this
   service, but the exact way it's done differs.

   All three use USSD codes to kick off the transfer process, but the codes
   are different, and the subsequent steps differ as well.

   -- Kostya

   30.10.2010 16:04, Istiaque Ahmed пишет:

      0  down vote  favorite
   I need to make a web application for mobile phones so that I can
   transfer balance from a 'recharge sim' (SIM card used to send balance
   to other mobile SIMs) located in whatever country to other 'non-
   recharge sims'.
   I can't find any resource - documentation, tutorial, forum discussion,
   programming language etc.
   Where should I start? What materials, etc, are out there? Is there any
   open-source project I could refer to?
   More precisely- which package and methods of which language should I
   use?
   I need it VERY urgently.
   Any great heart there?
   Thanks in advance.
   Istiaque Ahmed
   --
   Kostya Vasilyev -- WiFi Manager + pretty widget 
   --http://kmansoft.wordpress.com

  --
  Kostya Vasilyev -- WiFi Manager + pretty widget 
  --http://kmansoft.wordpress.com- Hide quoted text -

 - Show quoted text -

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


[android-developers] How to Read sms from inbox and sent items

2010-11-08 Thread Udesh
I'm a beginner developing android application. I need to read sms from inbox
and sort them according to the priority given by the user. For reading sms
from inbox and show them in my app i found some code snippets but those are
basically for older sdk . using SDK 2.2.

so can you give me some code example about the reading sms from sms or any
guide to develop this app.




-Udesh-

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

[android-developers] createBitmap causes an outofmemory error

2010-11-08 Thread sharktiger
Hi,
In my app, I am creating a bitmap from its colors code like this :

int width=getImageWidth();
int height=getImageHeight();
int[] array=getbitmap();
int[] colorsAsIntegers = new int[width*height];
int i = 0;
int j = 0;

while (iwidth*height*4) {
colorsAsIntegers[j] = Color.argb(array[i], array[i+1], array[i+2],
array[i+3]);
i += 4;
j++;
}

myBitmap=Bitmap.createBitmap(colorsAsIntegers,
width,
height,
Bitmap.Config.ARGB_);

And often I get the outofmemoryerror :(
So how can I use the BitmapFactory optimisation to avoid this problem?
because I don't have an input stream or a file, I only have an array
containing my pixels

Thank you

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


[android-developers] Re: How to Read sms from inbox and sent items

2010-11-08 Thread Udesh
have to correct the question.

i need to access the sms in my app and sort them as i need. can i do it in
SDK 2.2. if so plz tell me a code example..


On Fri, Nov 5, 2010 at 10:37 AM, Udesh la.udesh1...@gmail.com wrote:

 I'm a beginner developing android application. I need to read sms from
 inbox and sort them according to the priority given by the user. For reading
 sms from inbox and show them in my app i found some code snippets but
 those are basically for older sdk . using SDK 2.2.

 so can you give me some code example about the reading sms from sms or any
 guide to develop this app.







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

[android-developers] Close Live Folder

2010-11-08 Thread Gary
Hello,

I'm writing a live folder that pops up a login dialog so you can
download data from an outside source.  I'd like to close both the
login dialog and the live folder window(?) when the login dialog is
dismissed.  Is there anyway to do this?

--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] Logcat don't work anymore...

2010-11-08 Thread broody
Logcat in eclipse has been working fine for me until bout a week ago.
I'm not sure how I managed to do it to both my of development
environments... (PC and Mac)

I get the follow error when I open up logcat in eclipse.

Could not create the view: For input string: Debug

java.lang.NumberFormatException: For input string: Debug
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:
48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.parseInt(Integer.java:499)
at
com.android.ddmuilib.logcat.LogFilter.loadFromString(LogFilter.java:
134)
at com.android.ide.eclipse.ddms.views.LogCatView
$FilterStorage.getFilterFromStore(Unknown Source)
at com.android.ddmuilib.logcat.LogPanel.createFilters(LogPanel.java:
1229)
at com.android.ddmuilib.logcat.LogPanel.createControl(LogPanel.java:
441)
at com.android.ddmuilib.Panel.createPanel(Panel.java:29)
at
com.android.ide.eclipse.ddms.views.LogCatView.createPartControl(Unknown
Source)
at
org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:
375)
at
org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:
229)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:
595)
at org.eclipse.ui.internal.WorkbenchPage
$ActivationList.setActive(WorkbenchPage.java:4218)
at org.eclipse.ui.internal.WorkbenchPage
$18.runWithException(WorkbenchPage.java:3277)
at org.eclipse.ui.internal.StartupThreading
$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:
134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:
3586)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3279)
at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:
803)
at org.eclipse.ui.internal.Workbench
$31.runWithException(Workbench.java:1567)
at org.eclipse.ui.internal.StartupThreading
$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:
134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:
3586)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3279)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2548)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:
332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:
664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:
149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:
115)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:
196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:
110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:
79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:
369)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:
179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

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


[android-developers] Cannot read input from user using stdin when running application in adb shell

2010-11-08 Thread MAK71
I have a Linux application written in ANSI C that I am porting to
Android that reads input from a user using fgets() and forwards this
information over an already-established socket connection.  However,
when using the adb shell, upon attempting to read from stdin fgets()
immediately returns NULL.

An additional test I performed using getc shows that stdin is
constantly being spammed with NULLs, but anything typed by the user
within the adb shell is never picked up.

This is a text-based application intended to be run from the adb shell
only.

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


[android-developers] Changes to library doesn't restart the activity

2010-11-08 Thread Andy Selvig
I'm developing an application that uses a library project to store
much of the functionality and content. When I edit the code and/or
content in the library and then run the app, it doesn't properly
restart the activity with the changes, giving the warning:

Warning: Activity not started, its current task has been brought to
the front

I understand that this warning comes from the SK not thinking that
there were any changes to the app, but there were (to the library, not
to the app itself).

The only way that I've found to force the app to recompile with the
library changes is to do Project-Clean. While this is effective, it's
a bit annoying to have to do this every time a make a change. Does
anyone know of a way to force the SDK to recognize that a library
change should result in reloading the application?

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

2010-11-08 Thread nivardo villanueva duran
Hi!

I'm Nivardo Villanueva
, I'm studying in Czech Technical University in Prague

I have problem to use this Library. Could u help me please!

import android.app.ActivityManager;
import android.app.ActivityManagerNative;

-- 
NVD

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

[android-developers] HTTP Post works in activity but not in service

2010-11-08 Thread Burk Ferden
Hello,
I am trying to do a http post to a php script. the method works if I
place it in the onCreate event of the application but gets a
ConnectionTimeOut error when it tries to execute it from the service.
Here is an example of my method

String url = http://myurl/; +
?tmpl=javascript +
mode=recieved +
id= + id;
URI uri = null;
try {
url = url.replace( , %20);
uri = new URI(url);
} catch (URISyntaxException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
HttpGet httpGet = new HttpGet(uri);
HttpParams httpParameters = new BasicHttpParams();
// Set the timeout in milliseconds until a connection is
established.
int timeoutConnection = 1;
HttpConnectionParams.setConnectionTimeout(httpParameters,
timeoutConnection);
// Set the default socket timeout (SO_TIMEOUT)
// in milliseconds which is the timeout for waiting for data.
int timeoutSocket = 1;
HttpConnectionParams.setSoTimeout(httpParameters, 
timeoutSocket);

DefaultHttpClient httpClient = new
DefaultHttpClient(httpParameters);
try {
HttpResponse response = httpClient.execute(httpGet);
} catch (ClientProtocolException e) {
System.out.println(e.getLocalizedMessage());
e.printStackTrace();
} catch (IOException e) {
System.out.println(e.getLocalizedMessage());
e.printStackTrace();
}

I have no idea why the service would get a time out error but the
application activity would not. I am baffled.

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


[android-developers] Canvas INSIDE of a Layout???

2010-11-08 Thread Ryan Detwiler
Hellooo.. I need to have a dynamically updateable canvas inside of a
layout. I would prefer having some sort of method to draw to an
imageview, which is displayed in red on the screenshot. It's intended
to be a graph that updates every 5 times/second or so. Any ideas??
I've been searching for hours and can't seem to find some sort of
concrete example. they all make the entire screen a canvas, which
doesn't allow for layouts. Please help, and thanks in advance! :)

http://i220.photobucket.com/albums/dd15/memphetic/CanvasExample.png

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

2010-11-08 Thread Scott L
Does anyone know why this is disabled in the emulator? There's several
posts about this across the web however no responses to them?
I actually downloaded the emulator to get a feel for Android to see if
I could switch, it's not too welcoming to see it not supporting the
sync, a bit frustrating - I wanted an idea of the system in general.

The market being missing kind of sucks too, I realise the emulator
isn't a demo, try Android! thing but how hard would it be to add
this so people can get an idea of Android?  - I was lucky enough to
have someone at my place of work loan me his old Android phone but not
everyone will be.
Can this please be considered?


On Sep 21, 8:30 am, GodfatherofSoul marvin.bell...@gmail.com wrote:
 How do you turn on sync in the emulator.  I'm already using Google
 APIs level 8 and I've already created a Google account.  But under
 Manage Accounts, my Google account says Sync is OFF.

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

2010-11-08 Thread Sergey
I have the same problem.
I try to fix it and deleted 'exit' command from ndk-build file, but
then i have another error:
target pattern contains no '%' in 82 line of setup-toolchain.mk

I think it some bug of NDK or make.exe

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


[android-developers] Rectangle animation

2010-11-08 Thread Milo
Does anyone have a simple example of the following, I need to show a
horizontal bar,  and fill it in depending on a percentage. I'ld like
to have this animated from the old value to the new.

I can draw the rectangle. However there isn't alot on info on the
scaleanimation, which is what I think I will need.

I've bought some books but they seem to go indepth into text
anumation, through XML. I'm only interest in runtime animation through
Java code.


Any help would be very welcome.

Thanks.

Milo

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

2010-11-08 Thread Aaron Windsor
On Sat, Nov 6, 2010 at 4:42 PM, Open gro...@tenromans.com wrote:
 I have an activity in my application that shows a listview of items
 with icons next two each item. I would like to lazy load icons for
 each item from the Internet using in memory caching and SD caching
 (very common Android use case).

 I have been using this code from the Google Android developers blog:
 http://android-developers.blogspot.com/2010/07/multithreading-for-performance.html

 And discovered that it is possible for this code to generate  100
 asynctasks,

 Does anyone have a modified version of this they would be willing to
 share using a threadpool or some other mechanism to limit the number
 of background threads?

I've used droid-fu (http://github.com/kaeppler/droid-fu/) for exactly
what you're describing, specifically the ImageLoader class within a
custom adapter. Whenever the ListView calls getView on the adapter,
you instantiate an ImageLoader, passing the ImageView that you want to
populate with your web image and the intended position in the ListView
as arguments.

droid-fu also has a WebImageView which looks like it has some recent
changes that will allow it to be used as a drop-in replacement for
ImageViews within ListViews, so you may be able to use it and not even
fool with a custom adapter at all.

-Aaron

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


[android-developers] Froyo media not mounting in time on boot-up? (works in Eclair)

2010-11-08 Thread Koops
Hello there I was wondering if someone may be able to help me...

I have a Live Wallpaper app that is working very well on Eclair but
there is a strange issue with Froyo that I can't find any information
about.  The user is able to select a custom picture as a background
from their gallery and it will be saved to internal storage (/
Snowflakes/CustomBG.jpg) and applied as a background to the live
wallpaper.  That all works fine until the user reboots their phone...
The problem is that the internal storage doesn't seem to be mounted in
time for when the live wallpaper starts and so it reverts to the
default setting when null is returned (see code below).  As I say,
this problem has only been introduced with Froyo as Eclair works fine
(the image is found and used so the internal storage must be mounted
before the Live Wallpaper starts).  Here's the code that searches for
the CustomBG.jpg image on startup...

@Override
public void onSurfaceCreated(SurfaceHolder holder) {
super.onSurfaceCreated(holder);
c = holder.lockCanvas();
canvasSize = new Point(c.getWidth(), c.getHeight());
globalCanvasSize = canvasSize;
holder.unlockCanvasAndPost(c);
generateBackgroundGraphic();
}

private void generateBackgroundGraphic() {
if (backgroundToJPG() == null) {//default to gradient
pattern
background = BitmapFactory.decodeResource(res, 
R.raw.gradient);
Log.d(pic, (SF) File doesn't exist to using Gradient 
as
default);
} else {
background =
BitmapFactory.decodeFile(backgroundToJPG().getPath());
Log.d(pic, (SF) File does exist so using 
'/Snowflakes/
CustomBG.jpg' as background);
}
}

private File backgroundToJPG() {
String status = Environment.getExternalStorageState();
if (status.equals(Environment.MEDIA_MOUNTED)) {
File d = new 
File(Environment.getExternalStorageDirectory()
+/Snowflakes);
d.mkdirs();
File f = new File(d,CustomBG.jpg);
if (!f.exists()) {return null;}
return f;  // -- FILE 
NOT
BEING RETURNED HERE!!
}
}


Apologies for the code formatting - is there any way I can improve
this?  Anyway, I'd be very grateful for any help you may have... I
can't find any information about this on-line so perhaps there's
something wrong with my code?

Thanks, Chris

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


[android-developers] Drawing a marker when user touch the map

2010-11-08 Thread ZQ
Hi, I'm trying to develop an Android app that will draw a mark on the
map when the user touch the map. I've been searching around the web
but can't find any example or tutorials on it. Can anyone tell me how
can i go about doing it? 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] process is bad

2010-11-08 Thread gabriel

Hi,

does someone knows what causes this?

11-07 10:50:03.049: WARN/ActivityManager(61): Unable to launch app 
com.mycom.myapp/10036 for broadcast Intent { 
act=android.appwidget.action.APPWIDGET_ENABLED 
cmp=com.mycom.myapp/.WidgetProvider }: process is bad


or sometimes ...

11-07 10:55:21.998: WARN/ActivityManager(61): Unable to launch app 
com.mycom.myapp/10036 for broadcast Intent { 
act=android.appwidget.action.APPWIDGET_UPDATE 
cmp=com.mycom.myapp/.WidgetProvider (has extras) }: process is bad



I've restarted Eclipse and the emulator, several times and it fails 
*aparently* randomly



tnx

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

[android-developers] native playlist format

2010-11-08 Thread Jaroslav Záruba
Hello

Is there any docs for the native playlist format?

I'd like to transform m3u-playlists I have on my PC into something the
native music player in Android can read. (I don't want to install
iTunes for such basic operation. Syncing using WMP creates what looks
like valid playlist in the device, but the player is not able to get
past 2nd track in continuous mode. After picking a random track
manually once it is played the player jumps back to 2nd track again.)

Cheers
  JZ

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


[android-developers] JNI Global Variables And activity change? / SIGKILL vs SIGTERM

2010-11-08 Thread lomoflicker
1)
Do cached global environments get deleted or somehow get corrupted
when activities change ?

2) SIGKILL vs SIGTERM.
I know the differences of both. Can android native threads handle
these signals ?



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


[android-developers] scroll refresh

2010-11-08 Thread emorse
This worked for me with a refreshDrawableState() call after the
fullScroll call:

e.g.:
textQuote = (ScrollView)findViewById(R.id.formscrollview);
textQuote.fullScroll(ScrollView.FOCUS_UP);
textQuote.refreshDrawableState();

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


[android-developers] REST JSON

2010-11-08 Thread Beginner
Hi,

I am new on this group. I hope i will get help from you guys. I would
like android to communicate with my PHP Server, I have no idea about
REST JSON. Do any one implemented it before.

Can you please recommend me some good resources. I want to build a
simple Registration/Login System which will be authenticate from
android device with PHP mySQL Database.

second i would like to insert/update and delete some record on server
side by from android device. Waiting for your response.

Thanks in advance.


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


Re: [android-developers] REST JSON

2010-11-08 Thread Kumar Bibek
Seems that you need to solve all of your problems with just this query.
Google and search for samples and if you are stuck with something, get back
here.

On Mon, Nov 8, 2010 at 12:24 AM, Beginner atif.musad...@gmail.com wrote:

 Hi,

 I am new on this group. I hope i will get help from you guys. I would
 like android to communicate with my PHP Server, I have no idea about
 REST JSON. Do any one implemented it before.

 Can you please recommend me some good resources. I want to build a
 simple Registration/Login System which will be authenticate from
 android device with PHP mySQL Database.

 second i would like to insert/update and delete some record on server
 side by from android device. Waiting for your response.

 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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: Enabling sync in Android Emulator

2010-11-08 Thread Kumar Bibek
Well, it's just an emulator. And of course, it wont have the market on it.
And since this is an emulator, you will obviously not be able to do all the
stuff that you can do with a device, like taking a picture, playing with the
GPS, using the accelerometer, etc.

If you need to decide whether to switch to an Android device or not,
checking out a real phone is of course a better idea, rather than playing
with the emulator. :)

On Sat, Nov 6, 2010 at 10:35 AM, Scott L scottyl...@gmail.com wrote:

 Does anyone know why this is disabled in the emulator? There's several
 posts about this across the web however no responses to them?
 I actually downloaded the emulator to get a feel for Android to see if
 I could switch, it's not too welcoming to see it not supporting the
 sync, a bit frustrating - I wanted an idea of the system in general.

 The market being missing kind of sucks too, I realise the emulator
 isn't a demo, try Android! thing but how hard would it be to add
 this so people can get an idea of Android?  - I was lucky enough to
 have someone at my place of work loan me his old Android phone but not
 everyone will be.
 Can this please be considered?


 On Sep 21, 8:30 am, GodfatherofSoul marvin.bell...@gmail.com wrote:
  How do you turn on sync in the emulator.  I'm already using Google
  APIs level 8 and I've already created a Google account.  But under
  Manage Accounts, my Google account says Sync is OFF.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] HTTP Post works in activity but not in service

2010-11-08 Thread Kumar Bibek
There is no reason why it should not work for a service. Do you see anything
in the Logcat? Are you sure it's a timeout? Can  you post the stack trace?

On Sat, Nov 6, 2010 at 7:08 AM, Burk Ferden schneck.jus...@gmail.comwrote:

 Hello,
 I am trying to do a http post to a php script. the method works if I
 place it in the onCreate event of the application but gets a
 ConnectionTimeOut error when it tries to execute it from the service.
 Here is an example of my method

 String url = http://myurl/; +
?tmpl=javascript +
mode=recieved +
id= + id;
URI uri = null;
try {
url = url.replace( , %20);
uri = new URI(url);
} catch (URISyntaxException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
HttpGet httpGet = new HttpGet(uri);
HttpParams httpParameters = new BasicHttpParams();
// Set the timeout in milliseconds until a connection is
 established.
int timeoutConnection = 1;
HttpConnectionParams.setConnectionTimeout(httpParameters,
 timeoutConnection);
// Set the default socket timeout (SO_TIMEOUT)
// in milliseconds which is the timeout for waiting for
 data.
int timeoutSocket = 1;
HttpConnectionParams.setSoTimeout(httpParameters,
 timeoutSocket);

DefaultHttpClient httpClient = new
 DefaultHttpClient(httpParameters);
try {
HttpResponse response = httpClient.execute(httpGet);
} catch (ClientProtocolException e) {
System.out.println(e.getLocalizedMessage());
e.printStackTrace();
} catch (IOException e) {
System.out.println(e.getLocalizedMessage());
e.printStackTrace();
}

 I have no idea why the service would get a time out error but the
 application activity would not. I am baffled.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] Changes to library doesn't restart the activity

2010-11-08 Thread Kumar Bibek
Perhaps, the ADT plugin checks if your project has got a newer build thats
different from the previous one. And since you make changes to the library's
code, the apk is not re-generated, and thus this problem.

On Sat, Nov 6, 2010 at 3:27 AM, Andy Selvig ajsel...@gmail.com wrote:

 I'm developing an application that uses a library project to store
 much of the functionality and content. When I edit the code and/or
 content in the library and then run the app, it doesn't properly
 restart the activity with the changes, giving the warning:

 Warning: Activity not started, its current task has been brought to
 the front

 I understand that this warning comes from the SK not thinking that
 there were any changes to the app, but there were (to the library, not
 to the app itself).

 The only way that I've found to force the app to recompile with the
 library changes is to do Project-Clean. While this is effective, it's
 a bit annoying to have to do this every time a make a change. Does
 anyone know of a way to force the SDK to recognize that a library
 change should result in reloading the application?

 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] createBitmap causes an outofmemory error

2010-11-08 Thread Kumar Bibek
Each application has a cap on how much memory it can be allocated. If you go
beyond this, you will get this exception.

Try creating a Bitmap with smalled dimensions.

On Fri, Nov 5, 2010 at 7:22 PM, sharktiger hsoumi.me...@gmail.com wrote:

 Hi,
 In my app, I am creating a bitmap from its colors code like this :

 int width=getImageWidth();
 int height=getImageHeight();
 int[] array=getbitmap();
 int[] colorsAsIntegers = new int[width*height];
 int i = 0;
 int j = 0;

 while (iwidth*height*4) {
 colorsAsIntegers[j] = Color.argb(array[i], array[i+1], array[i+2],
 array[i+3]);
 i += 4;
 j++;
 }

 myBitmap=Bitmap.createBitmap(colorsAsIntegers,
 width,
 height,
 Bitmap.Config.ARGB_);

 And often I get the outofmemoryerror :(
 So how can I use the BitmapFactory optimisation to avoid this problem?
 because I don't have an input stream or a file, I only have an array
 containing my pixels

 Thank you

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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] Drawing a marker when user touch the map

2010-11-08 Thread TreKing
On Sun, Nov 7, 2010 at 2:59 AM, ZQ zhiqiang@gmail.com wrote:

 Can anyone tell me how can i go about doing it?


In broad terms, detect a user touched the map (using one of the various
onTap, onTouch, onWhatever functions) then add an Overlay to the MapView at
the given location.

If you want more specific help then that, please ask a more specific
question, including what you're doing so far that's not working for you.

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

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

[android-developers] REST php server and android client

2010-11-08 Thread Atif Musaddaq
Did any one already implemented php wit mySql database as REST server and
android as a client?

I need some help to do it, plz recommend some reading about REST or
tutorials.

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

[android-developers] How to change the listview row height?

2010-11-08 Thread Oh Kah Ken
How to change the listview row height?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 launch an application? Is there a work around for launchMode bug?

2010-11-08 Thread John
Hi,

What is the proper way to launch an application on Android?
I tried all possible launchMode values, but all of them fail with
several different problems (see below).

This question was already asked many times, for example
http://groups.google.com/group/android-developers/browse_thread/thread/a7c07c8808c50547/6bf6b5b8bfb5d883
http://groups.google.com/group/android-developers/browse_thread/thread/59be582e9a75e9eb/31cf3bc4cd992bf5
http://groups.google.com/group/android-developers/browse_thread/thread/62d9f489d22d7c5f/69983dc3a23c100a
http://stackoverflow.com/questions/2417468/android-bug-in-launchmodesingletask-activity-stack-not-preserved
http://groups.google.com/group/android-developers/browse_thread/thread/76fa8600833f5348/59210de050c9bd20

But I still cannot find any answer.

Unlike other posts mentioned above, I performed all my tests with
samples\android-8\NotePad application.
The only line, which I changed, was launchMode in activity
android:name=NotesList
I tested on Android emulator 2.1 and 2.2 and also on DroidX 2.2.
Results are the same.

Here are the steps to reproduce the bugs:

android:launchMode=standard - this is the default
1. When installing NotePad application tap Open.
2. Create a new note, begin editing, then press Home button.
3. Launch NotePad from the home screen - the editor disappeared, only
the list displayed. This is bug #1.
4. Tap on the note and continue editing.
5. Note: if user continues repeating Home/Launch cycle, then there may
be multiple activities created
   and the application will run out of memory.
6. Press Back. Return to the list.
7. Press Back. Again see the editor! This is bug #2 (actually it is
the same bug, but customers are not aware of it and report it
separately).
8. Press Back. Return to the list.
9. Press Back. Return to the home screen.
Now the application is closed.
1. Launch NotePad from the home screen, see the list, tap on the note,
begin editing, then press Home.
2. Launch NotePad from the home screen, see the editor - this is
correct behavior.
3. Press Back. Return to the list.
4. Press Back. Return to the home screen - this is correct behavior.

Now set launchMode=singleTop
The behavior is the same as for standard

Now set android:launchMode=singleTask
Now the behavior is a bit different:
1. When installing NotePad application tap Open.
2. Create a new note, begin editing, then press Home button.
3. Launch NotePad from the home screen - the editor disappeared, only
the list displayed. This is bug #1.
4. Tap on the note and continue editing.
5. Press Back. Return to the list.
6. Press Back. Return to the home screen. OK Bug #2 is fixed.
Now the application is closed.
1. Launch NotePad from the home screen, see the list, tap on the note,
begin editing, then press Home.
2. Launch NotePad from the home screen - the editor disappeared, only
list displayed. This is bug #3.
3. Press Back. Return to the list.
4. Press Back. Return to the home screen - this is correct behavior.

Now set android:launchMode=singleInstance
The behavior is the same as for singleTask

So, every possible launchMode cause a buggy behavior.
At least this is the opinion of my customers, who are accustomed to a
more consistent behavior of applications on other mobile platforms,
which always display the last view of the application and do not
launch a new instance, like launchMode=standard does.
launchMode=standard appears to be the worst because it is not only
inconsistent, but also causes the application to run out of memory.

Launching an application is the very basic operation, which each
application must do properly.
I cannot believe that such fundamental operation is broken and no work
around is available.
If there is a work around, it must be printed in big red letters all
over the SDK documentation and the samples should be fixed as well.
But I still cannot find it.

Please, tell me how you solve this in your apps?

Thank you
John


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


[android-developers] Get a view with findViewById()

2010-11-08 Thread pedr0
Hi at all,

I try to customize a tab and I write this code:

super.onCreate(savedInstanceState){
setContentView(R.layout.main);
TabHost mTabHost = getTabHost();
Button mytab = (Button)findViewById(R.id.mybutton);
Intent browser = new
Intent(this,com.example.Browser.CWBrowser.class);
 
mTabHost.addTab(mTabHost.newTabSpec(tab_test5).setIndicator(mytab).setContent(browser));

}

The main.xml doesn't have  a child with mybutton ID, instead I have
writed a customtab.xml that contains the mybutton ID, below you can
see the files:

MAIN:XML

?xml version=1.0 encoding=utf-8?
TabHost xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@android:id/tabhost
android:layout_width=fill_parent
android:layout_height=fill_parent
android:measureAllChildren=true

LinearLayout
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent

TabWidget
android:id=@android:id/tabs
android:layout_width=fill_parent
android:layout_height=wrap_content

 /

FrameLayout
android:id=@android:id/tabcontent
android:layout_width=fill_parent
android:layout_height=fill_parent
android:padding=0px
android:layout_margin=0px


   TextView xmlns:android=http://schemas.android.com/apk/res/
android
 android:id=@+id/textview4
 android:layout_width=fill_parent
 android:layout_height=fill_parent
 android:text=Cia!

  /
/FrameLayout
/LinearLayout
/TabHost

CUSTOMTAB.XML

?xml version=1.0 encoding=UTF-8?

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

 
Button
android:id=@+id/mybutton
android:layout_height=wrap_content
android:layout_width=wrap_content
android:text=test
android:background=@drawable/buttonmarket
 /

/LinearLayout


Both files are inside the layout folder.
The problem is that when i call :
Button mytab = (Button)findViewById(R.id.mybutton);

that return null!

What's the problem? I used for other projects View that I defined in
other files instead main.xml.
Anyone cal help me?


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


[android-developers] How to create multiple View in one screen?

2010-11-08 Thread Trinh Quoc Bao
Hi all!
How to create multiple View in one screen?Help me...
Thanks you!

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


[android-developers] Get a view with findViewById()

2010-11-08 Thread pedr0
Hi at all,

I try to customize a tab and I write this code:

super.onCreate(savedInstanceState){
setContentView(R.layout.main);
TabHost mTabHost = getTabHost();
Button mytab = (Button)findViewById(R.id.mybutton);
Intent browser = new
Intent(this,com.example.Browser.CWBrowser.class);
 
mTabHost.addTab(mTabHost.newTabSpec(tab_test5).setIndicator(mytab).setContent(browser));

}

The main.xml doesn't have  a child with mybutton ID, instead I have
writed a customtab.xml that contains the mybutton ID, below you can
see the files:

MAIN:XML

?xml version=1.0 encoding=utf-8?
TabHost xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@android:id/tabhost
android:layout_width=fill_parent
android:layout_height=fill_parent
android:measureAllChildren=true

LinearLayout
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent

TabWidget
android:id=@android:id/tabs
android:layout_width=fill_parent
android:layout_height=wrap_content

 /

FrameLayout
android:id=@android:id/tabcontent
android:layout_width=fill_parent
android:layout_height=fill_parent
android:padding=0px
android:layout_margin=0px


   TextView xmlns:android=http://schemas.android.com/apk/res/
android
 android:id=@+id/textview4
 android:layout_width=fill_parent
 android:layout_height=fill_parent
 android:text=Cia!

  /
/FrameLayout
/LinearLayout
/TabHost

CUSTOMTAB.XML

?xml version=1.0 encoding=UTF-8?

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

 
Button
android:id=@+id/mybutton
android:layout_height=wrap_content
android:layout_width=wrap_content
android:text=test
android:background=@drawable/buttonmarket
 /

/LinearLayout


Both files are inside the layout folder.
The problem is that when i call :
Button mytab = (Button)findViewById(R.id.mybutton);

that return null!

What's the problem? I used for other projects View that I defined in
other files instead main.xml.
Anyone can help me?


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


[android-developers] Re: How to use NDK on Windows

2010-11-08 Thread Sergey
I have the same problem.
I try to fix it and deleted 'exit' command from ndk-build file, but
then i have another error:
target pattern contains no '%' in 82 line of setup-toolchain.mk

I think it some bug of NDK or make.exe

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


[android-developers] query sms from smsinbox

2010-11-08 Thread guoliang liang
hi all,
i have a problem querying out sms message from the smsinbox. currently
i able to display the sms messages using a listview. what i trying to
do is once the user select the msg from list view and a Toast will
display (with the msg content) once selected. pls enlighten me..
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] create the widgets?

2010-11-08 Thread tangke
hi guys.

I am a new developer in android, and I see some examples about activity,
but I don't know How can I create the widget dynamicly?

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] Context menu for other views

2010-11-08 Thread gvenugopal
Hi friends,
   I have created one music app. In this app, i have loaded albums
dynamically by using URL request and displayed as table layout. For
each table row i registered context menu. But when the context menu is
appeared by long press on each table row i could not find on which
table row the context menu is appeared. If anyone know please guide me
to solve this problem.

Thanks
venu

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


[android-developers] Problem with context menu

2010-11-08 Thread gvenugopal
Hi friends,
   I have created one music app. In this app, i have loaded albums
dynamically by using URL request and displayed as table layout. For
each table row i registered context menu. But when the context menu is
appeared by long press on each table row i could not find on which
table row the context menu is appeared. If anyone know please guide me
to solve this problem.

Thanks
venu

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


[android-developers] Should I get an Android dev phone in Canada

2010-11-08 Thread Niro Apps
hey fellow Canucks,

I was wondering if it was worth it to actually get either of the
android developer phones? They seem a little pricey and I was
wondering if I could get away with (or if its even possible) testing
on a non-developer phone (e.g. Sony Ericsson Xperia X10 offered by
rogers)?

Sorry if this question has already been asked.

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] Re: Switching orientation crashes app with larger image.

2010-11-08 Thread hoyski
I suspect an OutOfMemoryException as well.

Unless you truly need to reload the image, consider using
onRetainNonConfigurationInstance()/getLastNonConfigurationInstance()
to preserve your already loaded image when the orientation changes.

On Nov 6, 3:20 pm, Kumar Bibek coomar@gmail.com wrote:
 No exception thrown? Are you sure your logcat doesn't say anything?

 I suspect, you might be getting OutOfMemoryException.
 Have you considered scaling your image? Or, do you have to preserve
 this resolution?
 If you can scale your images, perhaps, you can avoid it.

 On Nov 6, 9:32 pm, darrinps darri...@gmail.com wrote:

  I have an application that works fine with smaller images (say
  1024x768 or so) but when you rotate the phone into a different
  orientation (say landscape to portrait) mode with a larger image on
  the screen, and then call ImageView.setImageUri() it goes into the
  BitmapFactory.class and never returns!

  So the app eventually times out. Never throws an exception, just never
  returns.

  My code looks like this

          ImageView image1 = (ImageView)
  findViewById(R.id.ImageView_HeaderPlay1);
          ImageView image2 = (ImageView)
  findViewById(R.id.ImageView_HeaderPlay2);

          image1.setAdjustViewBounds(true);
          image2.setAdjustViewBounds(true);

          //Get the max size of the device
          Display display = ((WindowManager)
  getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
          int width  = display.getWidth();
          int height = display.getHeight();
          int max = width  height ? height : width;

          max = max / 10;

          image1.setMaxHeight(max);
          image1.setMaxWidth(max);
          image1.setImageURI(selectedImageUri);

          image2.setMaxHeight(max);
          image2.setMaxWidth(max);

                  try
                  {
                          image2.setImageURI(selectedImageUri);  -DIES
  with this call

                          TextView textView = (TextView) 
  findViewById(R.id.lblEnterText);

  textView.setText(getResources().getString(R.string.image_instructions));
                  }
                  catch(Exception e)
                  {
                          Log.i(ERROR, Exception caught trying to set 
  text:  + e);
                  }
          }

  Has anyone else seen this? Sounds like a bug in the Android code more
  than something I am doing since it works fine for smaller images.

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

2010-11-08 Thread Shiraz
I've searched in various forums and sites but haven't found out
whether it's possible to develop and test apps using the Samsung
Galaxy S on Mac OSX with Eclipse?

Please can you folks share your advice and experiences?

Thanks,
Shiraz Azizali

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] reverse Geocoder (getFromLocation(lat, lnt) not reliable

2010-11-08 Thread Björn Brala
Im thinking of writing a class to use the new http geocoder of the v3 of the
API, i only read about problems online and it just won't work here... Sigh.

2010/11/8 sunny menon1...@gmail.com

 yes, it is in a try and catch and i run it within a while loop to retry if
 it fails. I also log the exception caught when it fails. its just not
 consistent. Is there a known issue with geocoder ?
 thanks
 Sunny.

 On Tue, Nov 2, 2010 at 8:03 AM, TreKing treking...@gmail.com wrote:

 On Tue, Nov 2, 2010 at 12:36 AM, sunny menon1...@gmail.com wrote:

 any tips?


 Base on posts I've seen, I think people employ workarounds like wrapping
 the call in a try catch and trying to get a valid value 3 or so times,
 waiting a second or so between each attempt, to try to get a good value
 before giving up and reporting an error.


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

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




-- 
Bjorn Brala

www.GeoStart.nl/english/ - Google maps - Swis Webdesign
www.twitter.com/bbrala

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

[android-developers] system crash when enable mock location on My Samsung i9000 2.2(ZSJPE)

2010-11-08 Thread Evan
Dear all
I got a crash from logcat when I enable mock location in my program.
when I call enableMockLocation(true) but no update,the system is crash
and reboot.
the same program is working on 2.1(ZSJG4)

Exeception:

11-08 15:57:23.474: ERROR/AndroidRuntime(7336): *** FATAL EXCEPTION IN
SYSTEM PROCESS: GpsLocationProvider
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):
java.lang.NullPointerException
11-08 15:57:23.474: ERROR/AndroidRuntime(7336): at
com.android.internal.location.GpsLocationProvider$HybridGps.access
$900(GpsLocationProvider.java:1676)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336): at
com.android.internal.location.GpsLocationProvider.stopNavigating(GpsLocationProvider.java:
1227)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336): at
com.android.internal.location.GpsLocationProvider.handleEnableLocationTracking(GpsLocationProvider.java:
968)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336): at
com.android.internal.location.GpsLocationProvider.access
$7600(GpsLocationProvider.java:116)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336): at
com.android.internal.location.GpsLocationProvider
$ProviderHandler.handleMessage(GpsLocationProvider.java:2224)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336): at
android.os.Looper.loop(Looper.java:123)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336): at
com.android.internal.location.GpsLocationProvider
$GpsLocationProviderThread.run(GpsLocationProvider.java:2263)

the partial code is:
public void enableMockLocation(boolean bEnable) {

m_bMockLocation = bEnable;
if(m_bMockLocation)
{
Log.e(LOG_TAG, enableMockLocation 01);
m_Handler.obtainMessage(MSG_TOAST,Mock location
enable.).sendToTarget();
m_LocationManager.addTestProvider(m_szMockProvider,
false,// requiresNetwork
true,// requiresSatellite
false,// requiresCell
false,// hasMonetaryCost
false,// supportsAltitude
false,// supportsSpeed
false,// supportsBearing
0,// powerRequirement
5);   // accuracy
Log.e(LOG_TAG, enableMockLocation 03 +
m_szMockProvider);
m_LocationManager.setTestProviderEnabled(m_szMockProvider,
true);
Log.e(LOG_TAG, enableMockLocation 04 +
m_szMockProvider);

}else
{
m_Handler.obtainMessage(MSG_TOAST,Mock location
disable.).sendToTarget();
m_LocationManager.setTestProviderEnabled(m_szMockProvider,
false);
 
m_LocationManager.clearTestProviderEnabled(m_szMockProvider);
 
m_LocationManager.clearTestProviderLocation(m_szMockProvider);
 
m_LocationManager.clearTestProviderStatus(m_szMockProvider);
m_LocationManager.removeTestProvider(m_szMockProvider);

}
}



any suggestion?
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] database not accessing first id

2010-11-08 Thread MANVI AGARWAL
hi,
i have a problem that in my application, i have developed database in sq
lite where it not accessing and updating my first id or entry of data from
application in android..

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

[android-developers] Ajax cross domain requests

2010-11-08 Thread ff
Hi,

the behavior of XMLHttpRequests in Android is very odd when doing
cross domain requests. The browser should either fail with an error
and not perform the request, or it should follow CORS (http://
www.w3.org/TR/access-control/) and start with an OPTIONS request to
the remote domain. The Android browser (2.1 and 2.2) instead performs
the request, which is received by the remote server (and this is the
dangerous part both for data leaking and remote attacks), but the
response is not set in the javascript (status of 0 and responseText
null)

bye

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