[android-developers] Re: Android talking to computer

2012-08-14 Thread Paul Turchenko
All Android devices use ADB to talk to computer

On Tuesday, August 14, 2012 2:27:53 PM UTC-5, bob wrote:

 Let's say I have an Android phone, and it is connected by USB to a PC.  Is 
 there an easy way to make it talk to the PC by USB?  For instance, it might 
 send a camera image to the PC every five minutes.




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

2012-06-13 Thread Paul Turchenko
Try implementing your own Drawable. This way you could draw spinner while 
actual image loads. As soon as you have image to display, your drawable 
could handle that as well. Use setImageDrawable() call to apply.

On Tuesday, June 12, 2012 2:04:28 AM UTC-5, Karakuri Dev wrote:

 *Short version*: Can I use the indeterminate progress spinner as the 
 source image for an ImageView?

 *Long version*: I have an ImageView with a custom background (it's 
 actually a custom widget that extends ImageView and implements extra 
 drawing in onDraw). While the source image is loading, I want to show the 
 indeterminate progress spinner. Thus far all the solutions I've seen have 
 involved rotating the entire ImageView, which I cannot use for this. I've 
 tried replicating the drawable xml used by the system and setting that as 
 the source image, but the result is always a static image that doesn't 
 spin. Is there some way to set a rotating drawable as the source image?

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

2012-05-15 Thread Paul Turchenko
Use Fragments

On Tuesday, May 15, 2012 5:05:17 AM UTC-5, Narendra Singh Rathore wrote:

 Hi all, 
 Is this possible to check the current contentView?

 As in my code, I am using a single activity, along with three different 
 content views (using setContentView()), which I am changing according to my 
 requirement.
 All is working fine till now.

 Now, what I want is that - when *clicking the back button, I want to 
 check the current view (content view)*, and proceed further depending on 
 the view.

 How can I achieve this if it is possible?


 Here is my java code, as follows:



 package com.test;


 import android.app.Activity;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.AdapterView;
 import android.widget.AdapterView.OnItemClickListener;
 import android.widget.ArrayAdapter;
 import android.widget.Button;
 import android.widget.ListView;

 public class Test_appActivity extends Activity implements OnClickListener, 
 OnItemClickListener{
 /** Called when the activity is first created. */
 ListView lv;
 Button btn1,btn2;
 String[] str=new String[]{one,two};
 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
first_view();
   
 }
 
 public void first_view()
 {
  setContentView(R.layout.main);
  lv=(ListView)findViewById(android.R.id.list);
  lv.setTextFilterEnabled(true);
  ArrayAdapterString adapter= new 
 ArrayAdapterString(getApplicationContext(), 
 android.R.layout.simple_list_item_1,str);
 lv.setAdapter(adapter);
 lv.setOnItemClickListener(this);
 }

 public void onClick(View v) {
 first_view();
 
 }

 //@Override
 //public void onBackPressed() {
 //
 if(findViewById(android.R.id.content).equals((View)this.findViewById(R.layout.one))
 //|| 
 findViewById(android.R.id.content).equals((View)this.findViewById(R.layout.two)))
  

 //{
 //first_view();
 //}
 //else
 //{super.onBackPressed();
 //}
 //}

 public void onItemClick(AdapterView? arg0, View arg1, int arg2, long 
 arg3) {
 
 if(arg2==0)
 {
 setContentView(R.layout.one);
 btn1=(Button)findViewById(R.id.btn);
 btn1.setOnClickListener(Test_appActivity.this);
 }
 else
 {
 setContentView(R.layout.two);
 btn2=(Button)findViewById(R.id.btn1);
 btn2.setOnClickListener(Test_appActivity.this);
 }
 }


 }
  

 Please, help me out in this.

 With Regards,
 Narendra


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

2011-11-28 Thread Paul Turchenko
Only if you are part of firmware

On Nov 28, 8:27 pm, Goodwin purerain2...@163.com wrote:
 I have a doubt. if that,there are two home screens,and the user must
 choose one in the alert dialog.
 it is not convenient. is there any way to start  his application
 only ?

 On Nov 29, 7:00 am, Mark Murphy mmur...@commonsware.com wrote:







  On Fri, Nov 25, 2011 at 9:06 AM, AlexBonel bonela...@gmail.com wrote:
   Good afternoon. Tell me, anybody please, is it possible to start my
   application after device's startup without viewing Home Screen?

  Make your application be the home screen.

  --
  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] Re: plz help....

2011-10-12 Thread Paul Turchenko
Place your *.apk in /system/app/

On Oct 12, 6:04 am, Divyata Panchal panchal.divyat...@gmail.com
wrote:
 how to stop uninstallation of any application in android...?

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

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

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

 Thank you for your reading.

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


[android-developers] Re: Json - 2 Emulators

2011-10-07 Thread Paul Turchenko
Why not use tcpip to do that? Just setup port forwarding in adb

On Oct 6, 9:35 pm, Diogo Salaberri caxix...@gmail.com wrote:
 Hello guys, I want to transfer data from a emulator to another emulator,
 running on the same machine. But when the SMS was received, the message
 isn't like the message was send. Looks like a encode problem.

 1) Is other method to do this data transfer ?

 2) Over SMS, this is a recognized problem ?

 Thanks, bye.

 --
 Atenciosamente;
 Diogo Bonoto Salaberri
 Bacharel em Ciência da Computação - UFPel
 Compasso - Software Developer

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

2011-08-19 Thread Paul Turchenko
Nobody tells you to freeze the UI thread. Dig into source code, see
how Handlers, Looper and MessageQueue works and you'll get an idea how
you can implement everything on UI thread without having it frozen.
It's all about that.

On Aug 19, 6:35 am, Snowak psno...@gmail.com wrote:
 What a wonderful answer. It's a great idea to answer everything with
 you don't know what you're doing and tell me to do it using worst
 possible method. Yeah, let's freeze the UI thread. It's gonna be cool.

 On 17 Sie, 23:17, Mark Murphy mmur...@commonsware.com wrote:







  On Wed, Aug 17, 2011 at 12:44 PM, Snowak psno...@gmail.com wrote:
   I have hundreds of CheckBox widgets in my layout

  That is unlikely to be a good idea.

   Obviously such heavy work should be done in separate thread,

  Not really.

   The only thing that this thread actually can do is looping through the
   list and posting the Runnable for every found checkbox. The problem is
   that all those Runnables arrive in the UI thread almost at the same
   time, thus they're all executed at once... The application behaves
   exactly like I would run the above code in the UI thread - everything
   freezes. A possible solution is sleeping for some miliseconds after
   each checkbox so the Runnable can be executed and the UI will have
   time to process the events... but it's more like a hack.

   How can I solve this problem?

  Redesign your UI to not have hundreds of CheckBox widgets at once.
  Or, update them on the main application thread and hope for the best.

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

  _Android Programming Tutorials_ Version 3.9 Available!

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


[android-developers] Re: Candle Stick Graph in Android??

2011-08-09 Thread Paul Turchenko
http://www.artfulbits.com/products/android/aiCharts.aspx

On Aug 9, 1:04 pm, Thulasi thulas...@gmail.com wrote:
 Hi,

 Is there any good Candle Stick graph libraries for android..??

 i managed to find couple of evaluatory versions.. not sure if there is a
 tested charting library for Candle Stick in Android..??

 Any comments or solutions is highly appreciated..

 thanks
 thulasi.

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

2011-08-08 Thread Paul Turchenko
http://www.artfulbits.com/products/android/aiCharts.aspx

On Aug 8, 12:45 am, niki nikhil2...@gmail.com wrote:
 how to make chart component 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: close cursor

2011-08-04 Thread Paul Turchenko
Make sure yoy are not reopening batabase after you've opened it.

On Aug 4, 1:19 am, Dev_red sktniranjanad...@gmail.com wrote:
 Thank you very much.

 but i am getting this error..

 Finalizing a Cursor that has not been deactivated or closed.
 database = /data/data/com.android.myproject/databases/sampleDB, table
 = n
 ull, query = select * from TableName
 E/Cursor  (  863):
 android.database.sqlite.DatabaseObjectNotClosedException: App
 lication did not close the cursor or database object that was opened
 here

 On Aug 3, 5:59 pm, Vladimir Svydenko vov...@gmail.com wrote:



  Hi,
  If You close cursor inside this method - it will return null.

  So, You do not need here closing cursor.
  Here You can get data from cursor and then close it.

  regards

  On Aug 3, 2:56 pm,Dev_redsktniranjanad...@gmail.com wrote:

   hi

   How to close cursor in following method? where i have to add
   cur.close()?

        Cursor getData()
            {
                    SQLiteDatabase sdb=this.getWritableDatabase();

                   Cursor cur = sdb.rawQuery(select * from  + 
   manpowerLUTable,null);
                    if (cur != null)
                    {
                            cur.moveToFirst();
                    }
                    sdb.close();
                   return cur;
            }

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

2011-08-04 Thread Paul Turchenko
Look at
http://developer.android.com/reference/android/Manifest.permission.html#KILL_BACKGROUND_PROCESSES

But I do agree with Mark. Please don't write anything like that.

On Aug 4, 5:20 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Thu, Aug 4, 2011 at 2:12 PM, vinaykant vinaykant.s...@gmail.com wrote:
  I am new baby in android development and developing an application
  which will KILL a running application (ex. com.example.helloWorld).

 Please don't.

  I tried process.getruntime().exec(kill -9 211), here 211 is the pID
  which I am able to get.

  But the process.getruntime().exec command giving me permission error
  as the current user is not having permission.

 Correct. You can't kill processes.

  Please can any one help me out to get the permission through the
  programmatic ?

 You can't.

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

 Android Training in NYC:http://marakana.com/training/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: How Android Market's OTA works?

2011-08-01 Thread Paul Turchenko
It's push. Android market (vending process on your device) keeps
passive connection with Android Market server. Same way Gmail app
works. This is why email delivery is instant.

On Aug 1, 7:23 pm, Jose_GD jose.gonzale...@gmail.com wrote:
 Hi all,

 I'm wondering how the Android Market's web app communicates with the
 associated phone to initiate the installation of a new app in devices.
 I'm pretty sure it's not Cloud to Device Messaging, because my Eclair phone
 works perfectly with this feature and C2DM is for Froyo + devices.

 Is it just a service polling the Android Market server at regular intervals?

 TIA,

 José

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: inApp soundgeneration possible without heavy use of CPU ?

2011-08-01 Thread Paul Turchenko
First guess: have you tried moving heavy stuff to C/C++ and linking
via JNI?

On Jul 31, 3:35 pm, Peter Pippinger pe...@pippinger.de wrote:
 Hello,

 I have now completed my first app 
 (https://market.android.com/details?id=com.pippinger.android.frogthisw...).
 For the music I was working withhttp://www.warmplace.ru/soft/sunvox/which
 is a very powerful synthesizer in my opinion.
 I think the chiptunes-style fits best for android-apps.
 On the other side it takes much memory for having long music in the app if
 you are insert it by .ogg or something like that.

 So my question: is it possible to do some synthesizer-calculation in Java
 for the music with not to much CPU-consumption?
 Maybe you have some links (maybe also to some apps which are doing something
 like this)?

 Thanks a lot and kind regards,
 Peter

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

2011-08-01 Thread Paul Turchenko
Omg! Are you serious?

On Jul 30, 11:37 am, ajaykumar kanchak ajaykumar.kanc...@gmail.com
wrote:
 you need arrange the things like for example u may used only for
 drawable ldpi, only but having mdpi ldpi hdpi so u have check out the
 things may be it may work only landscape make it as potrait and take
 resolutions dynamically it may fix only for some screens.

 On Jul 30, 9:27 pm, bob b...@coolgroups.com wrote:



  My stuff is getting really low ratings partly because it doesn't work
  on certain phones.

  Can someone take a look at my app here and help me figure it out?

 https://market.android.com/details?id=com.coolfone.sonicboomfeature=...

  If you have an HTC Eris, this would be especially helpful.

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

2011-07-23 Thread Paul Turchenko
Press scroll lock button on a keyboard :)

On Jul 23, 2:16 pm, TreKing treking...@gmail.com wrote:
 On Sat, Jul 23, 2011 at 2:11 PM, freeanderson freeander...@gmail.comwrote:

  please stop logcat 'autoscroll' or please make its option.

 It is an option. If you scroll to the bottom of the log, it autoscrolls. If
 you scroll up even one tick, it stops autoscrolling.

 -
 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: Help me to create my application(data to be edited real time)

2011-07-15 Thread Paul Turchenko
GO thru SDK samples. They will give you generic idea of how that could
be implemented.

On Jul 15, 7:54 am, julious raj julious...@gmail.com wrote:
 I want to create an application which stores the given data such as
 name, DOB, address, mail, and etc., into sqlite database and then goes
 to another activity and that activity shows the data like tableview .
 i've done this by listing data in listview in column. But it is not
 aligned well. the address field is not synchronized with name. My aim
 is to edit the data in real time(means when i press long in a row it
 must be editable ) and update the edited data to sqlite database.

 Any one please help me. Give me ideas how to do it?

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


[android-developers] Re: GridView with ToggleButton

2011-06-20 Thread Paul Turchenko
You will have to supply Adapter for GridView in order to work.
Consider setting CHOICE_MODE_MULTIPLE as I assume you can have
multiple items toggled.

On Jun 19, 6:21 pm, Vault lord.va...@gmail.com wrote:
 Hello,
 I'm trying to obtain something 
 like:http://s4.appbrain.com/screen?id=-1118678252346788544i=2
 but only with ToggleButtons in a Grid. I've googled around but found
 nothing, so here I am kindly asking for help.

 I thought something like:

 GridView
   ToggleButton
   ToggleButton
   ToggleButton
 /GridView

 could work, but it's not. What's the right way to do that?

 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: Want to capture screenshot of current screen from phone

2011-06-02 Thread Paul Turchenko
Your process will need permission to do that. ADB has it by default,
but regular apps don't. Unless you're rooted, you can't do that.

On Jun 2, 4:27 am, Bharathiraja R bharathiraja.andr...@gmail.com
wrote:
 Hi All,

 Want sample code to capture screenshot of current screen from phone,
 same like ddms (screen capture).
 Please help me out.

 Regards,
 Bharathiraja R

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


[android-developers] Re: a question of message hooking

2011-05-30 Thread Paul Turchenko
What you mention here is a thread starving. Generally, there are 2
solutions you can think of:
1. Don't send message to UI thread until prevoius one was dispatched
2. Remove message from UI thread before sending a new one

The mode you choose is up to implementation and depends on how
important is message that is already in UI thread's queue.

