[android-developers] Re: update TextView inside a TimerTask

2012-03-13 Thread harsh chandel
you can use this timer given in devloper guide

 new CountDownTimer(3, 1000) {

public void onTick(long millisUntilFinished) {

TextView txttimer=(TextView) 
findViewById(R.id.timeremaining);
txttimer.setText(Time remaining: 0: + 
millisUntilFinished /
1000);
}

public void onFinish() {


}
}.start();

On Mar 13, 1:54 pm, Alimooghashang alimooghash...@gmail.com wrote:
 thank you very much
 now my application works well

 On Tue, Mar 13, 2012 at 11:21 AM, tsukishiro yamazaki 







 tsukishir...@gmail.com wrote:
  You can take the sample here
 http://developer.android.com/guide/topics/ui/dialogs.html#ProgressDialog
  for your reference.
  Check the sample code marked by the section  *Example ProgressDialog
  with a second 
  thread*http://developer.android.com/guide/topics/ui/dialogs.html#
   

  Thanks and best regards,
  - tsukishiro

  On Tuesday, March 13, 2012 1:20:18 PM UTC+9, Ali wrote:

  Hi
  i have made a timer and a timer task, and i need to update my textview
  every seconds
  how can i 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

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

2012-01-11 Thread harsh chandel
hi
you can use setinitialscale attribut asnd pas value 200 or 300 in it

On Jan 10, 7:37 pm, freefly freefly...@gmail.com wrote:
 Hi all,
     I am developing an application where I need to zoom the text on
 the WebView, as much as a single word on the whole screen, is this
 possible ? I have tried with the WebView, the standard WebView zoom
 limits to an extend. I am new to Android development, I would really
 appreciate any help.

 Kind regards

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

2012-01-11 Thread harsh chandel
try this


public boolean onKeyDown(int keyCode, KeyEvent event) {

if (keyCode == KeyEvent.KEYCODE_BACK) {
  super.onKeyDown(keyCode, event)
  do something
return true;
}
return false;
}


On Jan 11, 5:14 pm, vani reddy vani.reddy.bl...@gmail.com wrote:
 Thanks.
 I tried this , the problem is onKeyDown is never fired

 On Wed, Jan 11, 2012 at 5:41 PM, Ratheesh Valamchuzhy
 android...@gmail.comwrote:









  try this

  public boolean onKeyDown(int keyCode, KeyEvent event) {
      if (keyCode == KeyEvent.KEYCODE_BACK) {
          moveTaskToBack(true);
          return true;
      }
      return super.onKeyDown(keyCode, event);
   }
      public void backButtonPressed(View v) {
      //do this

   }

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

 --
 Regards,
 Vani Reddy

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

2011-12-12 Thread harsh chandel
use the following url Environment.getExternalStorageDirectory()+/
stocks.html
you can also check if the following file exsists

File f=new File(ur);
System.out.println(file exsists+f.exsists());//this line will print
true if file exsists otherwise false

On Dec 11, 12:12 pm, Stephan Wiesner testexpe...@googlemail.com
wrote:
 Hi,
 I need to open a html file that sits on my sdcard in my default
 browser.

 The code works fine if the file is on the net or in my asset folder,
 but if I want to open it from the sdcard  I get an
 12-11 08:06:34.650: E/AndroidRuntime(6829):
 android.content.ActivityNotFoundException: No Activity found to handle
 Intent { act=android.intent.action.VIEW
 cat=[android.intent.category.BROWSABLE] dat=content:///mnt/sdcard/
 download/stocks.html?text/html }

                                 // String url = 
 file:///android_asset/stocks.html;
                                // String url = file:///mnt/sdcard/
 download/stocks.html;
                                 String url = 
 content:///mnt/sdcard/download/stocks.html?text/
 html;
                                 //File sdCard = 
 Environment.getExternalStorageDirectory();
                                 //File dir = new 
 File(sdCard.getAbsolutePath() + /download/
 stocks.html);

                                 Intent i = new Intent(Intent.ACTION_VIEW);
                                 
 i.addCategory(android.intent.category.BROWSABLE);
                                 i.setData(Uri.parse(url));
                                 startActivity(i);

 Anything else I need to set on the Intent to make it realize that I
 want to open a browser?
 Thanks,
 Stephan

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


[android-developers] Re: How can i Assign a id to view Programmatically?

2011-12-11 Thread harsh chandel
you can do setid(any no) this will be your id
it is used to dynamically assign id to a view or a viewgroup

On Dec 11, 3:44 pm, Duygu Kahraman duygu.kahram...@gmail.com wrote:
 Selam Ali;

 Asıl sormak istediğim şu;mesela  TextView tv=new TextView(this); diye bir
 view yarattım.Eğer xmlde yaratmış olsaydım id sini de orada set edip
 çağırabilecektim kodun içinden.Yada R dosyasında bir referans oluşturmuş
 olacaktı.Ama program içinde yarattığımda R içinde tvye ait birşey
 yok.Sadece setId() diye birşey var ama setId() bana ben extra bir referans
 vermek istediğimde gerekli gibi geliyor.

 Yani şöyle birtane scrollview yaptım içinde birsürü item ekledim.Bunlardan
 3.sü yada 5.sini aldığımda birşey yapmak istiyorsam evet bunlara sıralı bir
 id vermeliyim ki kaçıncısını aldığımı anlayayım.İşte burada sıralı id
 vermek için setId() yi kullanırım.

 Yanlış mı düşünüyorum anlamıyorum.Sanki tv default bir id ataması
 gerekiyormuş gibi düşünüyorum.Yada veriyor ben ulaşmasını beceremedim.
 Çok basit biliyorum ama kafama takıldı.

 11 Aralık 2011 12:10 tarihinde Ali Chousein ali.chous...@gmail.com yazdı:









  Yazdığın kodun içinden view objelerini yaratınca, findViewById()
  fonksiyonunu çağırmana gerek yok. Yarattığın objelere referanslar
  elinde var zaten. Referansları saklayıp sonra kullanabilirsin. View
  objelerini XML'den tanımlasaydın, findViewById() sana aynı
  referansları döndürecekti.

  -
  Ali Chousein
  Weather-Buddy
 http://weatherbuddy.blogspot.com|http://twitter.com/weather_buddy
  Geo-Filtered Assistant
 http://geo-filtered-assistant.blogspot.com
 https://marketplace.cisco.com/apphq/products/994

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

 --
 ---
 Duygu Kahraman

 http://tr.linkedin.com/in/duygukahramann

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