On May 30, 2:59 am, Xie Daniel jasic2...@gmail.com wrote:
 I have a scenario like this :

 A1 Thread(GUI thread) and A2 thread.

 A2 thread regularly sends msg to A1 to update GUI showing .

 But frequent msg sending might lead to the msg accumulation in A1
 Queue because A1 might not handle these messages in a short manner.
 Then, some msgs like onDestroy come and is not handled in time ...

 Currently , I am going to peek msgs in A1 thread queue and dispatch
 some specified msgs with high priority.  Therefor , I hope to hook all
 msgs in A1 thread , including system msg

 Based on this soution ,a handler is customized for
 hook.. .Unluckily , it only captures the msgs with handle directed
 to itself , excluding the so-called system message .

 Would you like to share some ideas to capture ALL messages ,
 regardless of ones sent by A2 or system ... Thanks

 BRs
 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] Re: Is there a walkthrough for extending View, especially for the XML layout files?

2011-05-16 Thread Paul Turchenko
Mention full package name in your XML file.
Like:
com.mypackage.views.ResettableChronometer
android:layout_width=fill_parent
android:layout_height=fill_parent/

On May 15, 1:59 am, Brian Carmicle brian.carmi...@gmail.com wrote:
 Right now, I'm trying to extend Chronometer (1) with a class called
 ResettableChronometer. When I try to use it, however, my app crashes
 because it couldn't inflate ResettableChronometer from the XML
 layout file I was using for that Activity. I've found some general
 documentation on Views (2), which references LayoutInflater, but I'm
 having trouble understanding how this all works (I'm new to Android).
 Is there some sort of tutorial or walkthough that can help me
 understand how to do this?

 (1)http://developer.android.com/reference/android/widget/Chronometer.html
 (2)http://developer.android.com/reference/android/view/View.html
 (3)http://developer.android.com/reference/android/view/LayoutInflater.html

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


[android-developers] Re: Lag problem

2011-05-02 Thread Paul Turchenko
Seriously?

On Apr 30, 10:06 am, Fadil Kamal fadilkama...@gmail.com wrote:
 how to accelerate the performance of my phone?
 sometimes my phone lags
 how to fix it?

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


[android-developers] Re: how to accelerate the performance of my phone?

2011-05-02 Thread Paul Turchenko
Why are you asking the same question all over the group?

On Apr 30, 10:02 am, Fadil Kamal fadilkama...@gmail.com wrote:
 how to accelerate the performance of my phone?
 sometimes my phone lags even force close
 how to fix it?

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


[android-developers] Re: How to get the text height

2011-04-30 Thread Paul Turchenko
decent()-acent()

On Apr 30, 5:49 am, a a harvey.a...@gmail.com wrote:
 paint.measureText(text)  return the width, how can i get the height
 of the text?

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


[android-developers] Re: How to install Sense UI into my HTC Magic

2011-04-24 Thread Paul Turchenko
What you are asking for is custom firmware. It IS possible to have HTC
Sense on your device (I had HTC Magic 32B before and it was running
Sense). You should spend couple days making yourself familiar with
rooting, flashing, changing bootloader or/and SPL. Good place to start
is xda dev. forum. These guys rock. Firmware procedures will void your
warranty so be careful.
Honestly, this forum is a bad place to ask questions like that. Go to
xda and read-read-read.

Paul.

On Apr 24, 12:41 am, Nicholas Key nicholaskeythole...@gmail.com
wrote:
 Hi Android Dev group members,

 I've been searching high and low about installing Sense UI into my HTC
 Magic (the one that is loaded with Google ION) but couldn't find any
 relevant search results. This is the closest I could 
 find:http://developer.htc.com/google-io-device.html

 There are several terms that I do not understand, namely - root,
 flash, wipe. My question would be, is it even remotely possible to
 install Sense UI into my HTC Magic (I got that Magic phone from Google
 IO conference).

 Nicholas

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

2011-04-22 Thread Paul Turchenko
$your_sdk_dir$/Android/platforms/android-8/ant

On Apr 14, 6:58 am, luiX_ lui...@gmail.com wrote:
 please, can you provide a link?

 thx :D

 2011/4/14 Paul Turchenko paul.turche...@gmail.com







  see sdk. They have all ant scripts implemented there.

  On Apr 12, 9:14 pm, Sam samira_hi...@hotmail.com wrote:
   Hi,

   I'm setting up an automated build system using Ant, for our Android
   project.

   As a starting point, I've simply exported the required build.xml
   through Eclipse.

   If I clean the project, and run ant in the command line at the root
   of the our Android project, I receive the following compile error:
   package R does not exist

   On the other hand, if I build the project through Eclipse, then the
   R.java is generated for me.

   How can I have my Ant build generate R.java for me?

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

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


[android-developers] Re: Mouse events on table layout

2011-04-22 Thread Paul Turchenko
Intercept onTouch event

On Apr 21, 8:18 am, swetha akkina.swe...@gmail.com wrote:
 Hi,

 I am developing a sample application, in which I need to handle mouse
 events on table layout. Could you please let me know how to proceed
 further.

 Thanks in advance.

 Regards,
 Swetha

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


[android-developers] Re: C2DM notification delivery is unpredictable

2011-04-21 Thread Paul Turchenko
Update your radio firmware

On Apr 20, 4:06 pm, JohnC fayv...@gmail.com wrote:
 I have been researching for a long while and getting nowhere.  Many
 have asked along the lines of: What is the sanity behind the C2DM
 message delivery delay?  The delay, as slows as 30 minutes, is always
 attributed to the first message, because once it's received then
 subsequent messages are delivered within seconds. I'm always using 2G/
 3G mode (never on WiFi) so I wouldn't expect the radio to go to sleep.
 Or, does it?  Even after I open the browser to wake up the radio, I
 still wouldn't get the notification until 20 minutes later.

 So, the million dollar question is: Why is the first message taking so
 long to get delivered from my server to the phone?  This delay issue
 seems to affect other apps too, like Chrome to Phone.

 I'm testing on the G2 HTC phone.  Anyone with any insight is really
 appreciated.  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: Unable to start a service from a Broadcast Receiver

2011-04-14 Thread Paul Turchenko
Are you starting activity that starts the service? Your logcat shows
that having activity thread. If it's not true, try sending pending
intent to start a service. That might be a workaround, but that should
get you moving.

On Apr 12, 2:14 pm, Te-Yuan Huang huan...@gmail.com wrote:
 Hi all,

 I am trying to start a service when the system boots up (no activity
 involved).
 I have a BroadcastReceiver listening to the ACTION_BOOT_COMPLETE
 intent, then start a service inside the onReceive function.
 From the log, I can see the BroadcastReceiver received the intent
 properly.

 However, when it tries to start a service through
 context.startService();
 The system complains cannot initiate the service:

 D/dalvikvm( 1393): newInstance failed: Lnet/startup/DispatchService;
 not accessible to Landroid/app/ActivityThread;
 D/AndroidRuntime( 1393): Shutting down VM
 W/dalvikvm( 1393): threadid=1: thread exiting with uncaught exception
 (group=0x4001d7e0)
 E/AndroidRuntime( 1393): FATAL EXCEPTION: main
 E/AndroidRuntime( 1393): java.lang.RuntimeException: Unable to
 instantiate service net.startup.DispatchService:
 java.lang.IllegalAccessException: access to class not allowed
 E/AndroidRuntime( 1393):        at
 android.app.ActivityThread.handleCreateService(ActivityThread.java:
 2943)

 I have been googling all night and this morning, but still couldn't
 understand where went wrong.
 Is there any other permission I should set, so that the
 BroadcastReceiver can start the service?
 Note: the BroadcastReceiver and the Service is under the same
 package.

 Great thanks for any help.

 -Te-Yuan

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

2011-04-14 Thread Paul Turchenko
Use adb to do that

On Apr 11, 10:12 pm, beeleo qf8@gmail.com wrote:
 I want to send message from my android applications to application on
 pc (like android as client, pc as server) , how can I connect the pc
 actively?  the android doesn‘t know the pc's ip, isn't it?

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


[android-developers] Re: Can the WebView contains another view?

2011-03-31 Thread Paul Turchenko
Nope.

On Mar 31, 3:13 am, ydm jordanmiladi...@gmail.com wrote:
 Hello, all!
 Is there a way to add another view inside a WebView?

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

2011-03-22 Thread Paul Turchenko
getScrollX() and getScrollY() methods should work for you (they have
other methods to access mLeft, mRight, etc.)

On Mar 22, 11:13 am, argongold argongol...@gmail.com wrote:
 Hi,

 I want to format my text for shortcuts as done in launcher
 application.  I've tried to copy BubbleTextView.java class directly
 to my sdk project. but following parameters couldn't resolved
 mLeft,mRight,mTop,mBottom and I could find in launcher package
 where these parameters are initialized Beside this mScrollX also not
 found.

 Below link says I should be able to compile this class under sdk . but
 how?http://stackoverflow.com/questions/4649597/android-format-textview

 Is any body faced such issue previously and resolved?

 regards,
 argon

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

2011-01-16 Thread Paul Turchenko
Define INTRNET permossion in your manifest :)

On Jan 16, 9:47 am, Dan king...@gmail.com wrote:
 Thanks for the tips guys but none of these have solved the issue.

 On Jan 13, 10:39 pm, Rohan Dhamal rohandha...@gmail.com wrote:







  Hi,

     Please check once, if there is any timeout occurring while
  connecting with HttpURLConnection.

  On Jan 13, 1:23 am, Ankur Avlani ankuravl...@gmail.com wrote:

   True, I agree with what you say.  Its just that I feel, other apps should
   also break or give error.

   Anywayz, Thanks a lot for your inputs.

   regards,
   Ankur.

   On Wed, Jan 12, 2011 at 12:17 PM, Brill Pappin br...@pappin.ca wrote:
Well i suppose thats possible if your messing with the network stack,
but it's pretty low level for Java/Android.
I guess its also possible that the Android version you have has a
crappy stack or driver... or you have rooted it and have been messing
around under the covers so to speak.

There is nothing in Android really that would allow you to mess it up
that badly AFAIK, so I doubt it's your application causing the problem
if your not specifically getting under the covers.

However, the meaning of the exception is clear:

   http://download.oracle.com/javase/1.4.2/docs/api/java/net/UnknownHost...
and your app doesn't really control the process of translating a
domain to an ip.

- Brill Pappin

On Jan 12, 2:54 pm, Ankur Avlani ankuravl...@gmail.com wrote:
 Somehow I have this feeling it is related to my app only.  Other apps 
 on
the
 phone, I don't see any such issue.  Even when browsing on my phone, I
don't
 see any error.

 On Wed, Jan 12, 2011 at 11:41 AM, Kumar Bibek coomar@gmail.com
wrote:
  By Wi-Fi, I meant, you phone's Wi-Fi could be turning on and off. 
  There
is
  no other reason I can think of. It happens for me as well, 
  sometimes.

  Kumar Bibek
 http://techdroid.kbeanie.com
 http://www.kbeanie.com

  On Thu, Jan 13, 2011 at 1:10 AM, Ankur Avlani ankuravl...@gmail.com
wrote:

  I am sorry, that somehow doesn't convince me.  I am connected to 
  the
same
  wifi on my laptop and i never see any web page load error on my
laptop.

  On Wed, Jan 12, 2011 at 11:38 AM, Kumar Bibek coomar@gmail.com
wrote:

  Yup, then it's a problem with your Wi-Fi.

  Kumar Bibek
 http://techdroid.kbeanie.com
 http://www.kbeanie.com

  On Thu, Jan 13, 2011 at 1:07 AM, Ankur Avlani 
  ankuravl...@gmail.com
wrote:

  I am connected to network, I am on Wifi.  If i try again it 
  works.
 Its
  just random.

  On Wed, Jan 12, 2011 at 11:34 AM, Kumar Bibek 
  coomar@gmail.com
wrote:

  This error/exception comes because of no network connectivity.

  Kumar Bibek
 http://techdroid.kbeanie.com
 http://www.kbeanie.com

  On Thu, Jan 13, 2011 at 1:02 AM, Ankur Avlani 
ankuravl...@gmail.comwrote:

  Hi All,

  I am developing an application on Android.  I have seen that at
times
  when I try to connect using HttpURLConnection, for getting an
Image or
  anydata, I get the following error:

  01-12 11:24:05.073: WARN/System.err(16780):
  java.net.UnknownHostException: Host is 
  unresolved:www.XXX.com:80.

  Note: I get this error on my Motorolla Droid and not in 
  emulator.

  Any ideas?

  Thanks,
  Ankur

   --
  You received this message because you are subscribed to the 
  Google
  Groups Android Developers group.
  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%2Bunsubs
   cr...@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%2Bunsubs
   cr...@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%2Bunsubs
   cr...@googlegroups.comandroid-developers%2Bunsubs
cr...@googlegroups.com
  

[android-developers] Re: Using Proguard on an app created with an earlier version of the Plugin/SDK.

2010-12-08 Thread Paul Turchenko
If you're building it via ADT then that's what you need.

On Dec 8, 6:57 pm, George  Moschovitis george.moschovi...@gmail.com
wrote:
 I would like to use proguard on an app created with an earlier version
 of the Eclipse plugin/SDK.
 Should I just copy the proguard.cfg file and update my
 default.properties file or should I follow a more complex procedure?

 thanks in advance for your help,
 -g.

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

2010-12-04 Thread Paul Turchenko
Can you post a code you use to create pending intent?

On Dec 3, 1:18 am, CrazyH huang...@gmail.com wrote:
 Hi,

 I am trying to get buttons to work in notification expanded view.  The
 goal is to use the buttons to launch activities from the notification
 view.  Is this even supported?  Here is a very simple outline with
 irrelevant details omitted:

 1.  Create a RemoteView object using a layout with some ImageButtons.
 2.  Create pending intent for each button and set them using
 RemoteView.setOnClickPendingIntent(...)
 3.  Create a Notification object and set it's contentView as the
 RemoteView created in step 1.
 4.  Set Notification object's contentIntent.
 5.  Send the Notification.

 This works beautifully on my Droid X.  I can click on each button and
 launch it's associated activity successfully.

 This works on my pal's Evo 4G as well, except that it launches the
 button's intent plus the notification's content intent.  So two
 intents launched.  But I can deal with that.

 This also works on HTC Incredible.

 Unfortunately, it doesn't work on most other phones:  Vibrant, Hero,
 Vision, WildFire, MIleStone, Droid 1.  These are the ones I know so
 far based on user feedback.  On these phones, only the notification
 contentIntent is being launched.  It appears the button's click events
 aren't being captured/detected.

 I am at my wit's end trying to work around this.  I am beginning to
 think it's impossible, but it works on some phones!  Any suggestion/
 help is appreciated.

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

2010-12-04 Thread Paul Turchenko
I would go with custom layout manager: extend ViewGroup, override
onLayout method and provide your own layout logic.

On Dec 4, 3:26 pm, P.N. peter.nabbef...@gmx.de wrote:
 Hello!

 Is there any layout to achieve this:
 - 5 rows with 3 columns;
 - every row 20% of display height;
 - first and third column 25% of display width, second is 50%;
 - child views (buttons) in second and fourth row, second column?

 I've tried to use TableLayout, but it doesn't work as expected.
 Especially, when trying to set android:layout_height='fill_parent' for
 all TableRows, only the first row is expanded and the others are missing.

 Kind regards

 Peter

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

2010-11-29 Thread Paul Turchenko
Yes it does. having setScrollX and setScrollY methods the view will
translate canvas upon drawing. This is how you get it scrolled
automatically. Consider looking into the source code to make these
things more clear for yourself.

On Nov 10, 7:40 am, kavitha b kkavith...@gmail.com wrote:
 No,it is not scrolling.

 Can anybody provide me an example of drawing bitmaps to a scroll custom
 view.

 It is very urgent.

 Please help.

 Thanks
 Kavitha

 On Wed, Nov 10, 2010 at 6:15 AM, Paul Turchenko 
 paul.turche...@gmail.comwrote:

  View scrolls the bitmap for you.

  On Nov 10, 12:29 am, kavitha b kkavith...@gmail.com wrote:
   Hi All,

   I am creating a CustomView with bigger image based on tutorial on and
   developers forum.

   It is scolling fine.I need exact pixel coordinates of my image.I am
  getting
   that also.

   now I want to draw some images upon scrolling image.I am able to draw
  images
   using onDraw().But images are not getting scrolled.Any idea how to
  resolve
   this?

   My code is

   public class LargeImageScroller extends Activity {

       // Physical display width and height.
       private static int displayWidth = 0;
       private static int displayHeight = 0;
       private static VectorSquare squares;
       private static VectorTile tiles;

       /** Called when the activity is first created. */
       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);

           // displayWidth and displayHeight will change depending on screen
           // orientation. To get these dynamically, we should hook
   onSizeChanged().
           // This simple example uses only landscape mode, so it's ok to
  get
   them
           // once on startup and use those values throughout.
           Display display = ((WindowManager)

  getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
           displayWidth = display.getWidth();
           displayHeight = display.getHeight();

           squares=Util.generateBoardSquares();
           tiles=Util.generateTiles(this);

           // SampleView constructor must be constructed last as it needs
  the
           // displayWidth and displayHeight we just got.
           setContentView(new SampleView(this));
       }

       private static class SampleView extends View {
           private static Bitmap bmLargeImage; //bitmap large enough to be
   scrolled
           private static Rect displayRect = null; //rect we display to
           private Rect scrollRect = null; //rect we scroll over our bitmap
   with
           private int scrollRectX = 0; //current left location of scroll
  rect
           private int scrollRectY = 0; //current top location of scroll
  rect
           private float scrollByX = 0; //x amount to scroll by
           private float scrollByY = 0; //y amount to scroll by
           private float startX = 0; //track x from one ACTION_MOVE to the
  next
           private float startY = 0; //track y from one ACTION_MOVE to the
  next

           private final int boardHeight=480-150;
           private static Tile movingTile=null;

           public SampleView(Context context) {
               super(context);

               // Destination rect for our main canvas draw. It never
  changes.
               displayRect = new Rect(0, 0, displayWidth, boardHeight);
               // Scroll rect: this will be used to 'scroll around' over the
               // bitmap in memory. Initialize as above.
               scrollRect = new Rect(0, 0, displayWidth, boardHeight);

               // Load a large bitmap into an offscreen area of memory.
               bmLargeImage = BitmapFactory.decodeResource(getResources(),
                   R.drawable.woodstandardboard);
           }

           @Override
           public boolean onTouchEvent(MotionEvent event) {

               switch (event.getAction()) {
                   case MotionEvent.ACTION_DOWN:
                       // Remember our initial down event location.
                       ///validating for tile touch
                       int touchx=(int)event.getX();
                       int touchy=(int)event.getY();
                       for(int i=0;itiles.size();i++){
                           Tile tile=tiles.get(i);
                           if(tile.isTouched(touchx, touchy)){
                               tile.setX(touchx);
                               tile.setY(touchy);
                               movingTile=tile;
                               invalidate();
                           }
                       }

                       if(movingTile != null){

                           break;
                       }

                       if((int)event.getY()  boardHeight){
                           break;
                       }
                       startX = event.getRawX();
                       startY = event.getRawY();
                       break;

                   case

[android-developers] Re: Getting System Colours

2010-11-17 Thread Paul Turchenko
Default views will uses default system colors.

On Nov 17, 4:44 pm, Simon  Dean sjd...@gmail.com wrote:
 I've seen references on how to SET system colours, but I need to find
 out how you GET them - how do you find out what they are?

 On the Samsung Galaxy S for example, the Tab views, the ListView
 highlights, Menu Items and Summary line on the Preference Screen are
 all blue.

 There are many apps which immitate the style of the Preference Screen
 and I want to do the same. Obviously I cannot just hard code and set
 the colour to Blue, as other handsets use different colours.

 The question is, is there a way to programmatically find out what
 colour the Preference Screen Summary Line, Tabs, or ListView
 selections are, so that you can then set that against a TextView
 elsewhere in your app?

 How do I get the android system colours?

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

2010-11-09 Thread Paul Turchenko
View scrolls the bitmap for you.

On Nov 10, 12:29 am, kavitha b kkavith...@gmail.com wrote:
 Hi All,

 I am creating a CustomView with bigger image based on tutorial on and
 developers forum.

 It is scolling fine.I need exact pixel coordinates of my image.I am getting
 that also.

 now I want to draw some images upon scrolling image.I am able to draw images
 using onDraw().But images are not getting scrolled.Any idea how to resolve
 this?

 My code is

 public class LargeImageScroller extends Activity {

     // Physical display width and height.
     private static int displayWidth = 0;
     private static int displayHeight = 0;
     private static VectorSquare squares;
     private static VectorTile tiles;

     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);

         // displayWidth and displayHeight will change depending on screen
         // orientation. To get these dynamically, we should hook
 onSizeChanged().
         // This simple example uses only landscape mode, so it's ok to get
 them
         // once on startup and use those values throughout.
         Display display = ((WindowManager)
             getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
         displayWidth = display.getWidth();
         displayHeight = display.getHeight();

         squares=Util.generateBoardSquares();
         tiles=Util.generateTiles(this);

         // SampleView constructor must be constructed last as it needs the
         // displayWidth and displayHeight we just got.
         setContentView(new SampleView(this));
     }

     private static class SampleView extends View {
         private static Bitmap bmLargeImage; //bitmap large enough to be
 scrolled
         private static Rect displayRect = null; //rect we display to
         private Rect scrollRect = null; //rect we scroll over our bitmap
 with
         private int scrollRectX = 0; //current left location of scroll rect
         private int scrollRectY = 0; //current top location of scroll rect
         private float scrollByX = 0; //x amount to scroll by
         private float scrollByY = 0; //y amount to scroll by
         private float startX = 0; //track x from one ACTION_MOVE to the next
         private float startY = 0; //track y from one ACTION_MOVE to the next

         private final int boardHeight=480-150;
         private static Tile movingTile=null;

         public SampleView(Context context) {
             super(context);

             // Destination rect for our main canvas draw. It never changes.
             displayRect = new Rect(0, 0, displayWidth, boardHeight);
             // Scroll rect: this will be used to 'scroll around' over the
             // bitmap in memory. Initialize as above.
             scrollRect = new Rect(0, 0, displayWidth, boardHeight);

             // Load a large bitmap into an offscreen area of memory.
             bmLargeImage = BitmapFactory.decodeResource(getResources(),
                 R.drawable.woodstandardboard);
         }

         @Override
         public boolean onTouchEvent(MotionEvent event) {

             switch (event.getAction()) {
                 case MotionEvent.ACTION_DOWN:
                     // Remember our initial down event location.
                     ///validating for tile touch
                     int touchx=(int)event.getX();
                     int touchy=(int)event.getY();
                     for(int i=0;itiles.size();i++){
                         Tile tile=tiles.get(i);
                         if(tile.isTouched(touchx, touchy)){
                             tile.setX(touchx);
                             tile.setY(touchy);
                             movingTile=tile;
                             invalidate();
                         }
                     }

                     if(movingTile != null){

                         break;
                     }

                     if((int)event.getY()  boardHeight){
                         break;
                     }
                     startX = event.getRawX();
                     startY = event.getRawY();
                     break;

                 case MotionEvent.ACTION_MOVE:

                     if(movingTile != null){
                         int touchedx=(int)event.getX();
                         int touchedy=(int)event.getY();
                         movingTile.setX(touchedx-Util.SQUARE_DIMENSIONS/2);
                         movingTile.setY(touchedy-Util.SQUARE_DIMENSIONS/2);
                         invalidate();

                         break;
                     }

                     if((int)event.getY()  boardHeight){
                         break;
                     }

                     float x = event.getRawX();
                     float y = event.getRawY();
                     // Calculate move update. This will happen many times
                 

[android-developers] Re: How to scale down video playback

2010-11-09 Thread Paul Turchenko
Check parameters of camera. You can set preview size.

On Nov 9, 1:43 pm, jaanda arjunjaand...@gmail.com wrote:
 Hi,

 Can anybody tell me how to scale down a video playback as there is a
 memory constraint and the video playback uses software codecs...please
 help

 Regards,
 jaanda

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

2010-10-23 Thread Paul Turchenko
I would suggest placing it inside onFocusChanged. onStart() will NOT
work for all SDK versions.

On Oct 23, 1:05 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 Nathan,

 You might want to move the code into onStart.

 Another thing to try is to allow the application's message loop to
 unclog a little, before loading it with more events.

 I've seen startActivityForResult cause the parent activity to be not
 drawn at all, if used too early in the parent activity's lifecycle.

 The fix was to post startActivityForResult at the end of the message queue:

 private Handler mHandler = new Handler();
 private Runnable mShowChangeLogTask = new Runnable() {
 @Override
 public void run() {
 Intent intent = new Intent(ParentActivity.this, ChangeLogActivity.class);
 startActivityForResult(intent, REQUEST_CHANGELOG);

 }
 };

 -- Kostya

 23.10.2010 1:20, Nathan пишет:



  Believe me, I am not trying to create an invisible AlertDialog.

  But I believe I have one. I'm not making this up.

  Behavior: main activity starts and is completely unresponsive. No
  dialog appears. No Force close/ANR appears even after much time in
  this state. But if I push the back button, it becomes responsive
  again.

  This does not occur when debuggable is true in the manifest, so I
  can't investigate using the debugger.

  But I found out the following with log statements.

  MainActrivity:OnCreate starts another activity, a welcome screen.
  MainActivity:OnResume is called while the other activity is visible.
  OnResume creates the dialog and calls dlg.Show();
  WelcomeActivity is dismissed.
  MainActivity:OnResume is called. The OnResume method is smart enough
  to note that the dialog has already been shown and does not create it
  again.
  MainActivity is unresponsive. No dialog in sight.
  When I push the back button, a log statement confirms that the
  OnCancelListener is called on the dialog.

  This is Nexus One with  2.2.1.

  As cool as an invisible dialog is, I'd rather not have it. Can I fix
  it?

 --
 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] Re: Aplicação criação de ar quivo PDF.

2010-10-07 Thread Paul Turchenko
Try asking is English... this way you'll have more chances to get
answer

On Oct 6, 11:55 pm, Erick erickbrit...@gmail.com wrote:
 Ola a todos!

 Estou com uma solicitação de desenvolvimento de uma aplicação que crie
 um arquivo PDF, tentei usar o IText mas na hora de fazer o
 PdfWriter.getInstance(doc, os); apresenta erro  ERROR/dalvikvm(223):
 Could not find method java.awt.Color.equals, referenced from method
 com.lowagie.text.Font.compareTo.
 Alguém já escreveu algum código para criação de PDF para Android?

 Att,
 Érick.

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

2010-09-10 Thread Paul Turchenko
+1

On Sep 9, 9:58 pm, TreKing treking...@gmail.com wrote:
 On Wed, Sep 8, 2010 at 10:50 PM, AnnuDroid enigma.an...@gmail.com wrote:
  How to handle Home keyPlzz Help me out

 Plzz take two seconds to spell please correctly.

  I want the Answer.

 42.

  No one in this Blog has any idea how to handle it.

 This isn't a Blog ...

  PLUSMINUS where r u

 Try to the right side of the top row of your keyboard.

   plzzz plzz Help??

 plzzz plzz lurn 2 spell  may b ppl will take u serious lee.

 -
 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: Need Help - Sliding Drawer Exception

2010-09-01 Thread Paul Turchenko
That's cuz VideoView is SurfaceView and it doesn't care about you
layouts and view structure.

On Sep 1, 10:47 pm, Victoria Busse victoriasarabu...@gmail.com
wrote:
 Ha, lol speaking of the devil, it was exactly that I wrapped the scrollView
 around everything else except the slidingDrawer and placed all in a Relative
 Layout
 and now it (almost) works...  the only thing acting weird now is the
 VideoView cause it doesn't scroll with the rest of the content, but creates
 black bars when I scroll up and the content below moves underneath it...

 On Wed, Sep 1, 2010 at 8:41 PM, Victoria Busse
 victoriasarabu...@gmail.comwrote:

  That would explain why it worked before I wrapped the scrollview around
  it...

  On Wed, Sep 1, 2010 at 8:36 PM, Mark Murphy mmur...@commonsware.comwrote:

  I suspect that you cannot have a SlidingDrawer in a ScrollView.

  On Wed, Sep 1, 2010 at 3:33 PM, kivy victoriasarabu...@gmail.com wrote:
   Hi there,

   I just ran into a problem with my SlidingDrawer. I got a
   RuntimeException telling me that my SlidingDrawer cannot have
   UNSPECIFIED dimensions (see Catlog output).
   If I understand it correctly this means layout_width and layout_height
   are empty, but as you can see from my xml code (see further below), I
   have specified them.
   I really don't know what I should, if anyone can help me out here,
   that would be great.
   Thanks in advance.

   09-01 20:02:12.209: ERROR/AndroidRuntime(2444): Uncaught handler:
   thread main exiting due to uncaught exception
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):
   java.lang.RuntimeException: SlidingDrawer cannot have UNSPECIFIED
   dimensions
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.widget.SlidingDrawer.onMeasure(SlidingDrawer.java:261)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.view.View.measure(View.java:7966)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.widget.RelativeLayout.measureChild(RelativeLayout.java:554)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.widget.RelativeLayout.onMeasure(RelativeLayout.java:377)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.view.View.measure(View.java:7966)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.widget.ScrollView.measureChildWithMargins(ScrollView.java:893)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.widget.ScrollView.onMeasure(ScrollView.java:276)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.view.View.measure(View.java:7966)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3077)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.view.View.measure(View.java:7966)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3077)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.view.View.measure(View.java:7966)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.view.ViewRoot.performTraversals(ViewRoot.java:783)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.view.ViewRoot.handleMessage(ViewRoot.java:1666)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.os.Handler.dispatchMessage(Handler.java:99)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.os.Looper.loop(Looper.java:123)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   android.app.ActivityThread.main(ActivityThread.java:4603)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   java.lang.reflect.Method.invokeNative(Native Method)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   java.lang.reflect.Method.invoke(Method.java:521)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   com.android.internal.os.ZygoteInit
   $MethodAndArgsCaller.run(ZygoteInit.java:860)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
   09-01 20:02:12.229: ERROR/AndroidRuntime(2444):     at
   dalvik.system.NativeStart.main(Native Method)

   ?xml version=1.0 encoding=utf-8?

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

          RelativeLayout
                          android:layout_width=fill_parent
                          android:layout_height=fill_parent

   

[android-developers] Re: I want to get system permission?

2010-08-24 Thread Paul Turchenko
Having android:sharedUserId=android.uid.system is not enough. You
have to sign your *.apk with the same key that was used to sign other
applications with the same sharedUserId.

On Aug 24, 5:11 pm, CaryWang wangjf...@gmail.com wrote:
 Do you have anyelse method?I want to know user opreation?e.g.when user run
 application i know,exit application i know.

 2010/8/24 Mark Murphy mmur...@commonsware.com



  On Tue, Aug 24, 2010 at 3:17 AM, CaryWang wangjf...@gmail.com wrote:
   I have a application  I write android:sharedUserId=android.uid.system
   in AndroidManifest.xml. I want to get system permission.I install to HTC
   mobile phone.but install fail.error info :Package ... has no signatures
  that
   match those in shared user android.uid.system. I application need
   android.uid.system,don't remove.what can i should how to do?

  Write your own firmware and sign it with your own signing key.

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

  _The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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

 --
 Cary

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

2010-08-24 Thread Paul Turchenko
Make CustomObject implement Parcelable. Declare ICustomObject.aidl.
This way, AIDL tool could generate stub implementation for your
CustomObject.  That's how you can transfetr it via IPC.

On Aug 23, 1:25 pm, Giordano jorda...@gmail.com wrote:
 Hi everyone :)

 it's the first message I post in this group, even though I lurked and
 posted from time to time in #android-dev.
 I have a question about  IPC.

 At work we are developing 2 applications:
 1 - a service running in background and preparing some data.
 2 - an application that takes the data from the service and uses it
 for something.

 The problem is that service 1) should be able to pass an object like

 class CustomObject{

    private AnotherCustomObject aco = new AnotherCustomObject();

    public AnotherCustomObject getObject(){
        return aco;
    }

 }

 and application 2) should be able to retrieve such object and call the
 method getObject()

 How do I achieve this? I was thinking of doing like so:
 1) create an aidl file for AnotherCustomObject and for CustomObject.
 Something like ICustomObject and IAnotherCustomObject.
 2) on the service 1) side, make CustomObject implement ICustomObject
 and Parcelable and AnotherCustomObject implement IAnotherCustomObject
 and Parcelable and write the implementation of the methods.
 3) on the application 2) side, import the aidl files and use the
 automatically generated interfaces to manipulate the custom objects.

 Is this the correct way to do this in your opinion? In point 2) should
 I extend the stubs instead?

 Thanks in advance for your hints.

 Giordano

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