2011-09-12 Thread harsh chandel
Hi
try to get the file from assets manager

AssetManager asm =getAssets();
asm.open(name of the file)

Thanks Harsh

On Sep 13, 6:33 am, Mark Murphy mmur...@commonsware.com wrote:
 Just for grins, try all lowercase (shopping) instead of mixed case (Shopping).









 On Mon, Sep 12, 2011 at 11:55 AM, darrinps darri...@gmail.com wrote:
  I have an asset that I am trying to load in WebView. If the same file
  is read from the SD card, all works fine, but I cannot read it when
  packaged as an asset.

  Here is the code

  WebView webview = new WebView(this);

  ((ViewGroup)findViewById(R.id.content)).addView(webview, 0);
  webview.getSettings().setJavaScriptEnabled(true);
  webview.setWebViewClient(new WebViewClient()
  {
     ... //code elided for brevity
     webview.loadUrl(file:///android_asset/Shopping/index.html);
  }

  This same code works fine if I use another html file if it isn't in
  its own directory.

  For example, this works:
  webview.loadUrl(file:///android_asset/sample.html);

  Also, as stated above, if I read it from an SD card this all is OK.

  For example, this also works:
       webview.loadUtl(content://com.android.htmlfileprovider/sdcard/
  downloads/Shopping/index.html);

  The only think that doesn't work is when the thing is in its own
  directory it seems. Is packaging an asset inside its own directory a
  no no? I'd like to keep things tidy if possible, but if it cannot be
  done then I will remove the Shopping directory and plunk everything
  down under assets.

  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

 --
 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: Can I get x and y positions of Bitmap after Rotating, How????

2011-06-30 Thread harsh chandel
if you are setting a bitmap in a image view
you can use getlocationonscreen method
or getLocationInWindow

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


[android-developers] Google Reader

2011-06-20 Thread harsh chandel
I want to integrate Google reader in my application,
Is there any  api available?
Or please suggest me a suitable way to do that.

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


[android-developers] Re: How to immediately dispatch touch events outside of a PopupWindow

2011-06-15 Thread harsh chandel
how are you using your pop up as alert dialog or just dialog
 try using dialog may be this coulod help

On Jun 15, 10:48 pm, Shri shri.bo...@gmail.com wrote:
 If a ListPopupWindow is being displayed, I can tap on buttons outside
 it, and the buttons receive the touch event. However, while displaying
 a PopupWindow, tapping outside does not cause the button to be
 clicked. It just dismisses the PopupWindow. I then need to tap one
 more time to click the button. I tried using #setOutsideTouchable with
 true and false arguments, but it did not change anything. Any idea how
 to make PopupWindow behave more like ListPopupWindow in this regards?

 Thanks
 Shri

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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-07 Thread harsh chandel
go to ddms select device on top you have options for getting the
screen capture for device
click on capture then  save it wherever you  want

On Jun 7, 7:56 pm, Bharathi raja bharathiraja.andr...@gmail.com
wrote:
 Hi,
 thanks for ur sample code.
 As i said, they are some application screens made up of graphics component.
 For eg. Gallery3D application, all the component there in screen are
 graphics component. (those component can't see through hierarchy viewer
 tools)
 Can't test it through robotium.
 Only way to test the applicaiton is clickOnScreen() with x,y co-ordinate
 and for every action need to capture the screen and finally verify it with
 the captured image.

 below code will capture only android component(i.e widget component)

 On Fri, Jun 3, 2011 at 6:00 PM, New Developer secur...@isscp.com wrote:
  Well after much trial and error I managed to capture the entire  layout  or
  activity
  using the following code

  View   myView = findViewById(R.id.form);
  Bitmap bmp    = Bitmap.createBitmap( myView.getMeasuredWidth() ,
  myView.getMeasuredHeight() , Config.ARGB_);
  Canvas canvas = new Canvas(bmp);
  myView.draw(canvas);
  try {
     FileOutputStream out = new FileOutputStream( /sdcard/screen.jpg  );
     bmp.compress(Bitmap.CompressFormat.JPEG, 100, out);
     out.flush();
     out.close();
  } catch (Exception e) {
     e.printStackTrace();
  }

  Not sure if this will help or not ?  NOTE: that you can also save as a PNG
  if you want .

  On Jun 3, 2011, at 8:11 AM, Bharathi raja wrote:

  Hi,
  Thanks for sharing code.

  Code u shared will capture the entire screen, even if it is not widget
  component.
  [mean screen may have android or flash or web component]
  i wanted to capture all the three.

  Regards,
  Bharathiraja R

  On Fri, Jun 3, 2011 at 1:39 AM, New Developer secur...@isscp.com wrote:

  Okay I output my bitmap to file  as PNG and it only shows the  visible
  portion of the layout
  What is currently seen on the screen  not the entire layout.
  So would I change the  onClick Code to capture the entire layout ?

  thanks in advance

  On Jun 2, 3:35 pm, New Developer secur...@isscp.com wrote:
   I'm trying to do something similar

   Inside my button's OnClick I have

   View    myView  = arg0.getRootView();
   myView.setDrawingCacheEnabled( true );
   mPDF.addImage( myView.getDrawingCache() );

   I'm hoping this will capture the screen to a bitmap

   my PDF.addImage   is as follows:

           public void addImage(Bitmap bmp) {
                   ByteArrayOutputStream bos = new ByteArrayOutputStream();
                   bmp.compress(CompressFormat.JPEG, 100 , bos);

                   mImage += 5 0 obj \n +
                                     /Type /XObject\n +
                                      /Subtype /Image\n +
                                      /Width   + bmp.getWidth()  +  \n
  +
                                      /Height  + bmp.getHeight() +  \n
  +
                                      /ColorSpace  /DeviceRGB\n +
                                      /BitsPerComponent 8\n +
                                      /Length  + bos.size()  + \n +
                                      /Filter  /ASCIIHexDecode\n +
                                    \n\n +
                                    stream\n;

                   mImage += bos.toString() + \n;

                   mImage += endstream\n +
                                    endobj\n\n;
           }

   1) Is the onClick the correct way to capture the screen to bitmap ?
   2) Is the PDF code the correct way to store an image inside a PDF ?

   thanks in advance

   On Jun 2, 3:11 pm, Paul Turchenko paul.turche...@gmail.com wrote:

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

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

[android-developers] Re: Invisible Activity

2011-06-06 Thread harsh chandel
if you dont want to display your activty on the screen
dont make it as an activity  make it a different class
write the code in this and call it wherever you want this class
if you dont want the object of this class creaated every time
make it static

On Jun 6, 11:22 pm, Marcin Orlowski webnet.andr...@gmail.com wrote:
 On Jun 6, 2011 10:41 AM, Marc marcolebull...@googlemail.com wrote:

  I would like to create an app that changes the volume and then exits.
  For that I obviously won't need an UI or service, as a toast is
  enough.

 if you not need any ui for activity, simply do not use any in your
 onCreate()

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

2011-06-06 Thread harsh chandel
create the buttons dynamically  i.e. at run time
and use shared prefrence to store there state

in the on create /on resume method get the variables stored in the
shared preference
to get the current state  while loading

you can also do is check the state in any mehtod and then call that
method in oncreate and then add then do the setcontent view


On Jun 5, 1:10 am, ronroseman2...@gmail.com
programmer_...@yahoo.com wrote:
 Hello All,
   I'm trying to PreLoad information to my toggle buttons.  An example:

 If Bluetooth is enabled I was the Toggle Button to show On.
 If Airplane Mode is not enabled then I want the Toggle Button to show
 Off.

 I know how to make them turn off/on when the app is loaded, but I
 don't know how to get the states and diplay the correct state prior to
 the buttons being created.

 Anyone have any idea on this?

 Thanks in advance,
 Ron

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: ISSUE about get phone number and background process is killed.

2011-06-06 Thread harsh chandel
put this line of code to open deafult phone nos
Intent intent = new Intent(android.content.Intent.ACTION_SEND);
to open phone book

On Jun 4, 9:26 pm, amnart asayavachira smartboy...@gmail.com wrote:
 To Android Developer

 Hello.

 I am new android developer and a litte english . I has one project
 that have two issues.

 1. getLine1Number() isn't work.
      I want to get a phone number from device but get null. i try to
 solve this problem and l get
      some detail that is telephone card has problem cause androidOS
 can't to get a Phone Number.
     Unfortunately, device can't edit a phone number. i see no way out.

 2. Background process is killed
      My app have activity A and Service B. when my app is
 launch ,activity A will start Service B and give Service B run my
 background process long-lived. But i don't know when it is killed.

      My background process work on pulling data from CallLog and
 MmssmsLog on device when
      has a new row of CallLog or MmssmsLog  for save to my database .

       anyone have idea for solving my problems.

 Thank you so much

 AUM

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


[android-developers] Re: Emulator Error

2011-06-06 Thread harsh chandel
try dowblaoding the adt again

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

2011-06-06 Thread harsh chandel
try testing it on the actual phone
the canvas pixel size is less than actual screen

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


[android-developers] Re: Installing platforms without internet access

2011-06-06 Thread harsh chandel
 yes  what you can do is first run eclipse
go to help --install new  software -- click on add at the top right
corner
a pop will come click on the archieve and browse to the location
where
your zipped adt is located --wait for the process to finish and then
click on the next
--next until you arrive at finish
the open windows tab in you eclipse
go to preference ---android--select your path to android sdk
folder(unzipped version)
and point it to android-sdk the folder which coantain tools

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

2011-06-06 Thread harsh chandel
 use gettext size to get the size of the textview
this will return  size in float

if you know the current size you can settextsize

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


[android-developers] Re: switching from one app to another

2011-05-30 Thread harsh chandel
in manifest file put intent filter as callback and browseable


On May 29, 1:02 pm, Dianne Hackborn hack...@android.com wrote:
 This will also cause the browser to add new windows/tabs to the single task
 it maintains.  Please don't do this kind of thing. :}



 On Sun, May 29, 2011 at 12:01 AM, Doug beafd...@gmail.com wrote:
  On May 26, 5:06 pm, bob b...@coolgroups.com wrote:
   I have an app that opens a web browser, but after awhile I want the
   app to switch from the web browser back to itself.  Is there an easy
   way to do this?

  I agree with Justin and Mark, but I don't have any ethical qualms in
  sharing a solution that does what you want anyway!  :-)

  Below, if the started Dummy class just called finish() when launched,
  this will achieve the effect you are looking for, but the browser task
  will still be alive and the user could return to it if they want.

  By the way, don't do this unless you really understand what you're
  getting into.

  Doug

  public class Main extends Activity {
     Handler handler;

     @Override
     public void onCreate(final Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         handler = new Handler();
         findViewById(R.id.button).setOnClickListener(new
  View.OnClickListener() {
             public void onClick(final View v) {
                 startActivity(new Intent(Intent.ACTION_VIEW,
  Uri.parse(http://www.google.com;)));
                 handler.postDelayed(new Runnable() {
                     public void run() {
                         final Intent intent = new Intent(Main.this,
  Dummy.class);

  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                         getApplicationContext().startActivity(intent);
                     }
                 }, 1);
             }
         });
      }
  }

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

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

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

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


[android-developers] Re: How to draw a circle on an image

2011-05-16 Thread harsh chandel
use custom view to draw the circle and then place it in the activity


On May 15, 2:42 am, Droid rod...@gmail.com wrote:
 I have an image that needs a red circe at x,y coords. Its in an image
 view. I can get x,y coords but no idea at all about how to place a red
 circle?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: keeping track of time a user is actively using an android app

2011-05-16 Thread harsh chandel
You can use a base class  for all activty and use the timer code
within that class
if your program is long you wont have to artie the code in every class

On May 15, 12:51 am, TreKing treking...@gmail.com wrote:
 On Fri, May 13, 2011 at 2:58 PM, laurent bouis lbou...@gmail.com wrote:
  I did some research and the only suggestion I found so far is using the
  onResume() and onPause() methods of activities to keep track of elapsed time
  between those 2 calls; I would probably need to do this in each activity of
  the application which doesn't seem to be a very elegant solution.

 Probably as good as it's going to get. Check out the delegation patterns
 discussed in this 
 thread:http://groups.google.com/group/android-developers/browse_thread/threa...

 You could easily have a delegate object that tracks the time spent in a
 given activity by calling mDelegate.startTiming() / mDelegate.stopTiming()
 in onStart() / onStop(), respectively, in each activity.

 Note that you should use the onStart() / onStop() pair. If you show a
 dialog, for example, your activity is still in use but it gets onPause()
 called.

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

2011-05-11 Thread harsh chandel
please check if you added permissions in the manifest file
and your internet is connected at the time you run the app

On May 9, 8:34 pm, Innocent innocentr...@gmail.com wrote:
 Hi guys I'm working on a project and my GPS on the emulator am using
 doesn't seem to function!! WHEN I try to run a simple program to show
 my location it does not get the location!! Could some one please
 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: onBackPressed to hide Not destroy activity

2011-05-10 Thread harsh chandel
override the back button
and pass intent to the class you want to go to.
and save the state of the current activity

On May 10, 1:54 pm, Ali Chousein ali.chous...@gmail.com wrote:
 I agree with Muhammad. Save your instance state and restore it when
 necessary, instead of trying to do something against the framework.

 -Ali

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

2011-05-09 Thread harsh chandel
no need to add it in manifest
simply create an mediaplayer

this will be the command:
int i=getResources().getIdentifier(s,raw,getPackageName());
if(i!=0){
MediaPlayer player = new
MediaPlayer().create(getBaseContext(),i);;
player.setVolume(0.9f, 0.9f);
player.start();
}

s=name of the file
raw is folder

On May 7, 7:58 pm, Meba mehdi.bahr...@gmail.com wrote:
 Hi,
 I want to use a MP3 file as resource and copy this to res/raw and I
 can access in activity by R.raw.MP3_FILENAME but when start this
 application can't find this resource.(I'm try define it as meta-data
 but I don't know how can I define this name)
 how can I add mp3 file name in manifest and access to this.

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


[android-developers] Re: ListView - is it possible to limit the fling speed?

2011-05-09 Thread harsh chandel
when you scroll with the help of fling
compare the speed with which you want to scroll
like if velocity (some value dont scroll
if velocity is some value scroll

On May 9, 9:03 pm, Omar Adobati omar.adob...@gmail.com wrote:
 Hi Everyone,

 I would like to knoe if I can limit the speed of the fling gestures in my
 ListActivity and if it is possible to stop the scrolling of the same list
 when I touch it.

 My current situation is the following: If I perform a vertical scroll that
 trigers the Fling state, sometimes (often actually) my List View scrolls
 full speed to the bottom (or to the top) and dose't stop till it reaches the
 final position. This is not really user friendly... is there a way to limit
 it?

 I have already tried with setFastScrollEnabled(false); but it seems to don't
 work.

 Thanks to everyone who would like to 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: Problem in Creating Menu

2011-05-09 Thread harsh chandel
you want to dispaly this menu bar at the bottom of the  screen right
you have many ways to do this you  can create and paste it like an
image on the bottom of the screen
 or you can put tabhost .


or next way is little complex but it is the way i do it

public class BottomMenu extends LinearLayout {
Intent backIntent;
public GridView view;
private LayoutInflater inflater;
Context context;
ViewHolder holder;

public BottomMenu(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
inflater = (LayoutInflater) context

.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = (GridView)inflater.inflate(R.layout.bottommenugrid, 
null);
init();
}

public BottomMenu(Context context) {
super(context);
this.context = context;
inflater = (LayoutInflater) context

.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = (GridView)inflater.inflate(R.layout.bottommenugrid, 
null);
init();
}

public void init() {
view.setVerticalScrollBarEnabled(false);
view.setHorizontalScrollBarEnabled(false);
removeAllViews();
holder = new ViewHolder();
view.setTag(holder);
addView(view);
view.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
54));
view.setOnItemClickListener(new OnItemClickListener() {

public void onItemClick(AdapterView? parent, 
View view,
final int pos, long id) {
handleClick(pos);
}
});
view.setAdapter(new BottomMenuGridAdaptor(this.context));
}

class ViewHolder
{

}

public void handleClick(int pos)
{
Common.selectedTabID=pos;
switch (pos)
   {
   case 0:
   {
   Intent intent=new 
Intent(context,EnquiriesActivity.class);
   context.startActivity(intent);
   break;
   }

   case 1:
   {
   Intent intent=new 
Intent(context,AccountOpeningActivity.class);
   context.startActivity(intent);
   break;
   }

   case 2:
   {
   Intent intent=new 
Intent(context,TransfersActivity.class);
   context.startActivity(intent);
   break;
   }

   case 3:
   {
   Intent intent=new 
Intent(context,PaymentsActivity.class);
   context.startActivity(intent);
   break;
   }
   }
}

}


On May 9, 2:40 pm, MOHIT SHARMA mohit7...@gmail.com wrote:
 Hi ,

 I want to create menu like this(shown in fig ) . I want to display my menu
  without pressing Menu key .
 [image: 1.png]

 Also do tell what this bar is called in Android (API level 8/10) Any kind of
 help would be appreciated .

  1.png
 11KViewDownload

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

2011-05-03 Thread harsh chandel
can you put the code

On May 3, 5:58 am, Albert Rosa rosalb...@gmail.com wrote:
 So this is my first time working with android and the sqlite db. I followed
 the instructions and was able to have a db connection where i was able to
 create and edit records. However i changed the schema of the db just to make
 it easier on me.

 Here is when i get slapped, i updated the version number, and modified the
 create statement to reflect the change. The onUpdate function is not being
 hit when i run the app again.

 Im not sure what I may be doing wrong. Any help suggestions are greatly
 welcomed and appreciated.

 Thanks for the 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: How to get MD5 fingerprint for google maps in windows 7 ?

2011-05-03 Thread harsh chandel
create a folder in one of the drives which has file name keystore
please use this location while giving set command you find  on net to
generate md5

On May 3, 12:23 am, Goutom goutom.sust@gmail.com wrote:
 Hello TreKing,
       u dont need to read the documentation.
 Regards,
          GoutomOn Wed, Apr 20, 2011 at 10:56 AM, TreKing 
 treking...@gmail.com wrote:
  On Fri, Apr 15, 2011 at 4:12 PM, Goutom goutom.sust@gmail.com wrote:

  How to get MD5 fingerprint in windows 7(64 bit) to use  google maps  in my
  app?

  Have you tried reading the documentation?

  -
  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

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

2011-04-27 Thread harsh chandel
generate the tokens in your app whatever you want to send
and then send it to server
the server side coding i dont know
but for  client side coding i can tell you if you have any queries i
have already done this for 2 apps


On Apr 27, 10:01 pm, TreKing treking...@gmail.com wrote:
 On Tue, Apr 26, 2011 at 3:43 AM, yogendra G yogi2...@gmail.com wrote:
  In my app have my own search bar,in tht if i enter anything like jobs- i
  shud get detail of tht jobs from my own server. So how can i do it

 1 - Send a request to your own server.
 2 - In your own server, send a response based on the request.
 3 - In your app, handle the response.

 The details of this have nothing to do with Android.

  ,Any 1 get me sum links or code for it for any web services kind.

 Try Google and a spell-checker.

 --- 
 --
 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: which is the fastest encryption scheme that i can use with android?

2011-04-27 Thread harsh chandel
pci encryption

On Apr 27, 3:23 pm, Hitendrasinh Gohil hitendra.virtuei...@gmail.com
wrote:
 hi,

 can anyone tell me which the fast encryption scheme in android that i
 can use?

 regards,
 hitendrasinh gohil

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

2011-04-26 Thread harsh chandel
the procedure is as follows
1. get a md5 fingerprint
the command is keytool.exe -list -alias androiddebugkey -keystore D:
\Androidkeystore\debug.keystore -storepass android -keypass android
but make sure the D: drive coantains the androidkeystore file (located
in the .android folder )
2.type the md5 fingerprit generated in the link given by google to get
the api key
3.use this key
On Apr 26, 9:16 am, kaushik p kaushiks...@gmail.com wrote:
 Hi all ,

 I am currently doing an app , in which to show the current location of the
 user of gmap, but the problem is i am not able to get the Api key

 procedure i used to get this key is exactly what is given 
 inhttp://code.google.com/android/add-ons/google-apis/mapkey.html

 I always get error

  Keytool not found ,declared .

 Please help me with this as with out this feature my complete project is not
 useful .

 --
 ThanksRegards
 Kaushik Pendurthi

 http://kaushikpendurthi.blogspot.com/

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


[android-developers] Re: Programatically unchecking items in a dialog

2011-04-13 Thread harsh chandel
write the setitemchecked method withinin oncreate method.

On Apr 13, 9:56 am, Akshay Goel xpectro...@gmail.com wrote:
 But I am manipulating the data by calling setItemChecked(). When I
 said updating the UI, I meant updating data that results in refreshing/
 changing the UI.

 Thanks,
 Akshay

 On Apr 12, 10:32 pm, lbendlin l...@bendlin.us wrote: notifyDataSetChange 
 sounds like the best solution, but for that you need to
  actually change the data set, not the UI. So you would need to manipulate
  the checked flag in the data.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 convert iPhone 3-D game code to run on Android devices?

2011-04-13 Thread harsh chandel
you have to move  to java

On Apr 13, 10:55 am, Atul Prakash atul.prakas...@gmail.com wrote:
 Dear Friends,

 I need to convert our existing iPhone 3-D action game code to run on
 Android. Recently, I have developed 2-D game on Android platform and
 now I am moving towards 3-D. These days I am exploring the options to
 convert iPhone/iPad  Symbian code to run on Android devices.

 Should I write the entire code of iPhone 3-D game(previously written
 in Objective C using OpenGL ES) from scratch in Java using OpenGL
 apis, once again?

 I have also successfully installed and studied samples of  Android
 NDK(specially San Angles sample code) as well. I am also looking for 3-
 D game using OpenGL example in Android as well.

 Is the use of Android NDK is recommended in order to convert iPhone
 code on Android platform or I should code in Java?

 I am looking forward for piece of suggestions from your side.

 Thanks in advance.

 Atul Prakash Singh

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

2011-04-11 Thread harsh chandel
ActivityManager am = (ActivityManager)
getSystemService(Service.ACTIVITY_SERVICE);
ListActivityManager.RunningAppProcessInfo processes;
processes = am.getRunningAppProcesses();
for(ActivityManager.RunningAppProcessInfo info: processes) {
Log.i(Process:, info.processName);
}


On Apr 11, 9:35 am, Julius Spencer jul...@msa.co.nz wrote:
 Hi,

 Just wondering, is it possible to look at an application's Activity stack?  
 I'd like to be able to look at the stack and see if the previous Activity on 
 the stack is the same as the one on the top.

 Regards,
 Julius.

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

2011-04-08 Thread harsh chandel
hi
you can use the saxparser or dom parser you can find example
on android developer.
to put the whole data in your application and then use it.


On Apr 6, 8:52 pm, Neutron_boy arctikz...@gmail.com wrote:
 I am fairly new to Android, but have some experience reading and
 understanding code, including Java.
 My question is: If I want to parse a URL such as a calender from a web
 page, how do I go about this?

 My thoughts: To pull the XML, do I use text?
 i.e.:

 try {
 URL text = new URL( http:// and here is where I am not sure what to
 have. The script below is the source for the calender in the XML of
 the website
 script type=text/javascript
 src=9278a6f3de5f9e54f2aeeb74ac1f0a7eembedcompiled__en.js/script)

 Do I then follow with XmlPullParserFactgory parserCreator =
 XmlPullParserFactory.newInstance();
 XmlPullParser parser = parserCreator.newPullParser();

 parser.setInput(text.openStream(), null);  Do I still use an open
 stream here?

 rest of code...

 Thanks in advance for the help and insoght

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

2011-04-06 Thread harsh chandel
String s=(Edittext) findviewbyid(R.id.edittext01).getstring.tosring();

On Apr 4, 12:36 pm, rishabh agrawal android.rish...@gmail.com wrote:
 How to get data from EditText  how to stored in Buffer i.e Integer..

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


[android-developers] Re: Getting rid of white line in Tab Widget

2011-04-06 Thread harsh chandel
there is set background property in tabwigdet

On Apr 4, 11:13 am, AlexBonel alexbo...@inbox.ru wrote:
 Didn't find any discussion of this problem in the group. How can I get
 rid of the white line under tab widgets in TabActivity? And if anybody
 knows I would be verry gratefull if you would also tell me how to
 change background color in TabWidget?

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

2011-04-06 Thread harsh chandel
use overlays in  map
in overlays you can use drawable images

On Apr 4, 1:28 pm, hEngi unnam...@gmail.com wrote:
 Hi,
 I'm new in android.
 I'd like to use a picture as a map. The easiest way is WebView. There
 is zoom and i can pull the image etc. But i have a problem. I cannot
 use my picture from res/drawable. I need to store it in the phone
 cause i need an url to it. Is there any way to load picture from res/
 drawable? If there isnt can i upload my picture to the phone when i
 install my api?
 Sry for my newbie question ^^
 Thanks,
 David

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


[android-developers] Re: read character unicode form sqlite

2011-04-06 Thread harsh chandel
use string  to store in database

On Apr 4, 2:59 pm, thavorac chun thavorac.c...@gmail.com wrote:
 Hi everyone,
 I'm working with sqlite right now and at this this moment i found a
 problem related to reading data from sqlite that i can not solve it.
 For example i have a french word  Hôtel  that have been insearted to
 database and after reading it to represent in device, it turn to  HÃÂ
 ´tel  that is totally wrong from what it was. Any ideas are
 appreciated.

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

2011-03-28 Thread harsh chandel
take a boolean variable and wirtie two if condition
on each condition set condtions

On Mar 27, 8:55 pm, Gabriel gab...@gmail.com wrote:
 How I create a button with two functions?
 For example, when I click it once it starts a sound, and if I click it
 again it stops the sounds.

 Or a Mute button, that when I click it mutes all the sounds and change
 the imagebutton for a mute off image and if I click it again the
 sound returns.

 I appreciate any help. 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: best way to save images files

2011-03-28 Thread harsh chandel
store them in drawable folder within res and and call the imageview
object.setbackgroundresource(r.drawable.name of the image)

On Mar 27, 9:05 pm, Igor Nesralla Ribeiro nesra...@gmail.com
wrote:
 Hi,

 I have this scenario :

 I have 50  images files of restaurants , that
 restaurants(name,city,address,image name) i saved into a database..My
 question is..how and where I saved this images files.and how I display this
 images files into a imageview

 Thanks in advance..

 Igor

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

2011-03-28 Thread harsh chandel
put the view in a xml file
scroll view
LinearLayout 
..

package name.name of the view class
.
...

linearlayout closed
scroll view
On Mar 25, 6:11 am, Byung-Ju ohbyun...@gmail.com wrote:
 Hi

 Thanks for reading this.

 1. Big Canvas (1000x1000) and display(screen) 320x480

 2. drawBitmap(bitmap1, 100, 100, null);
 3. drawBitmap(bitmap2, 500, 500, null);
 ... and do something bitmap or animation

 4. on touch drag (just like iphone werule display)

 5. how to scroll(move) screen ?

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


[android-developers] Re: adding custom view in main.xml

2011-03-22 Thread harsh chandel
set paint style
canvas.drawLine(100, 100, 200, 200, new Paint());
instead of new paint define pay style

On Mar 22, 11:27 am, Vishwesh R. vish...@gmail.com wrote:
 my code:-

 main.xml

 ?xml version=1.0 encoding=utf-8?

 com.MyPack.canvasexample.Myview
         android:id=@+id/view1
         android:layout_width=fill_parent
         xmlns:android=http://schemas.android.com/apk/res/android;
     android:layout_height=fill_parent
     android:clickable=true
     /

 Myview.java

 package com.MyPack.canvasexample;

 import android.content.Context;
 import android.graphics.Canvas;
 import android.graphics.Paint;
 import android.util.AttributeSet;
 import android.view.View;

 public class Myview extends View {

         public Myview(Context context) {
                 super(context);
                 // TODO Auto-generated constructor stub
                 this.invalidate();
         }

         public Myview(Context context, AttributeSet attrs, int defStyle) {
                 super(context, attrs, defStyle);
                 // TODO Auto-generated constructor stub
                 this.invalidate();
         }

         public Myview(Context context, AttributeSet attrs) {
                 super(context, attrs);
                 // TODO Auto-generated constructor stub
                 this.invalidate();
         }

         @Override
         protected void onDraw(Canvas canvas) {
                 // TODO Auto-generated method stub
                 super.onDraw(canvas);

                 canvas.drawLine(100, 100, 200, 200, new Paint());
         }

         @Override
         protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
 {
                 // TODO Auto-generated method stub
                 super.onMeasure(widthMeasureSpec, heightMeasureSpec);

         }

 }

 canvasexample.java

 package com.MyPack.canvasexample;

 import android.app.Activity;
 import android.os.Bundle;

 public class canvasexample extends Activity {
     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
  View v= findViewById(R.id.view1);
         if(v==null)
         Log.w(isnull, null);
         else
                 Log.w(isnull, not null);

     }

 }

 this is my code
 the log displays not null  for isnull tag that is view to b not
 null...
 do we need to write anything in manifest file.
 in graphical view of main.xml i can see a line drawn on the canvas but
 when i execute my program it shows nothing on canvas...
 ya we knw that we can draw a line without creating an extra view but
 we r trying to do it by creating a custom view...

 On Mar 18, 9:55 pm, Aisthesis marsh...@marshallfarrier.com wrote: did you 
 use the fully qualified name when you put it in main.xml?
  e.g.: com.google.myapp.MyView
  if that doesn't do it, it's hard to debug without any code--also there
  are ways to draw a line without creating an extra custom view

  On Mar 17, 8:05 am, Vishwesh R. vish...@gmail.com wrote:

   hi,
       im a beginner
      i have created a Myview wich extends View class. i have drawn a
   line on this view (that is Myview) in its onDraw() method.
   i included my view in its main.xml

   it shows no error but when i run this application, it loads the canvas
   but im unable to see the line wich i have drawn in Myview
   the coordinate of the line do lie on canvas but it not visible after
   the application is run..

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

2011-03-22 Thread harsh chandel
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
//Intent intent = new Intent(this,name of the class where you
want to go to);

startActivity(intent);

return true;
}
return super.onKeyDown(keyCode, event);
}