[android-developers] Re: Can I use Android source code in my Application(Commercial)

2010-08-24 Thread Paul Turchenko
AFAICT, since Android source is under Apache License, you will have to
opensource you application if you use their code (but it shouldn't
mean it can't be commercial). To get more idea you should probably
read license that covers Android's source code 
http://www.apache.org/licenses/LICENSE-2.0.

On Aug 23, 3:52 pm, om omk...@gmail.com wrote:
 can i use android apps source code from google like calendar, todo
 list directly in my commercial application..

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

2010-08-24 Thread Paul Turchenko
Yeah, and for the future, try starting emulator first and then only
deploy an application.

On Aug 24, 3:18 pm, Filip Havlicek havlicek.fi...@gmail.com wrote:
 Hi Boban,

 if you see Android written or Android picture in some blue colors on
 your virtual device's screen, it means your device is still booting. You
 have to wait until it shows the typical screen with unlocking options.

 Best regards,
 Filip Havlicek

 2010/8/22 erakovic.bo...@gmail.com erakovic.bo...@gmail.com

  Hi, I have just start to develop android, and I just cannot start my
  Hello World application.
  I have followed instructions about android installation, I have
  changed several Eclipse IDE's, but still, when I press f11 to compile,
  it 'does' some job int he background, activate my virtual device, but
  wont to behave just as it should!
  Only  Android . . .  is displayed on the screen, which mean that my
  class isn't 'loaded', somehow.
  This is sample class :

  view plaincopy to clipboardprint?

    1. package test.and;
    2. import android.app.Activity;
    3. import android.os.Bundle;
    4. import android.view.View;
    5. import android.widget.Button;
    6. import android.widget.EditText;
    7. import android.widget.TextView;
    8.
    9.
   10. public class TestAppActiv extends Activity {
   11. Button button1;
   12. EditText txtbox1,txtbox2;
   13. TextView tv;
   14.
   15. /** Called when the activity is first created. */
   16. @Override
   17. public void onCreate(Bundle savedInstanceState) {
   18. super.onCreate(savedInstanceState);
   19. setContentView(R.layout.main);
   20. txtbox1= (EditText) findViewById(R.id.txtbox1);
   21. button1 = (Button) findViewById(R.id.button1);
   22. tv = (TextView) findViewById(R.id.lbl1);
   23. txtbox2= (EditText) findViewById(R.id.txtbox2);
   24. button1.setOnClickListener(new Clicker());
   25. }
   26. class Clicker implements Button.OnClickListener
   27. {
   28. public void onClick(View v)
   29. {
   30. String a,b;
   31. Integer vis;
   32. a = txtbox1.getText().toString();
   33. b = txtbox2.getText().toString();
   34. vis = Integer.parseInt(a)+Integer.parseInt(b);
   35. tv.setText(vis.toString());
   36. }
   37. }
   38. }

  package test.and; import android.app.Activity; import
  android.os.Bundle; import android.view.View; import
  android.widget.Button; import android.widget.EditText; import
  android.widget.TextView; public class TestAppActiv extends Activity
  { Button button1; EditText txtbox1,txtbox2; TextView tv; /** Called
  when the activity is first created. */ @Override public void
  onCreate(Bundle savedInstanceState)
  { super.onCreate(savedInstanceState); setContentView(R.layout.main);
  txtbox1= (EditText) findViewById(R.id.txtbox1); button1 = (Button)
  findViewById(R.id.button1); tv = (TextView) findViewById(R.id.lbl1);
  txtbox2= (EditText) findViewById(R.id.txtbox2);
  button1.setOnClickListener(new Clicker()); } class Clicker implements
  Button.OnClickListener { public void onClick(View v) { String a,b;
  Integer vis; a = txtbox1.getText().toString(); b =
  txtbox2.getText().toString(); vis = Integer.parseInt(a)
  +Integer.parseInt(b); tv.setText(vis.toString()); } } }
  And, also main.xml file, which reflect contains xml representation of
  display window :
  main.xml :
  view plaincopy to clipboardprint?

    1. ?xml version=1.0 encoding=utf-8?
    2. AbsoluteLayout
    3. android:id=@+id/widget35
    4. android:layout_width=fill_parent
    5. android:layout_height=fill_parent
    6. xmlns:android=http://schemas.android.com/apk/res/android;
    7. 
    8. EditText
    9. android:id=@+id/txtbox1
   10. android:layout_width=145px
   11. android:layout_height=40px
   12. android:text=EditText
   13. android:textSize=18sp
   14. android:layout_x=75px
   15. android:layout_y=54px
   16. 
   17. /EditText
   18. EditText
   19. android:id=@+id/txtbox2
   20. android:layout_width=144px
   21. android:layout_height=40px
   22. android:text=EditText
   23. android:textSize=18sp
   24. android:layout_x=75px
   25. android:layout_y=109px
   26. 
   27. /EditText
   28. Button
   29. android:id=@+id/button1
   30. android:layout_width=106px
   31. android:layout_height=36px
   32. android:text=Button
   33. android:layout_x=88px
   34. android:layout_y=224px
   35. 
   36. /Button
   37. TextView
   38. android:id=@+id/lbl1
   39. android:layout_width=141px
   40. android:layout_height=wrap_content
   41. android:text=TextView
   42. android:layout_x=76px
   43. android:layout_y=166px
   44. 
   45. /TextView
   46. /AbsoluteLayout

  ?xml version=1.0 encoding=utf-8? AbsoluteLayout android:id=@
  +id/widget35 android:layout_width=fill_parent
  android:layout_height=fill_parent xmlns:android=http://
  schemas.android.com/apk/res/android  EditText android:id=@+id/
  txtbox1 android:layout_width=145px android:layout_height=40px
  android:text=EditText android:textSize=18sp
  android:layout_x=75px android:layout_y=54px  /EditText
  EditText 

[android-developers] Re: Problem with SAX parsing

2010-08-24 Thread Paul Turchenko
Consider using XmlPullParser instead of SAX. It's more convenient for
the most cases.

On Aug 23, 1:20 pm, Atokarev algen...@gmail.com wrote:
 Hi there. I could not get any inner elements during the xml parsing.
 looks like parser see only outer tag A.
 Could you show me error?

 XML:
 A
 B b=ab/B
 C c=ac/C
 D d=ad/D
 E e=ae/E
 /A
 When i call parse function - only A-tag was processed.
 Code:

 App_class

 ...
 xr.parse(new InputSource(url.openStream()));
 ...

 ExampleHandler:
 ...
 if (localName.equals(A))
             {
 // TODO
             }
             if (localName.equals(B))
             {
                 String a= atts.getValue(b);
                 myParsedExampleDataSet.setExtractedB(b);
                         values.put(b, b);
             }
             else if (localName.equals(C))
             {
                 int c = Integer.parseInt(atts.getValue(c));
                 myParsedExampleDataSet.setExtractedC(c);
                         values.put(c, c);
             }
             else if (localName.equals(D))
             {
                 double d= Double.parseDouble(atts.getValue(d));
                 myParsedExampleDataSet.setExtractedD(d);
                         values.put(d, d);
             }
 ...

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

2010-08-24 Thread Paul Turchenko
I would go this way: have images for default skin in you application
and then at runtime resolve other applications that contain
alternative skind and grab resources from them. When user decides to
change the skin, you just enumerate over available skins and use
different resources to supply RemoteViews.

On Aug 23, 7:52 pm, Alex Roebuck maroeb...@gmail.com wrote:
 I have created a widget that uses a sequence of images.  I want to be able
 to change the sequence of images at runtime, depending on user configuration
 (e.g. Use blue theme, Use red theme).  

 I thought creating a resource array for each sequence would work, but that
 generates an array of drawables, whereas the setImageViewResource(int, int)
 method on RemoteViews takes a resource ID.

 What is the best way to abstract the images that the widget uses, so they
 can be loaded during runtime?  Ultimately, I want to be able to load them
 from another package, so that I can supply skins for my widget.

 Will I have to use setImageViewBitmap?  

 Thanks,

 Alex.

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


[android-developers] Re: I don't know how to use Animation translate

2010-08-22 Thread Paul Turchenko
Set fillEnabled and fillAtfer properies of your aimation

On Aug 21, 2:28 pm, CaryWang wangjf...@gmail.com wrote:
 I use translate move image from top to bottom,but translate finish image
 jump to image initial position.I don't know why,I want move image from A to
 B,finsih this image stay B.

 --
 Cary

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 write ContentProvider for content not stored in a file nor DB?

2010-08-19 Thread Paul Turchenko
I am not saying it's hard, I just pointed out that WidgetExplorer from
Unlocking Android doesn't cover what Sergey is asking for

On Aug 16, 4:54 pm, Kostya Vasilyev kmans...@gmail.com wrote:
   Sereja  Pavel,

 It should be just a little bit more involved than writing a SQL-based one.

 For structured data, you'd need to create your own Cursor subclass, and
 return it from the provider's query method. If query results are small
 enough to fit in RAM, then it's easiest to use MatrixCursor.

 For stream-based data, ContentResolver.openStream seems to eventually
 call ContentProvidersubclass.openFile. This method returns a special
 helper class, ParcelFileDescriptor, which allows file descriptors to be
 passed across process boundaries.

 -- Kostya

 16.08.2010 17:18, Paul Turchenko пишет:



  They use Database! Sergey is asking about building content provider
  around non-db storage.

  On Aug 16, 4:29 am, Indicator Veritatismej1...@yahoo.com  wrote:
  Expect to override a lot more methods in ContentProvider and
  ContentResolver than other people do. You may want to look at the
  example WidgetExplorer from Unlocking Android. Go to the book's
  website, download the sample code and look in the code for chapter 5.

  I suggest this example because here too, the authors override more
  methods than usual because they are making their own ContentProvider.
  But of course, the example will not be exactly the same as what you
  want.

  On Aug 12, 2:45 pm, Sergeyserge...@gmail.com  wrote:

  Hi,
  I need to write a ContentProvider to provide a dynamically generated
  audio stream to be playable by MediaPlayer. That is MediaPlayer will
  use ContentResolver.openInputStream() to play it.
  I have read a lot of discussions about this problem but no one had a
  solution yet.
  The most recent one was in January 
  2010:http://groups.google.com/group/android-developers/browse_thread/threa...
  Have anyone found a solution yet?
  Any ideas are greatly appreciated.
  Thanks a lot,
  --Sergey

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

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


[android-developers] Re: Alarm manager for multiple pending intent are not working.

2010-08-16 Thread Paul Turchenko
PendingIntent.FLAG* should help you.

On Aug 16, 12:44 pm, Kostya Vasilyev kmans...@gmail.com wrote:
   Setting an alarm cancels any previous alarms that have the same intent
 as the new one.

 In your code, the old and new intents only differ by their extras, which
 are not considered (I believe).

 What you could do is calculate the next point in time when an alarm is
 needed, set one alarm, and when it goes off, figure out which of the
 possible actions you need to perform.

 -- Kostya

 16.08.2010 11:49, nomi пишет:



  Hi all,

  In my application i have created pending intent which calls another
  activity (after 20mins of alarm off) with the help of alarm manger. It
  should happen each time for each new pending intent or when I call
  that activity.
  But when i create one pending intent and after few mins again create
  new pending intent ,then the last one overlap the other previous
  pending intents and start specified activity only for ones for the
  last pending intent.

  I want  that each time i create any pending intent it should start
  specified activity after 20 mins of it's alarm off time.How it can be
  done ?
  here is my code:--

  Intent intent = new Intent(getApplicationContext(),AlarmCall.class);

                                     intent.putExtra(PolicyNo3,policyNo2);

                                     intent.putExtra(BarcodeNo,barcode_no);
                                     
  Constants.pendingResultList.put(policyNo2, barcode_no);

  System.out.println(Constants.pendingResultList.containsKey(policyNo2));

                                     PendingIntent pendingIntent =
  PendingIntent.getBroadcast(getApplicationContext(),
  0,intent,PendingIntent.FLAG_UPDATE_CURRENT);
                                     AlarmManager alarmManager = 
  (AlarmManager)
  getSystemService(ALARM_SERVICE);

                             long timedely = System.currentTimeMillis() + 
  (20*60*1000);

  alarmManager.set(AlarmManager.RTC_WAKEUP,timedely,
                                         pendingIntent);

  // Below is the code of ALarmCall.class

  manger = (NotificationManager)
  context.getSystemService(Context.NOTIFICATION_SERVICE);
              Notification notification = new
  Notification(R.drawable.icon,Please upload
  result,System.currentTimeMillis());
              Intent startActivity1 = new Intent();
                     startActivity1.setClass(context, UploadTest.class);
                     startActivity1.setAction(UploadTest.class.getName());
                     startActivity1.putExtra( PolicyNo4,policyNo3);
                     startActivity1.putExtra(BarcodeNo1,barcodeNo);
                     startActivity1.addFlags(
                     Intent.FLAG_ACTIVITY_NEW_TASK
                     | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);

              PendingIntent contentIntent = PendingIntent.getActivity(context,
  0,startActivity1    ,Intent.FLAG_ACTIVITY_NEW_TASK);
              notification.setLatestEventInfo(context, HIV Pharmacy,Result 
  of
  Id- +policyNo3,contentIntent);
              notification.flags = Notification.FLAG_ONLY_ALERT_ONCE |
  Notification.FLAG_SHOW_LIGHTS;
              notification.ledARGB = Color.GREEN;
              notification.ledOnMS = 1000;
              notification.ledOffMS = 500;
              notification.defaults = Notification.DEFAULT_SOUND |
  Notification.DEFAULT_VIBRATE;
              manger.notify(32, notification);
              context.startActivity(startActivity1);

    Thanks to all.

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

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


[android-developers] Re: How to write ContentProvider for content not stored in a file nor DB?

2010-08-16 Thread Paul Turchenko
They use Database! Sergey is asking about building content provider
around non-db storage.

On Aug 16, 4:29 am, Indicator Veritatis mej1...@yahoo.com wrote:
 Expect to override a lot more methods in ContentProvider and
 ContentResolver than other people do. You may want to look at the
 example WidgetExplorer from Unlocking Android. Go to the book's
 website, download the sample code and look in the code for chapter 5.

 I suggest this example because here too, the authors override more
 methods than usual because they are making their own ContentProvider.
 But of course, the example will not be exactly the same as what you
 want.

 On Aug 12, 2:45 pm, Sergey serge...@gmail.com wrote:

  Hi,
  I need to write a ContentProvider to provide a dynamically generated
  audio stream to be playable by MediaPlayer. That is MediaPlayer will
  use ContentResolver.openInputStream() to play it.
  I have read a lot of discussions about this problem but no one had a
  solution yet.
  The most recent one was in January 
  2010:http://groups.google.com/group/android-developers/browse_thread/threa...

  Have anyone found a solution yet?
  Any ideas are greatly appreciated.
  Thanks a lot,
  --Sergey

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

2010-08-16 Thread Paul Turchenko
Please point out the source of such information. This absolutely
doesn't make sence to me.

On Aug 14, 8:56 am, Maps.Huge.Info (Maps API Guru)
cor...@gmail.com wrote:
 Where are you installing the app from? I'm guessing a non-market
 source.

 If you install if from a non-market source, the permissions are always
 pretty much the worst case scenario. I guess this is due to the
 installer not knowing what the permissions really are. Once you upload
 the app to the market, the permissions should read what they really
 are.

 -John Coryat

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Leaving an app by pressing 'Home' and going back to it but a new one is started

2010-08-14 Thread Paul Turchenko
Make it single instance

On Aug 14, 8:03 am, Greg Siano gregmsi...@gmail.com wrote:
 I've recently been getting user complaints that when they leave my app
 by pressing the 'Home' key, my app continues to play sounds like it is
 supposed to, but when they go back to the app, a new one opens, but
 the old one is still running in the background.  I have noticed this
 sometimes myself too, but only recently (my app has been on the market
 for a while now).  I've done some testing myself and noticed that when
 a new instance of the app is opened after pressing 'Home' then
 starting the app again, pressing the 'back' key will go back to the
 original instance of the app that was opened. This means that the
 original instance of the app was not killed, but a new one was just
 opened over it.  Has anyone else experience something like this? or
 know what could be going on? 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: #setChecked in CheckedTextView in ListView not working

2010-08-14 Thread Paul Turchenko
I believe the issue is that you're getting rowId from
rawContactsCursor (bindView method) which stays on the same record.
IMO you should get row id from cursor coming to you in bindView. This
way you'll get rowId for the record you are currently binding.
To be simple, you are binding to the wrong record.

On Aug 14, 7:50 am, William Ferguson william.ferguson...@gmail.com
wrote:
 I have a ListView that just contains a CheckedTextView.
 I have a very simple CursorAdapter that populates CheckedTextViews.
 When I click on an item, I can see that I am responding to the correct
 row, store the value in my model and the CheckedText gets checked.

 However, when I scroll down and then back up again, while I see that
 the model contains the correct value (in #bindView), calling
 #setChecked on the CheckedTextView has no effect. Ie All items are
 unchecked.

 Its gotta be something simple, but I can't see it. Any ideas?

 public final class SimpleAdapter extends CursorAdapter {

     private static final String TAG = SimpleAdapter;

     private final LayoutInflater inflater;
     private final RowModel rowModel = new RowModel();

     public SimpleAdapter(Activity context, MyCursor cursor) {
         super(context, cursor, true);
         inflater = (LayoutInflater)
 context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
     }

     @Override
     public View newView(Context context, Cursor cursor, ViewGroup
 parent) {
         final CheckedTextView checkedText = (CheckedTextView)
 inflater.inflate(android.R.layout.simple_list_item_multiple_choice,
 parent, false);

         final MyCursor myCursor = (MyCursor) cursor;
         checkedText.setText(myCursor.getDescription());

         final Long rowId = rawContactsCursor.getRowId();
         checkedText.setChecked(rowModel.isSelected(rowId));
         Log.v(TAG, rowId= + rowId +  settingChecked= +
 rowModel.isSelected(rowId));

         checkedText.setTag(rowId);

         checkedText.setOnClickListener(new View.OnClickListener() {
             public void onClick(View view) { // Toggle whether the Row
 is selected or not.
                 final Long id = (Long) view.getTag();
                 Log.v(TAG, toggling rowId= + rowId);
                 final boolean checked = rowModel.toggleSelected(id);
                 final CheckedTextView checkedTextView =
 (CheckedTextView) view;
                 checkedTextView.setChecked(checked);
             }
         });

         return checkedText;
     }

     @Override
     public void bindView(View view, Context context, Cursor cursor) {
         final CheckedTextView checkedText = (CheckedTextView) view;

         final MyCursor myCursor = (MyCursor) cursor;
         checkedText.setText(myCursor.getDescription());

         final Long rowId = rawContactsCursor.getRowId();
         checkedText.setChecked(rowModel.isSelected(rowId));
         Log.v(TAG, rowId= + rowId +  settingChecked= +
 rowModel.isSelected(rowId));

         checkedText.setTag(rowId);
     }

 }

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Onscreen keyboard too big. Any way to detect its presence?

2010-08-14 Thread Paul Turchenko
1. Consider playing with android:windowSoftInputMode attribute of your
activity (in the AndroidManifest.xml)
2. Override onCreateInputConnection - that's when soft keyboard pops
out

On Aug 14, 7:43 am, shawn sh...@spcware.com wrote:
 In one of my custom views, I have an EditText.  When the onscreen
 keyboard appears, it takes up too much space for my custom view.  I
 would like to turn off visibility of a few of my components whenever
 the onscreen keyboard is present.  Then turn them back on when it goes
 away.  Anyway I can add a listener of some kind to detect the opening/
 closing of the onscreen keyboard?

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

2010-08-12 Thread Paul Turchenko
Consider pausing debugger when you think ANR is about to occur.
Basically, ANR pops up when your UI thread (main thread) can't
dispatch UI event message queue for more than 5 sec. (it could be less
- that's just my guess). So basically, you're loading your UI thread
with some heavy worka and he has no chance to dispatch messages from
Looper's queue.

On Aug 12, 12:21 am, sdphil phil.pellouch...@gmail.com wrote:
 hi.  what is the best way to debug ANR.  ideally, it would be nice to
 know what call / thread / file and line number it is stalled at when
 the ANR occurs, but every time I look at /anr/traces.txt, I can't seem
 to find anything that points to something I can start tracking down.

 tia.

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

2010-08-03 Thread Paul Turchenko
I would go with storing your questions in raw XML file (asset) and
parsing it on the fly. This way, you can easily change it and
(perhaps) later extend your aplication to communicate with web service
that has questions. IMHO using database for this is a bit wasty.

On Aug 3, 8:56 am, Sarwar Erfan erfanonl...@gmail.com wrote:
 Hi,
 Put your all questions in SQLiteDatabase.
 Then, load the necessary ones when required in the application.
 Storing and loading from file will not be very useful. Database will
 help you organize the questions better and also to retrieve the
 required ones smartly.

 Regards
 Sarwar Erfan

 On Aug 3, 2:49 am, amos milan.ku...@gmail.com wrote:

  Hello,
  I want to create such application that would show a question to user
  and possible 3 (or n) answers and user should pick correct answer
  (some kind of learning quiz). I'm not sure about the storage for those
  data - questions and possible answers. What would be most natural way
  for Android. I know that I can either use property files or tables in
  sqlite database. There will be about 500 items (1 question, 3 answers,
  1 correct answer ).
  Any ideas?
  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: Interaction between an Activity and a Service ?

2010-08-03 Thread Paul Turchenko
See ApiDemos for 2way service communication sample.

On Aug 1, 11:29 pm, Rajesh Bachani rajesh.bach...@gmail.com wrote:
 Hello friends!

 I am trying to explore how information can be exchanged between
 activities and services.
 So, if we have Activity A and a Service S is started from A, using the
 startService() method - is there a way to pass parameters to the
 Service - and also receive values from the Service into the Activity
 once the stopService() method is called?

 I am using Intent to start the service, as one would expect.

 And further what is the advantage of calling the onBind method, as
 opposed to the onStart().

 Thanks,
 Rajesh.

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

2010-08-03 Thread Paul Turchenko
Why DOM? Having large content of you feed you'll end up having HUGE
memory blocks with DOM. Consider XmlPullParser instead.

On Aug 2, 1:48 am, Obason oba...@gmail.com wrote:
 I would like to read RSS feed by following coding:

         /** Get data from the list feed */
         private void GetListFeed() {
                 // Get the XML
                 URL url;
                 try {
                         String ListFeed = getString(R.string.rss_blog);

                         url = new URL(ListFeed);

                         URLConnection connection = url.openConnection();

                         HttpURLConnection httpConnection = 
 (HttpURLConnection) connection;
                         httpConnection.setReadTimeout(5000);

                         int responseCode = httpConnection.getResponseCode();

                         if (responseCode == HttpURLConnection.HTTP_OK) {

                                 InputStream in = 
 httpConnection.getInputStream();

                                 DocumentBuilderFactory dbf = 
 DocumentBuilderFactory
                                                 .newInstance();
                                 DocumentBuilder db = dbf.newDocumentBuilder();

                                 // Parse the feed.
                                 Document dom = db.parse(in);
                                 Element docEle = dom.getDocumentElement();

                                 // Get a list of each entry.
                                 NodeList nl = 
 docEle.getElementsByTagName(item);
                                 if (nl != null  nl.getLength()  0) {
                                         int k = nl.getLength();

                                         for (int i = 0; i  k; i++) {
                                                 Element entry = (Element) 
 nl.item(i);

                                                         Element title = 
 (Element) entry
                                                                         
 .getElementsByTagName(title).item(0);

                                                         Element description = 
 (Element) entry
                                                                         
 .getElementsByTagName(description)
                                                                         
 .item(0);;

                                                         strTitle = 
 title.getFirstChild().getNodeValue()
                                                                         
 .trim().toString();

                                                         strDescription = 
 description.getFirstChild()
                                                                         
 .getNodeValue().trim().toString();

                                                 }

                                         }
                                 }

                         }
                 } catch (MalformedURLException e) {
                         e.printStackTrace();
                 } catch (IOException e) {
                         e.printStackTrace();
                 } catch (ParserConfigurationException e) {
                         e.printStackTrace();
                 } catch (SAXException e) {
                         e.printStackTrace();
                 } finally {
                 }
         }

 However, it description contains html symbol, such as br /, it will
 stop read and display any thing before it.
 For example: abc defg hi br / jkl mn opq
 At android device, it will shows abc defg hi only.

 I would appreciate if you guys can help me solve this issue. .

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

2010-07-30 Thread Paul Turchenko
Behind the curtain, android uses permissions to asign you user groups
he belongs to (linux user and linux groups). So basically you are
asking if you can add user assigned to your application to certain
groups. Guess that's not possible as your process (meaning your user)
just doesn't have permissions for that. So you end up having no
permissions to set a permission :)

On Jul 30, 4:09 pm, RamaMohan rama.mohan...@gmail.com wrote:
 HI all,
 I want to add   uses-permission via programatically .I want to
 telephone number of the device.For that i need to access the phone
 state.But i need to add that permission only with Java code at
 runtime.
 Is it Possible to do so. (or)
 Can you suggest any alternative way to read the telephone number .?

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

2010-07-28 Thread Paul Turchenko
Yeah, no problem with that. Just declare you DemoView in the layout.
For now it goes like this:
LinearLayout ...
ImageView .../
your.package.name.DemoView .../
/LinearLayout

And set this layout to be activity's content.

On Jul 27, 1:32 pm, harshe hars...@gmail.com wrote:
 Thanks Paul.As u said, the following code works well . But it
 looks like a custom view , i cant see the textview itself. I have set
 the ContentView to main.XML only but still the views in the main.XML r
 not seen. am getting an output were i can see only the given string
 rotated -90 degrees in the specified location. i want this rotation of
 the string to happen inside the textview and the other components in
 the main.xml has to be displayed.do i have to change anything in
 this code And if i want to add an ImageView next to this textview
 ( linear layout is horizontal orientation)
 wat i should do. Please do help me

 public class textrotate extends Activity {

     DemoView dview;
         /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         dview= new DemoView(this);
         setContentView(dview);
        // rotateText(FACEBOOK);
     }

         private class DemoView extends TextView{

                 public DemoView(Context context) {
                         super(context);
                         // TODO Auto-generated constructor stub
                 }

                 protected void onDraw(Canvas canvas){
                         super.onDraw(canvas);
                         // x increases from left to right
                         // y increases from top to bottom
                         canvas.save();
                         //int x=0;
                         //int y=0;
                         Paint paint= new Paint();
                         paint.setStyle(Paint.Style.FILL);
                         paint.setColor(Color.WHITE);
                         //x=30;
                         //y=400;
                         paint.setTextSize(40);
                         String str2Rotate = FACEBOOK;
                         float py = this.getHeight();
             float px = this.getWidth()/8.0f;
             //canvas.rotate(180, px, py);

                         canvas.rotate(-90, px,py);
                         canvas.drawText(str2Rotate, px, py, paint);
                         canvas.restore();

                 }
         }

 }

 On Jul 27, 3:33 am, Paul Turchenko paul.turche...@gmail.com wrote:

  Inherit from TextView, override measure pass and during draw, rotate
  the canvas, call super, restore it. This will do the trick

  On Jul 26, 12:38 am, harshe hars...@gmail.com wrote:

   I have a textview placed vertically in an activity.. I Want the text
   within the textview to be shown as bottom to top facing right side.
   Can anyone please help me out..
   my XML file is

   TextView
       android:layout_height=200dp
       android:layout_width=50dp
       android:paddingTop=100dp
       android:text=ALL
       android:textSize= 20px
       android:autoText=true
        android:paddingLeft=5dp
        android:layout_gravity=fill_vertical
     /

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

2010-07-26 Thread Paul Turchenko
Inherit from TextView, override measure pass and during draw, rotate
the canvas, call super, restore it. This will do the trick

On Jul 26, 12:38 am, harshe hars...@gmail.com wrote:
 I have a textview placed vertically in an activity.. I Want the text
 within the textview to be shown as bottom to top facing right side.
 Can anyone please help me out..
 my XML file is

 TextView
     android:layout_height=200dp
     android:layout_width=50dp
     android:paddingTop=100dp
     android:text=ALL
     android:textSize= 20px
     android:autoText=true
      android:paddingLeft=5dp
      android:layout_gravity=fill_vertical
   /

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


[android-developers] Re: Problem: Long running AsyncTask with reference to Activity

2010-07-24 Thread Paul Turchenko
Threads are not getting killed when activity is destroyed.

On Jul 24, 4:10 pm, Joseph Earl joseph.w.e...@gmail.com wrote:
 Yup. Use a service for long running background tasks that do not
 require an Activity to be present.
 Threads started by an Activity are killed anyway when your Activity is
 destroyed (or at least that's how it seems to me).
 You can bind to your service from your Activity to control it.

 On Jul 24, 1:28 pm, sasq jonas.minnb...@gmail.com wrote:

  I have an AsyncTask that scans the file system and publishes progress
  through Notifications. To do this I need a reference to the current
  Activity in the AsyncTask.

  I also don't want to kill the task when the activity is destroyed. How
  do I avoid leaking the activity and everything it references on each
  configuration change?

  One possibility is to remove the reference in OnPause() to be sure it
  is gone when the Activity is destroyed, but that would mean
  notifications stops coming as soon as you leave the activity which is
  no good.

  Isn't there a recommended way of dealing with AsyncTasks in this way?

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


[android-developers] Re: can we start application after installing .apk file

2010-07-23 Thread Paul Turchenko
You can't start your application. Neither service nor activity.

The only ugly workaroung I can offer is:

1. Have your other application already installed on the device.
2. Subscribe to receive PACKAGE_INSTALLED broadcast.
3. Check if broadcated unstalled package is your application that
needs to be autostarted.
4. If it is, send appropriate intent for it to start.

On Jul 21, 3:44 pm, A N K ! T ankit.awasth...@gmail.com wrote:
 i am trying to make application run just after installing it.

 --
 Thanks
  Ankit Awasthi

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


[android-developers] Re: can we start application after installing .apk file

2010-07-21 Thread Paul Turchenko
You can't

On Jul 21, 9:40 pm, ranjan ar ranjan@gmail.com wrote:
 You can start a service rather..

 On Wed, Jul 21, 2010 at 5:44 AM, A N K ! T ankit.awasth...@gmail.comwrote:

  i am trying to make application run just after installing it.

  --
  Thanks
   Ankit Awasthi

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

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


[android-developers] Re: How to Draw Vertical Bar Graph in Android?

2010-07-21 Thread Paul Turchenko
Artfulbits company has aiCharts custom components that does excactly
what you ask. Besides that Bar graph you'll get zooming, panning,
touching getstures support. Visit 
http://www.artfulbits.com/Android/aiCharts.aspx
for mode details, demos and libary itself.

On Jul 20, 8:40 am, Ankit Nigam ankitniga...@gmail.com wrote:
 Hello Friends,
 I am developing one statics application and i want to draw a vertical
 Bar Graph depending upon the value received from the server,so can
 anyone help me out.

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


[android-developers] Re: Widget update problem

2010-07-21 Thread Paul Turchenko
I'm 99% sure that the problem is that you don't create RemoteViews
every time (reusing old instance). This way mActions arraylist of
RemoteView will get filled up with a bunch of actions and they all
have to be dispatched by acore process.

I would offer 2 workarounds:
1. Create NEW instance of RemoteView each time you're about to update
your app widget
OR
2. Use reflection to clear mActions field of RemoteViews and then
you're fine to reuse old instance (just make sure to gracefully handle
reflection exceptions in case you're on different firmware and there's
no mActions member)