this code captures the event on back button click

On Mar 22, 8:49 am, Ranveer ranveer.s...@gmail.com wrote:
 Dear all,

 I want to reload the previous activity (history) on back button click.
 Right now When I am pressing back (Phone) it going to previous activity
 but showing from history.
 So every time I click back I want to reload the history page.

 regards

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

2011-03-22 Thread harsh chandel
yes it could be done

On Mar 21, 6:20 am, shubhandroid aadee...@gmail.com wrote:
 Can an app with the following features be made:
 -Phone1 transfers video feed from the major camera to the screen of
 phone2 via bluetooth
 -when user clicks on a button on the screen of phone2, it should
 press
 a number of the numeric pad during its call to phone1.

 With AI or normal coding

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

2011-03-22 Thread harsh chandel
yes all things you specified could be done
write overwrite back button code for 1
2 not clear
3 ok write overwrite onstop ,onpause,on resume

On Mar 22, 7:59 am, DulcetTone dulcett...@gmail.com wrote:
 My app responds to speech commands.

 I want the behavior to be that

 1.  if back is hit on my initial activity, it exits.
 2.  My app has a few sub-activities it may launch on user speech- or
 GUI input
 3.  if home is hit on ANY of my activities, I want all of them to
 finish.

 That's basically it.
 Why I want this is uninteresting... few users of the app would find
 the desired behavior anything other than the one they'd want.

 It's possible that I could get some of this to happen by use of the
 activity flags/modes (single-top, etc), but their documentation also
 reads like Sanskrit after 10 reads through.

 tone

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

2011-03-22 Thread harsh chandel
try ontouch method
get x and y coordinate   of the area clicked
and do as you want on the clicked event

On Mar 21, 4:39 pm, Rich E reakina...@gmail.com wrote:
 Hi,

 I'm trying to figure out how to capture keyboard input from a View, without
 subclassing EditText or something similar (the reason is that I have a
 complex bit of drawing to do, in which the text does not at all go in a
 horizontal direction, nor does it ever start at a consistent location.. so I
 figured that I would try to use a more direct route).

 I am able to show the keyboard from my View by first calling
 setFocusableInTouchMode(true) in my onCreateMethod, then calling:

    InputMethodManager imm =
 (InputMethodManager)getContext().getSystemService(Context.
 INPUT_METHOD_SERVICE);

 imm.showSoftInput(this, InputMethodManager.SHOW_FORCED);

 I call this from onTouchEvent(), in order to get the location of the touch
 within the view.

 This is where I get stuck.  When I implement onKeyDown or onKeyUp in the
 View, I only get a callback when the done or back button is hit on the
 keyboard.  I need to know which key of the soft keyboard is pressed, so that
 I can draw that character in my View.  I also tried to setOnKeyListener for
 a key listener, but it also only gets a callback when the done or back
 buttons are pressed on the soft keyboard.

 Any suggestions on how to proceed are gratefully appreciated.

 Best,

 Rich

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