IMO, the best thing to do is attempt to clear mActions and only if it
fails, create a new instance.

On Jul 21, 9:33 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 Hi,

 This is what I would do (although I am no Brian Boitano). Make widget
 update code (that builds RemoteViews) really, really simple - like
 setting one text view to an increasing number. Then gradually add code
 back until you find the culprit.

 -- Kostya

 21.07.2010 20:07, NightGospel пишет:



  Hello,

  ah, I'm not sure actually, but I tested it in emulator and my phone
  (X10). They both have such a problem. Emulator has nothing but my
  widget in home screen, but it still occurs.
  I'm not very learned in Android, but if you have any constructive
  suggestions, I'll appreciate it. :)

  NightGospel

  On Jul 21, 11:50 pm, DanHdanhi...@ieee.org  wrote:

  Stupid question:  Are you sure you're just updating the widget and not
  stacking one widget on another on another...?

  On Jul 21, 4:32 am, NightGospelwutie...@gmail.com  wrote:

  Hi all,

  I wrote one widget that updates per 5-seconds and I found that if it's
  run for a period of time, com.android.acore will occupy almost 100%
  cpu. Could somebody give me suggestions or help?
  Thanks in advance.

  NightGospel

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

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


[android-developers] Re: Charts in Android

2010-07-21 Thread Paul Turchenko
Visit http://www.artfulbits.com/Android/aiCharts.aspx for aiCharts.
Right now aiCharts is the only one professional solution for Android.
aiCharts is optimized for use on mobile devices. Low memory and CPU
consumption allow long phone battery life. aiCharts aware of all
mobile platform limitations and makes you forget about them.

aiCharts does not use any low level native libraries and is 100% safe
for Android OS users, as it runs in completely safe managed
environment of Dalvik Java VM.

On Jul 21, 4:40 pm, veradis veradism...@gmail.com wrote:
 Hi,

  I want display pie chart in android. Is there is any chart API or
 JARs available.

 Regards
 Veradis

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

2010-07-21 Thread Paul Turchenko
Yeah. If you need to draw just a siple chart you're good with aChart,
But as soon as you plan to support multiple charts, user interaction,
styling, etc., you're better off with aiCharts.

On Jul 22, 1:59 am, Zsolt Vasvari zvasv...@gmail.com wrote:
 I use aChartEngine.  It's not too full featured, but it is lightweight
 (39K .jar), free (upfront and royalty) and it's easy to use.
 Depending on your requirement, it might be suitable.

 On Jul 22, 5:07 am, Paul Turchenko paul.turche...@gmail.com wrote:

  Visithttp://www.artfulbits.com/Android/aiCharts.aspxforaiCharts.
  Right now aiCharts is the only one professional solution for Android.
  aiCharts is optimized for use on mobile devices. Low memory and CPU
  consumption allow long phone battery life. aiCharts aware of all
  mobile platform limitations and makes you forget about them.

  aiCharts does not use any low level native libraries and is 100% safe
  for Android OS users, as it runs in completely safe managed
  environment of Dalvik Java VM.

  On Jul 21, 4:40 pm, veradis veradism...@gmail.com wrote:

   Hi,

    I want display pie chart in android. Is there is any chart API or
   JARs available.

   Regards
   Veradis- Hide quoted text -

  - Show quoted text -

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


[android-developers] Re: Stopping other Activity from my Service..

2010-05-08 Thread Paul Turchenko
They restart the package