[android-developers] Re: Android WebView with CSS modification of hr tag

2011-03-22 Thread harsh chandel
just open it in web view
webview.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
   LayoutParams.FILL_PARENT));
   webview.setBackgroundColor(0);
   webview.setInitialScale(110);
   form.addView(webview);
   webview.getSettings().setJavaScriptEnabled(true);

webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
   if (url.contains(www.twitter.com))
   url=url.replace(www.twitter.com, twitter.com);
   webview.loadUrl(url);

On Mar 22, 1:33 am, Dale dale.ham...@gmail.com wrote:
 I am working on an app which needs to display some dynamically queried
 HTML content, including CSS.
 WebView seems to be the best implementation for this type of work.

 I ran into an error when testing it out, and tracked it down to the
 following css tag:

 hr{width:100%!important}

 Android WebView seems to be incapable of displaying any html that
 includes this line.
 Some research shows that the hr width=100%/ attribute was depricated
 (link:http://www.w3schools.com/tags/att_hr_width.asp), but it works
 on all browsers.

 Below is some html, including this line.  It will render fine in any
 browser.

 htmlheadstyle type=\text/css\
 hr{width:100%!important}
 /style/headbody
 Some text
 /body/html

 And, in Android:

                 String exampleCSS = htmlheadstyle type=\text/css\ +
                                 hr{width:100%!important} +
                                 /style/headbody +
                                 Some text +
                                 /body/html;
                 WebView webView = (WebView) findViewById(R.id.web_html_about);
                 webView.loadData(exampleCSS, text/html, utf-8);

 The result is a Web page not available error in the webview.

 Is this a known issue due to deprecation?  Is it a bug with WebView?
 Is there any known work around for such issues?

 Cheers,
 Dale.

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

2011-03-22 Thread harsh chandel
Declare a method to add button in a function and add setonclicklistner
method on the button
in the onclicklstner method do whatever you want to do with the button

On Mar 15, 5:04 pm, DanH danhi...@ieee.org wrote:
 PS:  You can probably skip chapters 13 and 15.

 On Mar 15, 4:53 am, Ponraj \Android Developer\sanraj...@gmail.com wrote:
  Hi All.
  I am creating buttons dynamically. I am not able to access those buttons
  outside the methods.
  I am not familiar with java programming. I am new to android. Give solution
  for my problem.
  Should I declare the  Buttons globallyIf yes means, How should I?
  help me out
  --
  with thanks and regards,
  P.Ponraj

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

2011-03-22 Thread harsh chandel
you want to create your own media player
or use the media player supported by android

On Mar 23, 7:55 am, cibin cibin.p.oom...@gmail.com wrote:
 I am beginner in Android; I know only the basics...Please help me to
 create a Media Player 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: SQLiteDatabase or XML(saving)?

2011-03-22 Thread harsh chandel
database if security is invloved
if on xml on internet

On Mar 22, 2:46 pm, -Ernest kisskam...@gmail.com wrote:
 Hello guys,
 Thanks for making android a wonderful platform.
 Me and my mate are writing a project and its an android app.
 Yesterday i finish my third book about programing for
 the android platform Hello, Android.

 He comes my questions:
 What is the best option for saving a well formatted document(a
 document with images) on a device?
 I know this can be done by saving to a XML file or on a database, but
 which of these
 two is the most preferable.

 Hope the question was clear.

 Thanks in advance.
 -Ernest

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

2010-08-18 Thread harsh chandel
read google references to undertstand existing applications

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


[android-developers] Re: What will happen to existing connections when switch between 3g/wifi

2010-08-18 Thread harsh chandel
if the ip address is different  the connection will break

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


[android-developers] canvas problem

2010-07-07 Thread harsh chandel
i am making a application in which i need to draw a circle in the
middle of the screen with with variable radius everytime
with this i have to put few text boxes and buttons on the view

to draw the circle i use canvas

and to add buttons and text boxes i put linear layout

but i am not able to do this together ,either canvas is visible or
linearlayout is visible

my question is how to add buttons and textbox on top of canvas i need
to write on click event of these buttons and textboxes

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


[android-developers] programming issue on canvas

2010-07-07 Thread harsh chandel
hi i am trying to develop a code in which i try to add some buttons
and some textbox on canvas which contains bitmap image
but when i try to do so
i got code from google in which you can add linear layout with canvas
i modified it
 and  when i try to run it the linear layout which contain button
comes  but the canvas coordinate starts where the layout ends
for example i added three buttons in vertical orientation and then try
to draw a circle  the circle upper end is cut

the code is
package com.example;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.LinearLayout;

public class abc extends Activity {
/** Called when the activity is first created. */
@Override

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


LinearLayout lmain = new LinearLayout(this);
lmain.setBackgroundResource(R.drawable.shortrangechart);
lmain.setOrientation(LinearLayout.VERTICAL);



Button b = new Button(this);
Button b1 = new Button(this);
Button b2 = new Button(this);
lmain.addView(b2, new
LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
lmain.addView(b, new
LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
lmain.addView(b1, new
LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
addCanvasBitmap(lmain, R.drawable.shortrangechart, true);
setContentView(lmain);
lmain.setFocusable(true);

}

private void addCanvasBitmap(LinearLayout lmain, int resource,
boolean scale) {
Bitmap bitmap;
bitmap = loadAndPrintDpi(resource, scale);

ScaledBitmapView view = new ScaledBitmapView(this, bitmap);

view.setLayoutParams(new
LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
lmain.addView(view);
}
private Bitmap loadAndPrintDpi(int id, boolean scale) {
Bitmap bitmap;
if (scale) {
bitmap = BitmapFactory.decodeResource(getResources(), id);
} else {
BitmapFactory.Options opts = new BitmapFactory.Options();
opts.inScaled = false;
bitmap = BitmapFactory.decodeResource(getResources(), id,
opts);
}
return bitmap;
}
}

class ScaledBitmapView extends View {
private Bitmap mBitmap;

public ScaledBitmapView(Context context, Bitmap bitmap) {
super(context);
mBitmap = bitmap;
}

@Override
protected void onMeasure(int widthMeasureSpec, int
heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
final DisplayMetrics metrics =
getResources().getDisplayMetrics();
setMeasuredDimension(
mBitmap.getScaledWidth(metrics),
mBitmap.getScaledHeight(metrics));
}
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);

  //  canvas.drawBitmap(mBitmap, 0.0f, 0.0f, null);
Paint pOuterBullsEye = new Paint(Paint.ANTI_ALIAS_FLAG);
pOuterBullsEye.setStyle(Paint.Style.STROKE);
pOuterBullsEye.setColor(Color.GREEN);
canvas.drawCircle(150, 50,80,pOuterBullsEye );


}

}

please suggest what to do for this

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