On May 6, 4:16 pm, Carlos Silva r3...@r3pek.org wrote:
 2010/5/6 Kostya Vasilyev kmans...@gmail.com

  If that were possible, it'd be a massive security hole.

 How does taskkillers (don't) work  then?

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

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


[android-developers] Re: MapView does not work in HTC Hero

2010-05-03 Thread Paul Turchenko
Make sure you use different mapApi keys for emulator and real device
because it seems that you've obtained certificatie for debug keystore
only.

On May 1, 7:17 am, Reiny Song reiny.s...@gmail.com wrote:
 Hello,

 I have a MapView (in MapActivity), and it works in my simulator.

 The google map and the overlay I made are showed in simulator screen

 After installing in HTC Hero,

 the overlay is showed in phone screen, but google map is not showed in phone
 screen.

 I have no idea about the reason.

 could anyone answer me?

 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 
 athttp://groups.google.com/group/android-developers?hl=en

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


[android-developers] Re: Plz need Help

2010-04-15 Thread Paul Turchenko
getIntent() will return you the original intent you've used to start
activity.

On Apr 15, 8:48 am, Ali Murtaza mralimurt...@gmail.com wrote:
 Hi

 I am new in android and just want to save a data in one activity and then
 send it on other activity, just like notepad tutorials i used

 Intent ii = *new* Intent(Calendar.*this*, EditEvent.*class*);

 ii.putExtra(eventdate, *this*.toString());

 and then in other activity

 date = savedInstanceState != *null* ? savedInstanceState.getString(
 eventdate):*null*;

 i used this but it is not working, the date contain null

 please tell me error as well as the function which is run by default when
 activity context switching occurs.
 Thanks

 --
 Ali Murtaza

 BCSF06M021
 Research Assistant
 Data Virtulization Ware House
 PUCIT, Lahore, Pakistan
 ali.murt...@pucit.edu.pk

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Orientation changes and layout

2010-04-15 Thread Paul Turchenko
WebView has methods to save its state. Use them to store/obtain your
webview's state.

On Apr 15, 12:58 am, nikhil nik...@gmail.com wrote:
 Paul,

 The problem with onSaveInstanceSate is that it saves the state in
 portrait layout and when I am in landscape layout it display the
 correct state but after that it doesn't update with new information. I
 want to save the state whenever the orientation changes and then when
 we are in new orientation the webview should update with new info...

 On Apr 14, 4:08 pm, Paul Turchenko paul.turche...@gmail.com wrote:

  Well, android:configChanges=orientationmight look pretty convinient,
  but it's tricky from the inside. My advice - don't use configChanges
  property unless you REALLY know what you are doing (I wish Android
  team had never exposed it publicly). As for your example, you'll just
  have to store your WebView's state in onSaveInstanceSate and avoid
  setting configChanges property. Look @ activity 
  lifecyclehttp://developer.android.com/intl/zh-TW/reference/android/app/Activit...
  for more information.

  On Apr 14, 9:08 pm, nikhil nik...@gmail.com wrote:

   I figured that I can have custom layout for each orientation just by
   making two folders
   layout-port and layout-land. So I put different views in these
   folders. Worked well.

   Now, I have a webview in my activity and it reloads whenever there is
   any change in orientation. So to prevent that I put
   android:configChanges=orientation in my manifest file.

   After putting this the reloading stopped but the contents in the
   layout-port started getting selected for landscape mode as well.

   Am not sure where I am going wrong. I need to have both.

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Orientation changes and layout

2010-04-15 Thread Paul Turchenko
Well, I did exactly the same couple days ago and everything works as a
charm.

On Apr 15, 6:36 pm, nikhil nik...@gmail.com wrote:
 Yes I did that but after restoring the webview state it doesn't update
 with new information.

 On Apr 15, 2:31 am, Paul Turchenko paul.turche...@gmail.com wrote:

  WebView has methods to save its state. Use them to store/obtain your
  webview's state.

  On Apr 15, 12:58 am, nikhil nik...@gmail.com wrote:

   Paul,

   The problem with onSaveInstanceSate is that it saves the state in
   portrait layout and when I am in landscape layout it display the
   correct state but after that it doesn't update with new information. I
   want to save the state whenever theorientationchanges and then when
   we are in neworientationthe webview should update with new info...

   On Apr 14, 4:08 pm, Paul Turchenko paul.turche...@gmail.com wrote:

Well, android:configChanges=orientationmight look pretty convinient,
but it's tricky from the inside. My advice - don't use configChanges
property unless you REALLY know what you are doing (I wish Android
team had never exposed it publicly). As for your example, you'll just
have to store your WebView's state in onSaveInstanceSate and avoid
setting configChanges property. Look @ activity 
lifecyclehttp://developer.android.com/intl/zh-TW/reference/android/app/Activit...
for more information.

On Apr 14, 9:08 pm, nikhil nik...@gmail.com wrote:

 I figured that I can have custom layout for eachorientationjust by
 making two folders
 layout-port and layout-land. So I put different views in these
 folders. Worked well.

 Now, I have a webview in my activity and it reloads whenever there is
 any change inorientation. So to prevent that I put
 android:configChanges=orientation in my manifest file.

 After putting this the reloading stopped but the contents in the
 layout-port started getting selected for landscape mode as well.

 Am not sure where I am going wrong. I need to have both.

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Orientation changes and layout

2010-04-14 Thread Paul Turchenko
Well, android:configChanges=orientationmight look pretty convinient,
but it's tricky from the inside. My advice - don't use configChanges
property unless you REALLY know what you are doing (I wish Android
team had never exposed it publicly). As for your example, you'll just
have to store your WebView's state in onSaveInstanceSate and avoid
setting configChanges property. Look @ activity lifecycle
http://developer.android.com/intl/zh-TW/reference/android/app/Activity.html#ConfigurationChanges
for more information.

On Apr 14, 9:08 pm, nikhil nik...@gmail.com wrote:
 I figured that I can have custom layout for each orientation just by
 making two folders
 layout-port and layout-land. So I put different views in these
 folders. Worked well.

 Now, I have a webview in my activity and it reloads whenever there is
 any change in orientation. So to prevent that I put
 android:configChanges=orientation in my manifest file.

 After putting this the reloading stopped but the contents in the
 layout-port started getting selected for landscape mode as well.

 Am not sure where I am going wrong. I need to have both.

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: How to add Edittext box in a home screen widget

2010-04-02 Thread Paul Turchenko
Call actyvity when user clicks on your app widget and capture input
from there

On Mar 26, 7:32 am, And-Rider rahulregunat...@gmail.com wrote:
 so is there any alternate way to get user input in form of a text from
 the widget other than using EditText?..

 If i make TextView as editable it shows a keyboard but i am not able
 to see any inputs from the user.

 On Mar 26, 2:50 am, Paul Turchenko paul.turche...@gmail.com wrote:

  Well, google's search widget doesn't show edittext box. You can prove
  it by digging into it with hierarchy viewer. For now, you can't have
  EditText in app widget (at least for default android's home launcher)

  On Mar 25, 4:25 pm, And-Rider rahulregunat...@gmail.com wrote:

   I want to create a custom widget for my application which should be
   used for doing search internally in my application.But i am not able
   to place an Edit text control inside a widget.While browsing further i
   found that Edittext box was not included for creating custom widgets

  http://developer.android.com/intl/de/guide/topics/appwidgets/index.ht...

  http://developingandroid.blogspot.com/2009/09/simple-home-screen-widg...

   I was surprised to see google's search widget showing an edittext
   box.Is there a way to add an edittext box in a widget...?

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Parent View intercepts events on Child View

2010-04-02 Thread Paul Turchenko
Try playing with duplicateParentState (or something like that) and
addStatesFromChildren properties. This might help.

On Apr 1, 12:22 am, Marwan marwa...@gmail.com wrote:
 Hi Guys,

 I need a helping hand for setOnClickListener.
 I have created a Rect class which extends View,

 package com.RoboTown;

 import android.R.string;
 import android.content.Context;
 import android.graphics.Canvas;
 import android.graphics.Paint;
 import android.view.View;
 import android.widget.FrameLayout;

 public class Rect extends View {
     /** Called when the activity is first created. */

         private  float x;
     private  float y;
         private  float z;
     private  float w;
     private String t;
     private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);

     public Rect(Context context, float x, float y, float z, float w,
 String t) {
         super(context);
         mPaint.setColor(0x);
         mPaint.setTextSize(20);

         this.x = x;
         this.y = y;
         this.z = z;
         this.w = w;
         this.t = t;
     }

     public void setRectX(float x) {
         this.x = x;
     }
     public void setRectY(float y) {
         this.y = y;
     }
     public void setRectZ(float z) {
         this.z = z;
     }
     public void setRectW(float w) {
         this.w = w;
     }
     public void setRectP(int r) {
         mPaint.setColor(r);

     }

     public float getRectX() {
         return this.x;
     }
     public float getRectY() {
         return this.y;
     }
     public float getRectZ() {
         return this.z;
     }
     public float getRectW() {
         return this.w;
     }
     public String getRectT() {
         return this.t;
     }
     @Override
     protected void onDraw(Canvas canvas) {
         super.onDraw(canvas);

         canvas.drawRect(x, y, z,w, mPaint);
         canvas.drawText(t, x+30, y+30, mPaint);

     }

 }

 I ve instanciated an object from Rect class and added it to my main
 view (a FrameLayout view) .

 final Rect pc1= new Rect(this,60,60,240,240,);

 FrameLayout main = (FrameLayout) findViewById(R.id.main_view);

 main.addView(pc1);

 pc1.setOnClickListener(new OnClickListener() {
 public void onClick(View v) {
 // Perform action on click

 }
 });

 The problem is that, I have my action done even If I click somewhere
 else than pc1 rectangle in my main view...

 Do you have an idea please?

 Many thanks ^^

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Moving CursorAdapter cursor creation to background thread

2010-04-02 Thread Paul Turchenko
Thanks, Mark.

On Mar 31, 2:53 am, Mark Murphy mmur...@commonsware.com wrote:
 Paul Turchenko wrote:
  Well, how about filling list view with items dynamically?

 You still have to do the slow database query, which still has to be done
 off the main application thread (e.g., in an AsyncTask).

 And you still have to populate any Adapter attached to a ListView on the
 UI thread (e.g., publishProgress() or onPostExecute() of the AsyncTask).
 Adapters not yet connected to a ListView can be updated from a
 background thread safely, IIRC.

 The only way I can see this would help matters is if there's a
 convenient way for you to break up the single slow query into several
 faster queries.

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

 Android Development Wiki:http://wiki.andmob.org

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Regarding language change notification

2010-03-30 Thread Paul Turchenko
override onConfigurationChanged()

On Mar 30, 11:51 am, Dilip Dilip dileep2m...@gmail.com wrote:
 Hi All,
  How to recieve the language change notification in my service?
 I want to get a notification to my service whenever the user changes the
 phone language.

 Thanks and Regards,
   Dileep

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Moving CursorAdapter cursor creation to background thread

2010-03-30 Thread Paul Turchenko
Well, how about filling list view with items dynamically?

On Mar 29, 11:05 pm, Mark Murphy mmur...@commonsware.com wrote:
 Paul Turchenko wrote:
  What is the most correct way to populate your list items from database/
  contentprovider records when querying then takes too long?

 Run your query in an AsyncTask and call setListAdapter() in
 onPostExecute() of the task.

 What, precisely, is not desirable about that solution?

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

 Android Online Training: 10-14 May 2010:http://onlc.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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Extend a button and implement Parcelable

2010-03-29 Thread Paul Turchenko
Why possibly you may need to make a button parcelable? Are you suppose
to send it via RPC? It seems like you've chosen a wrong approach for
whatever you trying to do.

On Mar 28, 7:41 pm, Kritzli pfister.ta...@googlemail.com wrote:
 Hi,

 I've got a problem with a parcelable ArrayList.
 I made a custom Button called MyButton and the ArrayList is a generic
 one. So it only takes MyButton objects.
 Passing the list from on Activity to another is not the problem. In
 the receiving Activity the Log says, it has some elements, but if i
 read specific values (like height and text of the button), it always
 says null or 0.

 public class MyButton extends Button implements Parcelable{

     private HashMapString, String map;
     public static Context context;

     public MyButton(Context context){
         super(context);
         this.context = context;
         map = new HashMapString, String();
     }

     public MyButton(Context context, AttributeSet attrs){
         super(context, attrs);
     }

     public MyButton(Parcel in){
         super(context);
         map = new HashMapString, String();
         readFromParcel(in);
     }

      public static final Parcelable.CreatorMyButton CREATOR = new
 Parcelable.CreatorMyButton() {
             public MyButton createFromParcel(Parcel in) {
                 return new MyButton(in);
             }

             public MyButton[] newArray(int size) {
                 return new MyButton[size];
             }
         };

         @Override
         public int describeContents() {
             return 0;
         }

         @Override
         public void writeToParcel(Parcel dest, int flags) {
             dest.writeInt(map.size());
             for (String s: map.keySet()) {
                 dest.writeString(s);
                 dest.writeString(map.get(s));
             }

         }

         public void readFromParcel(Parcel in) {
             int count = in.readInt();
             for (int i = 0; i  count; i++) {
                 map.put(in.readString(), in.readString());
             }

         }

         public String get(String key) {
             return map.get(key);
         }

         public void put(String key, String value) {
             map.put(key, value);
         }

     }

 If you could have a look at my code and tell me what i made wrong, I
 would be very glad.

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Re: Moving CursorAdapter cursor creation to background thread

2010-03-29 Thread Paul Turchenko
Hi Mark. I don't think that's a most desirable solution. For most
cases, we'd like to have the CursorAdapter (which is attached to
Cursor) populated in runtime with new entries from ContentProvider/
Database.
I generally agree with jsfd that since activity offers managedQuery
method, it would be really niece if elegant solution such as:

onCreate()
{
 ...
 Cursor c = managedQuery(content://authority/path, PROJECTION,
null , ...);
 setListAdapter(new MyCursorAdapter(this, c);
}
would populate adapter on separate thread as soon as new items become
available. But unfortunately, if query takes too long, UI thread will
starve and application may become a candidate for ANR.

What is the most correct way to populate your list items from database/
contentprovider records when querying then takes too long?

On Mar 29, 7:52 pm, Mark Murphy mmur...@commonsware.com wrote:
 jsdf wrote:
  I then thought of trying to load the cursor in a background thread,
  but realize that this might be problematic, as the CursorAdapter
  should be instantiated in onCreate() and should take a cursor as a
  parameter.

 Why? Run your query in an AsyncTask and call setListAdapter() in
 onPostExecute() of the task.

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

 Android 2.x Programming Books:http://commonsware.com/books

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Re: create TextView

2010-03-28 Thread Paul Turchenko
Even thought you are in onClickListener anonymous class, you can
always get your context (instance of activity via
your_activity_class_name.this)

 cb.setOnClickListener(new OnClickListener()
{
TableLayouttl;

@Override
public void onClick(View v)
{
if (((CheckBox) v).isChecked())
{
if (tl == null)
{
Context c = MyActivity.this;


.

On Mar 27, 6:13 pm, Adrian Vintu adrianvi...@gmail.com wrote:
 Np. There are many ways to get your desired behavior. I will post one of
 them, just in case someone needs it. This is actually a toggle layout, so
 it's a little bit more than what you asked.

     cb.setOnClickListener(new OnClickListener()
         {
             TableLayout    tl;

             @Override
             public void onClick(View v)
             {
                 if (((CheckBox) v).isChecked())
                 {
                     if (tl == null)
                     {
                         Context c = v.getContext();

                         TableRow tr = new TableRow(c);
                         TextView b = new TextView(c);
                         tl = new TableLayout(c);
                         tl.removeView(tr);
                         b.setText(Dynamic test);
                         tr.addView(b);
                         tl.addView(tr);

                         LinearLayout parent = (LinearLayout) v.getParent();
                         parent.addView(tl);
                     }
                 }
                 else
                 {
                     LinearLayout parent = (LinearLayout) v.getParent();
                     parent.removeView(tl);
                     tl = null;
                 }
             }
         });

 BR,
 Adrian Vintu

 http://adrianvintu.com

 On Sat, Mar 27, 2010 at 5:00 PM, rubeN_vl rvanluch...@hotmail.com wrote:
  the v.getContext() did it!!!
  ty dude

  On 27 mrt, 16:48, Adrian Vintu adrianvi...@gmail.com wrote:
   in the onClick you also have

   v.getContext();
   v.getParent();
   v.getRootView();

   On Sat, Mar 27, 2010 at 4:41 PM, Adrian Vintu adrianvi...@gmail.com
  wrote:
A. create one time the container view then use setVisibility() to show
  or
hide it
or/and
B. you also have alert.getOwnerActivity() which gives you back the...
context :) you can then play around with it as you wish

On Sat, Mar 27, 2010 at 4:36 PM, rubeN_vl rvanluch...@hotmail.com
  wrote:

Same error,

how can such a simple thing be so difficult :D

if i create those outside the onclick scope, its like i can use them
only one time.
final TableRow tr = new TableRow(this);
final TextView b = new TextView(this);

On 27 mrt, 16:16, Adrian Vintu adrianvi...@gmail.com wrote:
 So toggle the visibility from GONE to VISIBLE. I think this would be
  a
quick
 solution :)

 BR,
 Adrian Vintu

http://adrianvintu.com

 On Sat, Mar 27, 2010 at 4:14 PM, Adrian Vintu 
  adrianvi...@gmail.com
wrote:
  It's my pleasure to help :)

  I think an easy solution is to use view.setVisibility(View.GONE)

  Does this work for you?

  BR,
  Adrian Vintu

 http://adrianvintu.com

  On Sat, Mar 27, 2010 at 4:10 PM, rubeN_vl 
  rvanluch...@hotmail.com
wrote:

   checkboxrifle.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 Patient p = (Patient) spinner.getSelectedItem();
                 Service s = new Service(RIFLE);
                 if (((CheckBox) v).isChecked()) {
                         p.addService(s,0);
                         DataAccess.registerService(p,s);
                         //TableRow tr = new TableRow(this);
                     //TextView b = new TextView(this);
                         //tr.removeView(b);
                         //TableLayout tl =
  (TableLayout)findViewById(R.id.dynatabel);
                     //tl.removeView(tr);

                     // b.setText(Dynamic tekst);
                     // tr.addView(b);
                         //tl.addView(tr);
                 } else {
                     p.removeService(0);
                     DataAccess.unregisterService(p, s);
                 }
             }
         });

  1st of all tx for ur time.
  So, i want to do this, push a checkbox, get an object in a
  spinner,
  add a row to a tabel. Uncheck the checkbox and the row gets
  removed.
  If i create textview outside the scope, i can add 1 new row to
  the
  table. Second time i check the checkbox i get the error described
  previously.
  The removeView() just removes the view, the application does not
  crash, but no new rows are added. It just removes the previously
  created 

[android-developers] Re: ListView scrolls very very slow

2010-03-27 Thread Paul Turchenko
Well, it's obvious that these 2 methods are blocking your UI thread
which makes it starve:
1. i.getShortDescription()
2. Utils.getTimeLeft(i.getEndDate())

If you'd explain in more details what these methods do, perhaps there
could be come kind of solution to your problem.

On Mar 27, 5:52 pm, jw jwilner...@gmail.com wrote:
 I can add that I've also tried the ViewWrapper pattern without any
 performance difference.

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Re: How to add Edittext box in a home screen widget

2010-03-25 Thread Paul Turchenko
Well, google's search widget doesn't show edittext box. You can prove
it by digging into it with hierarchy viewer. For now, you can't have
EditText in app widget (at least for default android's home launcher)

On Mar 25, 4:25 pm, And-Rider rahulregunat...@gmail.com wrote:
 I want to create a custom widget for my application which should be
 used for doing search internally in my application.But i am not able
 to place an Edit text control inside a widget.While browsing further i
 found that Edittext box was not included for creating custom widgets

 http://developer.android.com/intl/de/guide/topics/appwidgets/index.ht...

 http://developingandroid.blogspot.com/2009/09/simple-home-screen-widg...

 I was surprised to see google's search widget showing an edittext
 box.Is there a way to add an edittext box in a widget...?

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Re: My ProgressDialog suffers from ANR timeouts?

2010-03-20 Thread Paul Turchenko
Well, but generally, it's not a solution. Try making your buffer size
content-length dependent:

totalSize = conn.getContentLength();
.

byte data[] = new byte[totalSize/100];

This way you'll get exactly +1% update for download progress. For most
generic case I would suggets somethig line this:


totalSize = conn.getContentLength();
.

tmpBufSize = totalSize/100;
byte data[] = new byte[tmpBufSize = 1 ?tmpBufSize:1024];




On Mar 20, 1:24 pm, dsukhram duanesukh...@gmail.com wrote:
 Thanks Paul you were correct.  I increased the buffer size by 8 times
 and it worked.

 On Mar 19, 10:28 pm, Paul Turchenko paul.turche...@gmail.com wrote:

  Try increasing your buffer size (or better, make it content-length-
  dependent). It seems that UI theread reseives too much tasks to do and
  this makes it other tasks to wait too long. This makes android show
  ANR message. If this not helps, try dealing with download from your
  own separate thread. This might help you find what's wrong. But IMHO,
  it seems that somethig else makes your UI thread starve - this causes
  ANR message.

  On Mar 20, 12:29 am, dsukhram duanesukh...@gmail.com wrote:

   this is my inner class that handles the downloading and progressbar

   public class DownloadDBTask extends AsyncTaskObject, Integer, Object
   {
   private int mProgress;

   public Object doInBackground(Object ...urls)
   {
   //download file
   int totalSize =0;

   try
   {
   URL urlFile = new URL(http://www.xxx.com/test.db;);
   URLConnection conn;
   conn = urlFile.openConnection();
   totalSize = conn.getContentLength();

   Log.i(INFO,total size of file +totalSize);
   BufferedInputStream bis = new
   BufferedInputStream(urlFile.openStream());
   BufferedOutputStream bout = new BufferedOutputStream(new
   FileOutputStream(PATH+DB_NAME),1024);
   byte data[] = new byte[1024];
   int bufferSize =0;
   int currentSize = 0;

   while((bufferSize = bis.read(data)) != -1 )
   {

   currentSize +=bufferSize;
   bout.write(data,0,bufferSize);

   publishProgress((int) ((currentSize / (float) totalSize) * 100));

   }

   Log.i(INFO,Done downloading);

   bout.flush();
   bis.close();
   bout.close();

   }

   catch(IOException e)
   {
   Log.e(ERROR,e.toString());

   }

   return (new Object());

   }

   public void onPostExecute(Object result) {

   mProgressDialog.dismiss();

   }

   protected void onProgressUpdate(Integer... progress) {

   mProgressDialog.setProgress(progress[0]);

   }

   protected void onPreExecute(){

   showDialog(2);

   }
   }

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Re: How can i select data onListClick

2010-03-20 Thread Paul Turchenko
What exactly not working?

On Mar 20, 2:34 pm, Nandan . bhavesh2...@gmail.com wrote:
 its pass bellow information to another activity

 android.content.contentresolver$cursorwrapperin...@43d4e598

 plz help me



 On Sat, Mar 20, 2010 at 5:50 PM, Nandan . bhavesh2...@gmail.com wrote:
  Hiii

  i had used Listview to display phoneno from phonebook.now i want on the
  onListClick event just select the phonno and pass phone no to another
  activity.
  but its not working . can anyone help me . my code is below.
  Thank you very much for help.

  private void populateContactList() {
          // Build adapter with contact entries
          Cursor cursor = getContacts();
          String[] fields = new String[] {
                  ContactsContract.Data.DISPLAY_NAME
          };
         SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
  R.layout.contact_entry, cursor,
                  fields, new int[] {R.id.contactEntryText});
          mContactList.setAdapter(adapter);
          mContactList.setOnItemClickListener(onListClick);
      }

      private ListView.OnItemClickListener onListClick=new
  ListView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView? mAdapterView, View v, int
  position,
                  long id) {
              // TODO Auto-generated method stub

    // I have problem in this line to select data from listview

  String callno = mContactList.getAdapter().getItem(position).toString();

  Intent i=new Intent(ContactManager.this, phonebookcall.class);
              i.putExtra(abcd, callno);
              startActivity(i);
          }
      };

  --
  B!-!/-\\/!=$!-!

 --
 B!-!/-\\/!=$!-!

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Re: My ProgressDialog suffers from ANR timeouts?

2010-03-19 Thread Paul Turchenko
Try increasing your buffer size (or better, make it content-length-
dependent). It seems that UI theread reseives too much tasks to do and
this makes it other tasks to wait too long. This makes android show
ANR message. If this not helps, try dealing with download from your
own separate thread. This might help you find what's wrong. But IMHO,
it seems that somethig else makes your UI thread starve - this causes
ANR message.

On Mar 20, 12:29 am, dsukhram duanesukh...@gmail.com wrote:
 this is my inner class that handles the downloading and progressbar

 public class DownloadDBTask extends AsyncTaskObject, Integer, Object
 {
 private int mProgress;

 public Object doInBackground(Object ...urls)
 {
 //download file
 int totalSize =0;

 try
 {
 URL urlFile = new URL(http://www.xxx.com/test.db;);
 URLConnection conn;
 conn = urlFile.openConnection();
 totalSize = conn.getContentLength();

 Log.i(INFO,total size of file +totalSize);
 BufferedInputStream bis = new
 BufferedInputStream(urlFile.openStream());
 BufferedOutputStream bout = new BufferedOutputStream(new
 FileOutputStream(PATH+DB_NAME),1024);
 byte data[] = new byte[1024];
 int bufferSize =0;
 int currentSize = 0;

 while((bufferSize = bis.read(data)) != -1 )
 {

 currentSize +=bufferSize;
 bout.write(data,0,bufferSize);

 publishProgress((int) ((currentSize / (float) totalSize) * 100));

 }

 Log.i(INFO,Done downloading);

 bout.flush();
 bis.close();
 bout.close();

 }

 catch(IOException e)
 {
 Log.e(ERROR,e.toString());

 }

 return (new Object());

 }

 public void onPostExecute(Object result) {

 mProgressDialog.dismiss();

 }

 protected void onProgressUpdate(Integer... progress) {

 mProgressDialog.setProgress(progress[0]);

 }

 protected void onPreExecute(){

 showDialog(2);

 }
 }

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Re: WTA: Change default keyboard when inserting password how to?

2010-03-13 Thread Paul Turchenko
Just set inputType to number|password of the EditText that will
receive password input. This should work.

On Mar 13, 8:48 am, Monica Chrismawati monica.rady...@gmail.com
wrote:
 Hi everyone, i am currently developing an application and i need a
 login menu. In login menu there is a password textfield, but i don't
 know how to change the default keyboard.
 I want the keyboard changes only appear only number ( not complete
 keyboard as the default)  when user at login menu.
 What should i do? Is there any class that handle the behavior of on
 screen keyboard??

 Thx :))

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


[android-developers] Re: Programmatically Create/Destroy AppWidgets

2010-03-13 Thread Paul Turchenko
App widgets (home screen widgets) live in separate process and you
have no control on adding/removing them. All you can do is tell in
your AndroidManifest.xml that you have a new appwidget and user will
seen it when he decides to place something to his homescreen.

On Mar 5, 9:04 am, Tanay Shah tanay.s...@gmail.com wrote:
 Hey,

 Is it possible to programmatically create and/or destroy AppWidgets?

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

2010-03-13 Thread Paul Turchenko
Well, the buttom is just the same as a View except is has different
look (it defines in via the constructor). As you can see, onClick
event is defined on the View class, and all that button does is
defining the way it should look when View is focused/selected/pressed/
etc. Hope this helps

On Mar 12, 10:01 am, mike kiranbollepa...@gmail.com wrote:
 hai,

 i struck in implementing progress bar functionality of my splash
 screen.

 i know horizontal progress bar implementation that fills yellow from
 left to right but the requirement is progress bar should be loader bar
 that appears when windows is loading in the system. more detailly,

 The loader bar or progress bar is same as Microsoft Windows loader
 bar - the yellow bar continually move from left to right. Appear on
 left, move in the right direction and disappear on the right side than
 appear on the left again immadiately and process start again. This is
 not filling bar which fill the space from left to right.

 how to do this. please suggest 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: using charts in android applications

2010-02-21 Thread Paul Turchenko
The best charting component at this time is aiCharts (http://
www.artfulbits.com/Android/aiCharts.aspx).

On Feb 18, 9:16 pm, Ilya ulyanov...@gmail.com wrote:
 Hi all!
  How can I build a pie chart in my application?

 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: Is it ever OK to use AbsoluteLayout?

2009-12-21 Thread Paul Turchenko
I would suggest creating your own layout for this purpose.

On Dec 21, 10:01 pm, k_day kevin.r@gmail.com wrote:
 I understand the problems with assigning a fixed position to UI
 components, but I would like to use AbsoluteLayout in a way such that
 the position of the components are chosen dynamically, calculated
 based on the screen size.

 Here is why I am thinking this may be easiest:

 I want to display a nXm grid of imageViews on the screen (n,m chosen
 by the user) with 0 padding betweeen the imageViews.  With
 absoluteLayout, I could easily choose the size of the imageViews and
 in a way that maximizes the amount of the screen that is used.

 The reason that using relativeLayout or LineraLayouts may not work for
 this is because when a user touches an image in this grid, I would
 like it to pulse (quickly scale larger than back to its normal
 size).  If I scale an imageView using realtive or linear layout, it
 would resize the adjacent imageViews (since the padding is 0), which I
 don't want.  I would prefer permitting temporary overlapping of the
 imageViews.

 This is currently the approach I have taken, except instead of
 changing the position of imageViews, I am just drawing bitmaps to the
 canvas at the locations I calculated.  I can't use the animation
 framework, however, on bitmaps that I draw to a canvas.

 Is this an acceptable use for AbsoluteLayout, or is there a better way
 to achieve what I want to do here?

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


[android-developers] Re: NDK all from within Eclipse

2009-12-16 Thread Paul Turchenko
Really cool! Thanks a lot!

On Dec 16, 1:02 am, Robert Green rbgrn@gmail.com wrote:
 I was going to post this to the group but figured I'd write up a how-
 to on my website instead.  Basically, here's how you configure Eclipse
 to do nice C/C++ editing and automatically build your native code for
 you on-save.  It also automatically refreshes your lib directory and
 consequently ADT puts it straight into your APK.

 http://www.rbgrn.net/content/348-get-your-eclipse-integrated-ndk-on

 I'll post this to the NDK dev group as well.  I can't believe I didn't
 set that up sooner.  It cut my native development time in half.  Let
 me know if you have problems/questions with it.

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


[android-developers] Re: about how to detect the usb device in Android

2009-12-11 Thread Paul Turchenko
Only thing I can state is that android.intent.action.MEDIA_MOUNTED is
for SD card being inserted... My guess is that for USB device
discovery you'll have to dig something more low-level.

On Dec 11, 8:45 am, lidemin lidemin2...@gmail.com wrote:
 hi all,
     now  i have ported the Android to a x86 platform.
 And i want to detect the USB plug-in.But follow the information about
 the android.intent.action.MEDIA_MOUNTED
 in the SDK's DOC, i can't receive the event of the USB's plug-in.

 i have checked my code and it can receive the other event ( ps:intent
 action) .

 Besides, in the CLI, i could mount the USB device to /sdcard but it
 couldn't mount automatically.

 have seen some source code about the mount and mountlistener and it
 should be effective.

 who can tell me what the problem is?  and my SDK's version is 1.5.

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


[android-developers] Re: How to change widget layout background or hide it dynamically?

2009-12-11 Thread Paul Turchenko
How about remoteView.setViewVisibility(R.id.your_linear_layout_id,
View.Gone).

On Dec 9, 10:58 pm, pcm2a reeeye...@gmail.com wrote:
 I have a simple layout:
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
                 android:background=@drawable/background
         android:layout_height=fill_parent
         android:layout_width=wrap_content
         android:orientation=vertical

 In my method onUpdate I can get the remote view:

 RemoteViews remoteView = new RemoteViews(context.getPackageName(),
 R.layout.somelayout);

 I cannot find any information on how to change or hide the background
 image.

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

2009-12-10 Thread Paul Turchenko
+1

On Dec 8, 1:18 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:
 Doesn't anyone got input on this issue? Isn't it possible to solve the
 problem?

 On 6 Dec, 19:50, Kaj Bjurman kaj.bjur...@gmail.com wrote:

  I tried to create a folder named xml-small and placed the widget
  provider xml-files there.

  It looks like I need to use something like 50x50 dip for one cell on
  the DSTL1, so 100x50 dip is 2x1, and 200x50 dip is 4x1 but that does
  only work on the DSTL1. The HTC Tattoo which also is considered xml-
  small displays a 3x1 widget if I use 200x50 dip :(

  240x50 dip works as 4x1 on HTC Tattoo

  On 6 Dec, 19:09, Kaj Bjurman kaj.bjur...@gmail.com wrote:

   Hi,

   I got some problems when specifying the size of my AppWidget / Home
   screen widget. The widget is currently available in the sizes 1x1, 2x1
   and 4x1 if we count in cells.

   Everything works in E.g. HTC Tattoo (240 x 320), HTC Magic (320x480)
   and Motorola Droid (480 x 854), but I do have problems on the DSTL1
   (240x400).

   I have specified the sizes according to the description 
   here:http://android-developers.blogspot.com/2009/04/introducing-home-scree...

   Below is what I got in my xml-files.

   The problem on the DSTL1 is that it says that the 4x1 widget is too
   large to be placed on the home screen. The 2x1 widget looks like it is
   3x2, and the 1x1 widget looks like 2x2.

   What should I do? What's wrong?

   !-- small, 1x1 --

   appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
   android
       android:minWidth=72dip
       android:minHeight=72dip
       android:updatePeriodMillis=0
       android:initialLayout=@layout/widget_configure/

   !-- medium, 2x1 --

   appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
   android
       android:minWidth=146dip
       android:minHeight=72dip
       android:updatePeriodMillis=0
       android:initialLayout=@layout/widget_configure/

   !-- large, 4x1 --

   appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
   android
       android:minWidth=294dp
       android:minHeight=72dp
       android:updatePeriodMillis=0
       android:initialLayout=@layout/widget_configure/

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