[android-developers] Why doesn't android things support Mediastore?

2016-12-14 Thread Haris sulaiman
Suppose i'm building a contextual picture frame with android things, I need 
access to media store to shuffle images and videos. without those APIs its 
harder.
and BTW does android things  support chromium based webview?


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/66a8419b-3d15-4b6f-81aa-5bda740cf6e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Convert Bitmap to Mat for JNI interface

2012-11-24 Thread Haris
Hi all I need to pass my bitmap image to JNI for some image manipulation. 
For that first I convert bitmap to byte array then passed to JNI and then 
converted to Mat, but i am getting distorted image at the JNI side. My code 
look like below.

//Java part
 Bitmap mBitmap = Bitmap.createBitmap(previewWidtd, previewHeight,   
Bitmap.Config.ARGB_);

//

ByteArrayOutputStream src_stream = new ByteArrayOutputStream();
mBitmap.compress(Bitmap.CompressFormat.PNG, 100, src_stream);
byte[] src_array = src_stream.toByteArray();
int[] src_mRGBA=new int[240*320];
WatershedSegmentation(240,320,src_array,,src_mRGBA); // JNI call


//JNI part
 JNIEXPORT jintArray JNICALL 
Java_com_measure_sizemesurment2_MyView_WatershedSegmentation(
JNIEnv* env, jobject thiz, jint width, jint height, 
jbyteArray s_yuv,jintArray s_bgra) {

jbyte* _s_yuv = env-GetByteArrayElements(s_yuv, 0);
jint* _s_bgra = env-GetIntArrayElements(s_bgra, 0);

Mat sorcemyuv(height + height / 2, width, CV_8UC1, (unsigned char 
*) _s_yuv);
Mat source(height, width, CV_8UC4, (unsigned char *) _s_bgra);

cvtColor(sorcemyuv, source, CV_YUV420sp2BGR, 4);
imwrite( /sdcard/sorce.jpg, source );

   env-ReleaseIntArrayElements(s_bgra, _s_bgra, 0);
   env-ReleaseByteArrayElements(s_yuv, _s_yuv, 0);
 }

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: Sending group SMS android

2012-11-20 Thread Haris
Thanks for replay.

On Saturday, 3 November 2012 12:50:01 UTC+5:30, Haris wrote:

 Hi

I need to crete an application like group messaging. For that I am 
 using SmsManager class. 

 MY code look like


 static ListString phone_num = new ArrayListString();static ListString 
 SMS = new ArrayListString();

@Overridepublic void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);
 readExcelFile(this, /sdcard/Excel.xls);
 View readExcelButton = findViewById(R.id.buttonSend);
 readExcelButton.setOnClickListener(this);
 }


   public void onClick(View v) {
 switch (v.getId()) {
 case R.id.buttonSend:
   for(int i=0;iphone_num.size();i++)
 {
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phone_num.get(i),SMS.get(i), null, 
 null);
 }

   Toast.makeText(getBaseContext(), 
 Sendingfinished,Toast.LENGTH_SHORT).show();  


 break;
default: break;
 }
 }


 My question is, is it a right method for sending group sms. Or should I 
 create pendingIntent with broadcast receiver to monitor the sending process 
 and wait inside the for loop until each message send finished to send next. 

 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] Sending group SMS android

2012-11-03 Thread Haris


Hi

   I need to crete an application like group messaging. For that I am using 
SmsManager class. 

MY code look like


static ListString phone_num = new ArrayListString();static ListString SMS 
= new ArrayListString();

   @Overridepublic void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
readExcelFile(this, /sdcard/Excel.xls);
View readExcelButton = findViewById(R.id.buttonSend);
readExcelButton.setOnClickListener(this);
}


  public void onClick(View v) {
switch (v.getId()) {
case R.id.buttonSend:
  for(int i=0;iphone_num.size();i++)
{
   SmsManager smsManager = SmsManager.getDefault();
   smsManager.sendTextMessage(phone_num.get(i),SMS.get(i), null, 
null);
}

  Toast.makeText(getBaseContext(), 
Sendingfinished,Toast.LENGTH_SHORT).show();  


break;
   default: break;
}
}


My question is, is it a right method for sending group sms. Or should I 
create pendingIntent with broadcast receiver to monitor the sending process 
and wait inside the for loop until each message send finished to send next. 

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: Android camera orientation problem

2012-10-23 Thread Haris
Hi  thanks for your reply I didn't check that yet. I will try that.. 

On Tuesday, 23 October 2012 17:38:06 UTC+5:30, Flame-Tree wrote:

 Have you tried you application on any other phone. As you are accessing 
 setparameter/getparameter; which is more specific with your hardware 
 support. 
 Have you tried any android applicationCamera from Google play which 
 behaves the way you would like. Confirm whether Phone provides the 
 functionality or not 


  

 On Monday, 22 October 2012 11:53:46 UTC+5:30, Haris wrote:

 Hi all For my application I am using android native camera and previewing 
 the image using surface view. But everything is working except the camera 
 orientation. When I open the camera by setting  
 screenOrientation=landscape on manifest file I am getting the preview 
 without any problem in landscape mode. But I need to take image in portrait 
 mode, for this I changed my manifest like  
 android:screenOrientation=portrait  and change my code like 
 mCamera.setDisplayOrientation(90), params.set(orientation, 
 landscape),params.set(rotation, 90), but still I am getting 90 degree 
 rotated image. I searched a lot but nothing solved my problem...

 And my code is

   public void setupCamera(int width, int height) {
 Log.i(TAG, setupCamera);
 synchronized (this) {
 if (mCamera != null) {
 Camera.Parameters params = mCamera.getParameters();
 ListCamera.Size sizes = 
 params.getSupportedPreviewSizes();
 ListCamera.Size 
 imgsize=params.getSupportedPictureSizes();
 mFrameWidth = width;
 mFrameHeight = height;

// mCamera.setDisplayOrientation(90);
 params.set(orientation, landscape);
  params.set(rotation, 90);
 // selecting optimal camera preview size
 {
 int  minDiff = Integer.MAX_VALUE;
 for (Camera.Size size : sizes) {
 if (Math.abs(size.height - height)  minDiff) {
 mFrameWidth = size.width;
 mFrameHeight = size.height;
 minDiff = Math.abs(size.height - height);
 }
 }
 }

 params.setPreviewSize(getFrameWidth(), getFrameHeight());
 

 

 ListString FocusModes = params.getSupportedFocusModes();
 if 
 (FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO))
 {
 
 params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
 }
 
 mCamera.setParameters(params);
 
  

 mCamera.startPreview();
 }
 }
 }


 I am using micromax A52 mmodel with android 2.3




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

Re: [android-developers] Re: Android camera orientation problem

2012-10-23 Thread Haris
Hi thanks all for your replays.. 

Yesterday I have checked some application from google play like 
pudding camera etc. and it's working perfectly. Even if I access the 
default camera from my application I am getting normal preview but while 
saving it is rotated. The reason why I need to use in portrait mode is that 
after capture I have to do some image processing algorithms on the image 
using opencv, and  on the JNI part it seems that  height of the image 
became width and width became height and all these because of the rotation. 
To avoid that confusion, -I know that not a big issue I just need to rotate 
the image 90 degree  backward-  I thought it is better to modify the camera 
orientation . Can any one give me a working source code for changing the 
camera orientation, may be it's my coding problem

Thanks
Haris

On Wednesday, 24 October 2012 10:20:31 UTC+5:30, Adam Ratana wrote:

 Haris, take a look a this:


 http://developer.android.com/reference/android/hardware/Camera.html#setDisplayOrientation(int)

 This is for API 8 (2.2+) devices.  I've found that there's no reliable way 
 to guarantee this to work on 2.1 devices by setting the camera parameters 
 the way you are now, some just won't do it.

 I've just spent quite a bit of my spare time working on implementing a 
 portrait mode activity option for the camera preview - to answer Spooky's 
 question, the main reason one might do this is because it goes well with 
 the UI/UX of the application (specifically the other activities which share 
 a common UI), and the application for the camera activity is augmented 
 reality, and for most devices that I've had experience with, the sensors 
 seem to be most accurate when the phone is held in portrait - though this 
 can clearly vary.  It also was desired to have a working portrait mode 
 version of the camera activity, instead of forcing the user to then change 
 the way they were holding the device.  Instagram is one massively popular 
 application which does this as well (or at least, appears to do so), and I 
 think it works well with their UI.

 You can of course, take advantage of the above method to simply rotate the 
 preview depending on the current orientation of the device - either 
 portrait or landscape, and indeed have different UIs for either scenario if 
 you wish.  Of course then choosing the optimal preview size for your 
 orientation, taking into account status bars or full screen, etc, can then 
 be tricky and yield different results for each.  The default camera app 
 seems to rotate it's UI elements which is a pretty neat solution.  Rotating 
 any preview frames or shots is the least of the worries here, that's 
 relatively simple to do.

 I plan on cleaning up and open sourcing a proof of concept project I built 
 which does a bunch of things, including dealing with having a camera 
 orientation the same as the device orientation, and rotating it when the 
 device rotates, etc, since this seems a really painful thing.  I'll post 
 back here when it's up, probably within a month.


 On Tuesday, October 23, 2012 12:28:46 PM UTC-4, Spooky wrote:

 I'm assuming that you have some specific reason for wanting to use 
 portrait, where normal camera orientation is landscape?  In every 
 camera I've seen, used, or read about, the normal orientation is 
 landscape.  If you want portrait, you have to rotate the camera. 
 I recall reading somewhere in the developer's guide docs on the 
 camera that (as with 35mm and DSLR cameras) the Android camera's 
 normal orientation is landscape.  You CAN change that in java, 
 if you want to, though (but why would you?  if the user wants 
 to rotate the camera for a portrait-oriented shot, they'll 
 just rotate the device) 

 Later, 
--jim 

 -- 
 THE SCORE:  ME:  2  CANCER:  0 
 73 DE N5IAL (/4) //  North American Hunting Club Member #70781171 
 ICBM/Hurr.: 30.44406N 86.59909W // Running Mac OS X Lion  

Now what *you* need is a proper pint of porter poured in a proper 
pewter porter pot.. --Peter Dalgaard in alt.sysadmin.recovery 




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

Re: [android-developers] Re: Android camera orientation problem

2012-10-23 Thread Haris
Hi thanks all for your replays.. 

Yesterday I have checked some application from google play like 
pudding camera etc. and it's working perfectly. Even if I access the 
default camera from my application I am getting normal preview but while 
saving it is rotated. The reason why I need to use in portrait mode is that 
after capture I have to do some image processing algorithms on the image 
using opencv, and  on the JNI part it seems that  height of the image 
became width and width became height and all these because of the rotation. 
To avoid that confusion, -I know that not a big issue I just need to rotate 
the image 90 degree  backward-  I thought it is better to modify the camera 
orientation . Can any one give me a working source code for changing the 
camera orientation, may be it's my coding problem

Thanks
Haris

On Wednesday, 24 October 2012 10:20:31 UTC+5:30, Adam Ratana wrote:

 Haris, take a look a this:


 http://developer.android.com/reference/android/hardware/Camera.html#setDisplayOrientation(int)

 This is for API 8 (2.2+) devices.  I've found that there's no reliable way 
 to guarantee this to work on 2.1 devices by setting the camera parameters 
 the way you are now, some just won't do it.

 I've just spent quite a bit of my spare time working on implementing a 
 portrait mode activity option for the camera preview - to answer Spooky's 
 question, the main reason one might do this is because it goes well with 
 the UI/UX of the application (specifically the other activities which share 
 a common UI), and the application for the camera activity is augmented 
 reality, and for most devices that I've had experience with, the sensors 
 seem to be most accurate when the phone is held in portrait - though this 
 can clearly vary.  It also was desired to have a working portrait mode 
 version of the camera activity, instead of forcing the user to then change 
 the way they were holding the device.  Instagram is one massively popular 
 application which does this as well (or at least, appears to do so), and I 
 think it works well with their UI.

 You can of course, take advantage of the above method to simply rotate the 
 preview depending on the current orientation of the device - either 
 portrait or landscape, and indeed have different UIs for either scenario if 
 you wish.  Of course then choosing the optimal preview size for your 
 orientation, taking into account status bars or full screen, etc, can then 
 be tricky and yield different results for each.  The default camera app 
 seems to rotate it's UI elements which is a pretty neat solution.  Rotating 
 any preview frames or shots is the least of the worries here, that's 
 relatively simple to do.

 I plan on cleaning up and open sourcing a proof of concept project I built 
 which does a bunch of things, including dealing with having a camera 
 orientation the same as the device orientation, and rotating it when the 
 device rotates, etc, since this seems a really painful thing.  I'll post 
 back here when it's up, probably within a month.


 On Tuesday, October 23, 2012 12:28:46 PM UTC-4, Spooky wrote:

 I'm assuming that you have some specific reason for wanting to use 
 portrait, where normal camera orientation is landscape?  In every 
 camera I've seen, used, or read about, the normal orientation is 
 landscape.  If you want portrait, you have to rotate the camera. 
 I recall reading somewhere in the developer's guide docs on the 
 camera that (as with 35mm and DSLR cameras) the Android camera's 
 normal orientation is landscape.  You CAN change that in java, 
 if you want to, though (but why would you?  if the user wants 
 to rotate the camera for a portrait-oriented shot, they'll 
 just rotate the device) 

 Later, 
--jim 

 -- 
 THE SCORE:  ME:  2  CANCER:  0 
 73 DE N5IAL (/4) //  North American Hunting Club Member #70781171 
 ICBM/Hurr.: 30.44406N 86.59909W // Running Mac OS X Lion  

Now what *you* need is a proper pint of porter poured in a proper 
pewter porter pot.. --Peter Dalgaard in alt.sysadmin.recovery 




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

[android-developers] Android camera orientation problem

2012-10-22 Thread Haris
Hi all For my application I am using android native camera and previewing 
the image using surface view. But everything is working except the camera 
orientation. When I open the camera by setting  
screenOrientation=landscape on manifest file I am getting the preview 
without any problem in landscape mode. But I need to take image in portrait 
mode, for this I changed my manifest like  
android:screenOrientation=portrait  and change my code like 
mCamera.setDisplayOrientation(90), params.set(orientation, 
landscape),params.set(rotation, 90), but still I am getting 90 degree 
rotated image. I searched a lot but nothing solved my problem...

And my code is

  public void setupCamera(int width, int height) {
Log.i(TAG, setupCamera);
synchronized (this) {
if (mCamera != null) {
Camera.Parameters params = mCamera.getParameters();
ListCamera.Size sizes = params.getSupportedPreviewSizes();
ListCamera.Size imgsize=params.getSupportedPictureSizes();
mFrameWidth = width;
mFrameHeight = height;

   // mCamera.setDisplayOrientation(90);
params.set(orientation, landscape);
 params.set(rotation, 90);
// selecting optimal camera preview size
{
int  minDiff = Integer.MAX_VALUE;
for (Camera.Size size : sizes) {
if (Math.abs(size.height - height)  minDiff) {
mFrameWidth = size.width;
mFrameHeight = size.height;
minDiff = Math.abs(size.height - height);
}
}
}

params.setPreviewSize(getFrameWidth(), getFrameHeight());




ListString FocusModes = params.getSupportedFocusModes();
if 
(FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO))
{

params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
}

mCamera.setParameters(params);

 

mCamera.startPreview();
}
}
}


I am using micromax A52 mmodel with android 2.3
   

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

2012-10-22 Thread Haris
I don't know why it's not worked with me. If I set orientation as portrait 
in manifest file I am getting 90 degree rotated image in my preview. But in 
the case of landscape orientation I am getting normal image in my preview 
while my phone orientation is portrait I know it is 90 degree rotated from 
landscape ,  and while saving or drawing  to a canvas I am getting 90 
degree rotated image. For this issue I just rotated my image 90 degree 
backward. I thought it is better to set the orientation correctly rather 
than rotating the image after capture.  

On Monday, 22 October 2012 20:58:26 UTC+5:30, spartygw wrote:

 Camera.setDisplayOrientation works for me, I could never seem to get any 
 rotation stuff to work that I tried to set using the Camera.Parameters.

 -gw

 On Monday, October 22, 2012 2:23:46 AM UTC-4, Haris wrote:

 Hi all For my application I am using android native camera and previewing 
 the image using surface view. But everything is working except the camera 
 orientation. When I open the camera by setting  
 screenOrientation=landscape on manifest file I am getting the preview 
 without any problem in landscape mode. But I need to take image in portrait 
 mode, for this I changed my manifest like  
 android:screenOrientation=portrait  and change my code like 
 mCamera.setDisplayOrientation(90), params.set(orientation, 
 landscape),params.set(rotation, 90), but still I am getting 90 degree 
 rotated image. I searched a lot but nothing solved my problem...

 And my code is

   public void setupCamera(int width, int height) {
 Log.i(TAG, setupCamera);
 synchronized (this) {
 if (mCamera != null) {
 Camera.Parameters params = mCamera.getParameters();
 ListCamera.Size sizes = 
 params.getSupportedPreviewSizes();
 ListCamera.Size 
 imgsize=params.getSupportedPictureSizes();
 mFrameWidth = width;
 mFrameHeight = height;

// mCamera.setDisplayOrientation(90);
 params.set(orientation, landscape);
  params.set(rotation, 90);
 // selecting optimal camera preview size
 {
 int  minDiff = Integer.MAX_VALUE;
 for (Camera.Size size : sizes) {
 if (Math.abs(size.height - height)  minDiff) {
 mFrameWidth = size.width;
 mFrameHeight = size.height;
 minDiff = Math.abs(size.height - height);
 }
 }
 }

 params.setPreviewSize(getFrameWidth(), getFrameHeight());
 

 

 ListString FocusModes = params.getSupportedFocusModes();
 if 
 (FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO))
 {
 
 params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
 }
 
 mCamera.setParameters(params);
 
  

 mCamera.startPreview();
 }
 }
 }


 I am using micromax A52 mmodel with android 2.3




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

2012-10-16 Thread Haris
I think  this 
linkhttp://www.mysamplecode.com/2011/10/android-read-write-excel-file-using.htmlmay
 help you

On Wednesday, 10 October 2012 17:11:14 UTC+5:30, Nachi.R nach wrote:

 hai 

 i'm new to androidd platform, i want to create excel in android 
 project..,i don't know to create 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] Android ndk debugger

2012-10-13 Thread Haris

Can anyone tell which is the best tool to debug  native code (C/C++) in 
eclipse indigo. I have already tried  DS-5 CE Debug - ARM  
http://www.arm.com/products/tools/software-tools/ds-5/community-edition/ds-5-community-edition-debug.php
but I am not able to connect to my device. In debug configuration it 
showing  Configuration for connection type 'gdbserver' is not valid. My 
platform is  ubuntu. 

Thanks in advance.
http://www.arm.com/products/tools/software-tools/ds-5/community-edition/ds-5-community-edition-debug.php

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

[android-developers] Setting onclocklistener on view class

2012-10-01 Thread Haris

Hai all...

I created an application like drawing on canvas by taking image from 
camera.. I created some custom button using frame layout inside  my view 
class.. But I am not able to create an onclicklistener inside view class

Here is my sub activity to draw on canvas


public class MesureSizeActivity extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 setContentView(R.layout.button);
}
}


and my view class is


public class MyView extends View {



private Bitmap mBitmap;
private Canvas mCanvas;
private Path mPath;
private Paint mBitmapPaint;
private Paint mPaint;
boolean calibrate=true;
int calibrate_x;
int calibrate_y;
int calibrate_radius;

//Event listener controller

boolean listener_calibrate= true;

public MyView(Context c) {
super(c);
mBitmap = MainActivity.getBitmap();
mPath = new Path();
mBitmapPaint = new Paint(Paint.DITHER_FLAG);

mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setDither(true);
mPaint.setColor(0xFF11);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.ROUND);
// mPaint.setStrokeCap(Paint.Cap.ROUND);
mPaint.setStrokeWidth(2);
}

public MyView(Context context, AttributeSet attrs) {
super(context, attrs);
mBitmap = MainActivity.getBitmap();
mPath = new Path();
mBitmapPaint = new Paint(Paint.DITHER_FLAG);

mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setDither(true);
mPaint.setColor(0xFF11);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.ROUND);
// mPaint.setStrokeCap(Paint.Cap.ROUND);
mPaint.setStrokeWidth(2);
}

public MyView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}


@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mBitmap = Bitmap.createScaledBitmap(mBitmap, w, h, true);
mCanvas = new Canvas(mBitmap);
calibrate_x = w /2;
calibrate_y = h/2;
calibrate_radius = 50;

}

@Override
protected void onDraw(Canvas canvas) {
canvas.drawColor(0xFFAA);

canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);
  
  
canvas.drawCircle(calibrate_x,calibrate_y,calibrate_radius,mPaint);
canvas.drawPath(mPath, mPaint);

}

private float mX, mY;
private static final float TOUCH_TOLERANCE = 4;

private void touch_start(float x, float y) {
mPath.reset();
mPath.moveTo(x, y);
mX = x;
mY = y;
}

private void touch_move(float x, float y) {
float dx = Math.abs(x - mX);
float dy = Math.abs(y - mY);
if (dx = TOUCH_TOLERANCE || dy = TOUCH_TOLERANCE) {
// mPath.quadTo(mX, mY, (x + mX)/2, (y + mY)/2);
mX = x;
mY = y;
}
}

private void touch_up() {
mPath.lineTo(mX, mY);
// commit the path to our offscreen
mCanvas.drawPath(mPath, mPaint);
// kill this so we don't double draw
mPath.reset();
}

@Override
public boolean onTouchEvent(MotionEvent event) {
float x = event.getX();
float y = event.getY();

switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
touch_start(x, y);
invalidate();
break;
case MotionEvent.ACTION_MOVE:
touch_move(x, y);
invalidate();
break;
case MotionEvent.ACTION_UP:
touch_up();
   
invalidate();
break;
}
return true;
}

public void onClick(View v) {
 
 if(v.getId() == R.id.up)
 { 
//Do some thing

 
 }

 if(v.getId() == R.id.down)
 { 
//Do some thing

 
 }
 
}

}

And my xml look like

?xml version=1.0 encoding=utf-8?
FrameLayout
android:visibility=visible
android:layout_width=fill_parent
android:layout_height=fill_parent 
xmlns:android=http://schemas.android.com/apk/res/android;

com.example.sizemesurment_1.MyView
android:id=@+id/DrawViewId
android:layout_width=fill_parent
android:layout_height=fill_parent
/com.example.sizemesurment_1.MyView 

 RelativeLayout
 android:layout_width=fill_parent
android:layout_height=fill_parent
android:orientation=horizontal
android:gravity=bottom

   

ImageButton
android:id=@+id/up
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_alignParentBottom=true
android:layout_marginLeft=80dp 
 

Re: [android-developers] Setting onclocklistener on view class

2012-10-01 Thread Haris
I thought it is easier to understand  problem if I post my code like 
thisSorry for that ... Any way I solved my problem by creating a method 

public void ButtonOnClick(View view) 

in my MesureSizeActivity class.And I got the solution from 
http://stackoverflow.com/questions/12671397/onclicklistener-on-view-classfor 
the same question..

Thanks TerKing for your reply...

On Tuesday, 2 October 2012 05:05:48 UTC+5:30, TreKing wrote:

 On Mon, Oct 1, 2012 at 3:14 AM, Haris hari...@gmail.com javascript:wrote:

 While I am pressing the button I got the error like

 Could not find a method ButtonOnClick(View) in the activity class 
 com.example.sizemesurment_1.MesureSizeActivity for onClick handler on view 
 class android.widget.Button with id 'up'


 Google this error, minus all the you-app-specific stuff. So something like 
 this:
 Could not find a method in the activity for onClick handler on view 
 class with id

 Also, please post less code - only as much as you need to explain the 
 problem. Too much and people's eyes will glaze over and they will move on 
 to something else.


 -
 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] Adding button on custom view

2012-09-29 Thread Haris

Hai all...

I am creating a custom view without using xml... using java code...My 
question is how could I add new button to my  view class using java 
codeMy code is just like below.


public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
   
   MyView view1 = new MyView(this); 
  setContentView(view1);


}

public class MyView extends View {

public MyView(Context c) {
super(c);
mBitmap = MainActivity.getBitmap();

}

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mBitmap = Bitmap.createScaledBitmap(mBitmap, w, h, true);
mCanvas = new Canvas(mBitmap);

}


@Override
protected void onDraw(Canvas canvas) {
canvas.drawColor(0xFFAA);
   
canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);
canvas.drawPath(mPath, mPaint);
}

}

It is not my full code...I need to add some custom button and some menu. I 
have to draw to the canvas using all these...Is it possible to add such a 
button and menu in view using java

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: Oject Size Measurment

2012-09-23 Thread Haris
Thanks.

On Saturday, 22 September 2012 10:29:01 UTC+5:30, Haris wrote:


  Hai all...

  I need to develop an application like measure the size of an object with 
 a reference object using camera.That is I need to measure the size 
 of an unknown object by putting a known size object at the same 
 distanceI think I need to use some image processing technique using 
 opencv.. My question is does android have any utility other the opencv 
 for doing this...? 

 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] Android Battry Usage

2012-09-23 Thread Haris

Hai all.

I have create some application for my android phone and I successfully 
installed it and ran itBut when I look at my battery usage it showing 
my application consumes  22 % of battery. I thought it was running in back 
ground but it's not...Why this happening.. is it my coding problem.

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] Oject Size Measurment

2012-09-21 Thread Haris

 Hai all...

 I need to develop an application like measure the size of an object with a 
reference object using camera.That is I need to measure the size of 
an unknown object by putting a known size object at the same distanceI 
think I need to use some image processing technique using opencv.. My 
question is does android have any utility other the opencv for doing 
this...? 

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: Rotate image around it's centre problem with matrix rotation

2012-09-17 Thread Haris
Yes, I am using arrow as my image
Here I changed my image circular to show the extend of variation...I am 
getting the same result for arrow.Anyway I will try as you 
said..

Thanks

On Monday, 17 September 2012 19:42:28 UTC+5:30, bob wrote:

 I thought you were using an image of an arrow?

 I would put a breakpoint here:
 screenW = w;

 Make sure screenW and screenH are getting set correctly.


 On Saturday, September 15, 2012 12:42:36 AM UTC-5, Haris wrote:




 Hai bob thanks for your reply...

 I made the change as you said...  *

  Y = (int) (screenH /2) - (arrowH / 2) ;*

 But still the same results.

 And here is some  screen shot of my results at central position left and 
 right

  
 Centrehttps://lh3.googleusercontent.com/-gmk0bpPFRaA/UFQTgNViVXI/AJk/L8aKeWbyfyY/s1600/centre.jpg
  
 Lefthttps://lh5.googleusercontent.com/--1s1WMp6JWs/UFQUKYdzHDI/AJs/2p77As5VGY0/s1600/left.jpg
  
 Righthttps://lh6.googleusercontent.com/-Gopc01ZOM94/UFQUoJ0d76I/AJ0/OxShY4rktZ4/s1600/right.jpg

 Thanks..



 On Monday, 10 September 2012 18:48:32 UTC+5:30, Haris wrote:

 Hai all

  I am trying an application like rotating image with motion sensorMy 
 problem is that the image does not rotate about centre properlyAnd my 
 angle range is 0 to 90 and 0 to -90..
 And below is my code.

   public void onDraw(Canvas canvas) {
 super.onDraw(canvas);
  Bitmap arrow = 
 BitmapFactory.decodeResource(getResources(),R.drawable.arrow);
  int arrowW = arrow.getWidth();
  int arrowH = arrow.getHeight();
  float scaleWidth = 1;
  float scaleHeight = 1;
  int centrex = arrowW/2;
  int centrey = arrowH/2;
  int X=108;
  int Y=100;
  int angle=0;

Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);

matrix.postRotate(angle, X+centrex , Y+centrey );
Bitmap resizedBitmap = Bitmap.createBitmap(arrow, 0, 0, 
 arrow.getWidth(), arrow.getHeight(), matrix, true);
   canvas.save();
   canvas.drawBitmap(resizedBitmap, X, Y, null);
   invalidate();
  }

 I am getting the angle values from onCreate method.Using orientation 
 sensor(roll values)..
 But When I rotate the screen my  image is  rotating but not exactly 
 around the image centre.

 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: Rotate image around it's centre problem with matrix rotation

2012-09-14 Thread Haris





Hai bob thanks for your reply...

I made the change as you said...  *

 Y = (int) (screenH /2) - (arrowH / 2) ;*

But still the same results.

And here is some  screen shot of my results at central position left and 
right

 
Centrehttps://lh3.googleusercontent.com/-gmk0bpPFRaA/UFQTgNViVXI/AJk/L8aKeWbyfyY/s1600/centre.jpg
 
Lefthttps://lh5.googleusercontent.com/--1s1WMp6JWs/UFQUKYdzHDI/AJs/2p77As5VGY0/s1600/left.jpg
 
Righthttps://lh6.googleusercontent.com/-Gopc01ZOM94/UFQUoJ0d76I/AJ0/OxShY4rktZ4/s1600/right.jpg

Thanks..



On Monday, 10 September 2012 18:48:32 UTC+5:30, Haris wrote:

 Hai all

  I am trying an application like rotating image with motion sensorMy 
 problem is that the image does not rotate about centre properlyAnd my 
 angle range is 0 to 90 and 0 to -90..
 And below is my code.

   public void onDraw(Canvas canvas) {
 super.onDraw(canvas);
  Bitmap arrow = 
 BitmapFactory.decodeResource(getResources(),R.drawable.arrow);
  int arrowW = arrow.getWidth();
  int arrowH = arrow.getHeight();
  float scaleWidth = 1;
  float scaleHeight = 1;
  int centrex = arrowW/2;
  int centrey = arrowH/2;
  int X=108;
  int Y=100;
  int angle=0;

Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);

matrix.postRotate(angle, X+centrex , Y+centrey );
Bitmap resizedBitmap = Bitmap.createBitmap(arrow, 0, 0, 
 arrow.getWidth(), arrow.getHeight(), matrix, true);
   canvas.save();
   canvas.drawBitmap(resizedBitmap, X, Y, null);
   invalidate();
  }

 I am getting the angle values from onCreate method.Using orientation 
 sensor(roll values)..
 But When I rotate the screen my  image is  rotating but not exactly around 
 the image centre.

 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: Rotate image around it's centre problem with matrix rotation

2012-09-13 Thread Haris
Hai bob, have you run my code..?

On Monday, 10 September 2012 18:48:32 UTC+5:30, Haris wrote:

 Hai all

  I am trying an application like rotating image with motion sensorMy 
 problem is that the image does not rotate about centre properlyAnd my 
 angle range is 0 to 90 and 0 to -90..
 And below is my code.

   public void onDraw(Canvas canvas) {
 super.onDraw(canvas);
  Bitmap arrow = 
 BitmapFactory.decodeResource(getResources(),R.drawable.arrow);
  int arrowW = arrow.getWidth();
  int arrowH = arrow.getHeight();
  float scaleWidth = 1;
  float scaleHeight = 1;
  int centrex = arrowW/2;
  int centrey = arrowH/2;
  int X=108;
  int Y=100;
  int angle=0;

Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);

matrix.postRotate(angle, X+centrex , Y+centrey );
Bitmap resizedBitmap = Bitmap.createBitmap(arrow, 0, 0, 
 arrow.getWidth(), arrow.getHeight(), matrix, true);
   canvas.save();
   canvas.drawBitmap(resizedBitmap, X, Y, null);
   invalidate();
  }

 I am getting the angle values from onCreate method.Using orientation 
 sensor(roll values)..
 But When I rotate the screen my  image is  rotating but not exactly around 
 the image centre.

 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: Rotate image around it's centre problem with matrix rotation

2012-09-12 Thread Haris
Hai bob thanks for reply.

I made the above change in my code but still the same resultAnd my 
image get distorted it's edges while rotation..

On Wednesday, 12 September 2012 20:04:12 UTC+5:30, bob wrote:

 Well, for one thing, this is not right:

 canvas.rotate(angle, X + getWidth()  1, Y + getHeight()  1);

 You should be calling getWidth and getHeight on the bitmap.

 Something like this:

 canvas.rotate(angle, X + resizedBitmap.getWidth()/2, Y + 
 resizedBitmap.getHeight()/2);



 On Tuesday, September 11, 2012 12:54:59 AM UTC-5, HPP wrote:

 Hai thanks for the replys

 I changed my code like

 matrix.postScale(scaleWidth, scaleHeight);
 matrix.postRotate(angle, X+centrex , Y+centrey );
 canvas.setMatrix(matrix);

 Bitmap resizedBitmap = Bitmap.createBitmap(arrow, 0, 0, 
 arrow.getWidth(), arrow.getHeight(), matrix, true);
 canvas.save(Canvas.MATRIX_SAVE_FLAG);
 canvas.rotate(angle, *X + *getWidth()  1, *Y +* getHeight()  
 1);
 super.dispatchDraw(canvas);
 canvas.drawBitmap(resizedBitmap, X, Y, null); //Draw the arrow on 
 the rotated canvas.
 canvas.restore();

 But still it's not rotating about the centre...



 On Tuesday, 11 September 2012 01:49:30 UTC+5:30, bob wrote:

 canvas.save(Canvas.MATRIX_SAVE_FLAG);
 canvas.rotate(angle, *X + *getWidth()  1, *Y +* getHeight()  1);
 super.dispatchDraw(canvas);
 canvas.restore();

 On Monday, September 10, 2012 2:22:15 PM UTC-5, lbendlin wrote:

 canvas.save(Canvas.MATRIX_SAVE_FLAG);
 canvas.rotate(angle, getWidth()  1, getHeight()  1);
 super.dispatchDraw(canvas);
 canvas.restore();

 On Monday, September 10, 2012 9:18:32 AM UTC-4, Haris wrote:

 Hai all

  I am trying an application like rotating image with motion 
 sensorMy problem is that the image does not rotate about centre 
 properlyAnd my angle range is 0 to 90 and 0 to -90..
 And below is my code.

   public void onDraw(Canvas canvas) {
 super.onDraw(canvas);
  Bitmap arrow = 
 BitmapFactory.decodeResource(getResources(),R.drawable.arrow);
  int arrowW = arrow.getWidth();
  int arrowH = arrow.getHeight();
  float scaleWidth = 1;
  float scaleHeight = 1;
  int centrex = arrowW/2;
  int centrey = arrowH/2;
  int X=108;
  int Y=100;
  int angle=0;

Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);

matrix.postRotate(angle, X+centrex , Y+centrey );
Bitmap resizedBitmap = Bitmap.createBitmap(arrow, 0, 0, 
 arrow.getWidth(), arrow.getHeight(), matrix, true);
   canvas.save();
   canvas.drawBitmap(resizedBitmap, X, Y, null);
   invalidate();
  }

 I am getting the angle values from onCreate method.Using 
 orientation sensor(roll values)..
 But When I rotate the screen my  image is  rotating but not exactly 
 around the image centre.

 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: Rotate image around it's centre problem with matrix rotation

2012-09-12 Thread Haris
);
   

canvas.save(Canvas.MATRIX_SAVE_FLAG);
canvas.rotate(angle, X + resizedBitmap.getWidth()/2, Y + 
resizedBitmap.getHeight()/2);
super.dispatchDraw(canvas);  
canvas.drawBitmap(resizedBitmap, X, Y, null); //Draw the arrow on 
the rotated canvas.
canvas.restore();

invalidate();
}
}


And I am using an arrow image as my rotating image.

On Thursday, 13 September 2012 10:44:35 UTC+5:30, Haris wrote:

 Hai bob thanks for reply.

 I made the above change in my code but still the same resultAnd my 
 image get distorted it's edges while rotation..

 On Wednesday, 12 September 2012 20:04:12 UTC+5:30, bob wrote:

 Well, for one thing, this is not right:

 canvas.rotate(angle, X + getWidth()  1, Y + getHeight()  1);

 You should be calling getWidth and getHeight on the bitmap.

 Something like this:

 canvas.rotate(angle, X + resizedBitmap.getWidth()/2, Y + 
 resizedBitmap.getHeight()/2);



 On Tuesday, September 11, 2012 12:54:59 AM UTC-5, HPP wrote:

 Hai thanks for the replys

 I changed my code like

 matrix.postScale(scaleWidth, scaleHeight);
 matrix.postRotate(angle, X+centrex , Y+centrey );
 canvas.setMatrix(matrix);

 Bitmap resizedBitmap = Bitmap.createBitmap(arrow, 0, 0, 
 arrow.getWidth(), arrow.getHeight(), matrix, true);
 canvas.save(Canvas.MATRIX_SAVE_FLAG);
 canvas.rotate(angle, *X + *getWidth()  1, *Y +* getHeight() 
  1);
 super.dispatchDraw(canvas);
 canvas.drawBitmap(resizedBitmap, X, Y, null); //Draw the arrow 
 on the rotated canvas.
 canvas.restore();

 But still it's not rotating about the centre...



 On Tuesday, 11 September 2012 01:49:30 UTC+5:30, bob wrote:

 canvas.save(Canvas.MATRIX_SAVE_FLAG);
 canvas.rotate(angle, *X + *getWidth()  1, *Y +* getHeight()  1);
 super.dispatchDraw(canvas);
 canvas.restore();

 On Monday, September 10, 2012 2:22:15 PM UTC-5, lbendlin wrote:

 canvas.save(Canvas.MATRIX_SAVE_FLAG);
 canvas.rotate(angle, getWidth()  1, getHeight()  1);
 super.dispatchDraw(canvas);
 canvas.restore();

 On Monday, September 10, 2012 9:18:32 AM UTC-4, Haris wrote:

 Hai all

  I am trying an application like rotating image with motion 
 sensorMy problem is that the image does not rotate about centre 
 properlyAnd my angle range is 0 to 90 and 0 to -90..
 And below is my code.

   public void onDraw(Canvas canvas) {
 super.onDraw(canvas);
  Bitmap arrow = 
 BitmapFactory.decodeResource(getResources(),R.drawable.arrow);
  int arrowW = arrow.getWidth();
  int arrowH = arrow.getHeight();
  float scaleWidth = 1;
  float scaleHeight = 1;
  int centrex = arrowW/2;
  int centrey = arrowH/2;
  int X=108;
  int Y=100;
  int angle=0;

Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);

matrix.postRotate(angle, X+centrex , Y+centrey );
Bitmap resizedBitmap = Bitmap.createBitmap(arrow, 0, 0, 
 arrow.getWidth(), arrow.getHeight(), matrix, true);
   canvas.save();
   canvas.drawBitmap(resizedBitmap, X, Y, null);
   invalidate();
  }

 I am getting the angle values from onCreate method.Using 
 orientation sensor(roll values)..
 But When I rotate the screen my  image is  rotating but not exactly 
 around the image centre.

 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] Rotate image around it's centre problem with matrix rotation

2012-09-10 Thread Haris
Hai all

 I am trying an application like rotating image with motion sensorMy 
problem is that the image does not rotate about centre properlyAnd my 
angle range is 0 to 90 and 0 to -90..
And below is my code.

  public void onDraw(Canvas canvas) {
super.onDraw(canvas);
 Bitmap arrow = 
BitmapFactory.decodeResource(getResources(),R.drawable.arrow);
 int arrowW = arrow.getWidth();
 int arrowH = arrow.getHeight();
 float scaleWidth = 1;
 float scaleHeight = 1;
 int centrex = arrowW/2;
 int centrey = arrowH/2;
 int X=108;
 int Y=100;
 int angle=0;

   Matrix matrix = new Matrix();
   matrix.postScale(scaleWidth, scaleHeight);

   matrix.postRotate(angle, X+centrex , Y+centrey );
   Bitmap resizedBitmap = Bitmap.createBitmap(arrow, 0, 0, 
arrow.getWidth(), arrow.getHeight(), matrix, true);
  canvas.save();
  canvas.drawBitmap(resizedBitmap, X, Y, null);
  invalidate();
 }

I am getting the angle values from onCreate method.Using orientation 
sensor(roll values)..
But When I rotate the screen my  image is  rotating but not exactly around 
the image centre.

Thanks..

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

Re: [android-developers] Rotate image around it's centre problem with matrix rotation

2012-09-10 Thread Haris
Instead of rotating I need to move my image on X and Y direction

On Monday, 10 September 2012 21:22:27 UTC+5:30, Harri Smått wrote:

 Hi,

 Why are you adding constants X and Y to pivot point?

 --
 H
 On Sep 10, 2012 4:18 PM, Haris hari...@gmail.com javascript: wrote:

 Hai all

  I am trying an application like rotating image with motion sensorMy 
 problem is that the image does not rotate about centre properlyAnd my 
 angle range is 0 to 90 and 0 to -90..
 And below is my code.

   public void onDraw(Canvas canvas) {
 super.onDraw(canvas);
  Bitmap arrow = 
 BitmapFactory.decodeResource(getResources(),R.drawable.arrow);
  int arrowW = arrow.getWidth();
  int arrowH = arrow.getHeight();
  float scaleWidth = 1;
  float scaleHeight = 1;
  int centrex = arrowW/2;
  int centrey = arrowH/2;
  int X=108;
  int Y=100;
  int angle=0;

Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);

matrix.postRotate(angle, X+centrex , Y+centrey );
Bitmap resizedBitmap = Bitmap.createBitmap(arrow, 0, 0, 
 arrow.getWidth(), arrow.getHeight(), matrix, true);
   canvas.save();
   canvas.drawBitmap(resizedBitmap, X, Y, null);
   invalidate();
  }

 I am getting the angle values from onCreate method.Using orientation 
 sensor(roll values)..
 But When I rotate the screen my  image is  rotating but not exactly 
 around the image centre.

 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-d...@googlegroups.comjavascript:
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com javascript:
 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: Rotate image around it's centre problem with matrix rotation

2012-09-10 Thread Haris
Hai thanks for the replys

I changed my code like

matrix.postScale(scaleWidth, scaleHeight);
matrix.postRotate(angle, X+centrex , Y+centrey );
canvas.setMatrix(matrix);

Bitmap resizedBitmap = Bitmap.createBitmap(arrow, 0, 0, 
arrow.getWidth(), arrow.getHeight(), matrix, true);
canvas.save(Canvas.MATRIX_SAVE_FLAG);
canvas.rotate(angle, *X + *getWidth()  1, *Y +* getHeight()  1);
super.dispatchDraw(canvas);
canvas.drawBitmap(resizedBitmap, X, Y, null); //Draw the arrow on 
the rotated canvas.
canvas.restore();

But still it's not rotating about the centre...



On Tuesday, 11 September 2012 01:49:30 UTC+5:30, bob wrote:

 canvas.save(Canvas.MATRIX_SAVE_FLAG);
 canvas.rotate(angle, *X + *getWidth()  1, *Y +* getHeight()  1);
 super.dispatchDraw(canvas);
 canvas.restore();

 On Monday, September 10, 2012 2:22:15 PM UTC-5, lbendlin wrote:

 canvas.save(Canvas.MATRIX_SAVE_FLAG);
 canvas.rotate(angle, getWidth()  1, getHeight()  1);
 super.dispatchDraw(canvas);
 canvas.restore();

 On Monday, September 10, 2012 9:18:32 AM UTC-4, Haris wrote:

 Hai all

  I am trying an application like rotating image with motion sensorMy 
 problem is that the image does not rotate about centre properlyAnd my 
 angle range is 0 to 90 and 0 to -90..
 And below is my code.

   public void onDraw(Canvas canvas) {
 super.onDraw(canvas);
  Bitmap arrow = 
 BitmapFactory.decodeResource(getResources(),R.drawable.arrow);
  int arrowW = arrow.getWidth();
  int arrowH = arrow.getHeight();
  float scaleWidth = 1;
  float scaleHeight = 1;
  int centrex = arrowW/2;
  int centrey = arrowH/2;
  int X=108;
  int Y=100;
  int angle=0;

Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);

matrix.postRotate(angle, X+centrex , Y+centrey );
Bitmap resizedBitmap = Bitmap.createBitmap(arrow, 0, 0, 
 arrow.getWidth(), arrow.getHeight(), matrix, true);
   canvas.save();
   canvas.drawBitmap(resizedBitmap, X, Y, null);
   invalidate();
  }

 I am getting the angle values from onCreate method.Using orientation 
 sensor(roll values)..
 But When I rotate the screen my  image is  rotating but not exactly 
 around the image centre.

 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: Animation moving image in random

2012-09-08 Thread Haris
Ok I will explain.
Using animation I need to move my image randomly throughout the view.I 
am using canvas and drawables for this
Any way I got solutionSo leave it.
Thanks.

On Friday, 7 September 2012 16:19:57 UTC+5:30, Haris wrote:



 For my application I need to move my image randomly throughout the screen 
 using motion sensor
 The motion sensor part completed. So as the next step I need to move an 
 arrow throughout the screen. I searched in internet a lotPlease 
 help..

 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] Animation moving image in random

2012-09-07 Thread Haris


For my application I need to move my image randomly throughout the screen 
using motion sensor
The motion sensor part completed. So as the next step I need to move an 
arrow throughout the screen. I searched in internet a lotPlease 
help..

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: Animation moving image in random

2012-09-07 Thread Haris

I just meant some link where I can refer for the above questionAny way 
thanks for your reply... 

On Friday, 7 September 2012 16:19:57 UTC+5:30, Haris wrote:



 For my application I need to move my image randomly throughout the screen 
 using motion sensor
 The motion sensor part completed. So as the next step I need to move an 
 arrow throughout the screen. I searched in internet a lotPlease 
 help..

 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: Android animation

2012-09-06 Thread Haris


On Thursday, 6 September 2012 10:54:30 UTC+5:30, Haris wrote:

 Thanks for your reply


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

[android-developers] Android animation

2012-09-05 Thread Haris

Hai all

For my application I need to create growing arrow from centre of the 
screen. For this application which resources  should I use in android?


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: Android List view with toggle button

2012-09-03 Thread Haris
Thanks for your reply.

Can you explain little more..?

On Saturday, 1 September 2012 18:12:00 UTC+5:30, Haris wrote:


 Hai...

   I am writing an application something like list view with toggle 
 button...
 Here is my source code...


 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  ArrayAdapterString adapter=new 
 ArrayAdapterString(getApplicationContext(),R.layout.main,R.id.textView1,getResources().getStringArray(R.array.Strings));
  setListAdapter(adapter);

  }
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) 
 {
  String item = (String) getListAdapter().getItem(position);
  Toast.makeText(this, item+ selected, Toast.LENGTH_LONG).show();
  } 

 And I am importing the list from string resources..and my sring.xml is

 resources
 string name=app_nameMyListViewWithToggleButton/string
  string name=hello_worldHello world!/string
  string name=menu_settingsSettings/string
  string name=title_activity_mainMyListViewWithToggle/string
  string name=On_OffON/OFF/string
  
  
  string-array name=Strings
  
  item Relay1/item
  item Relay2/item
  item Relay3/item
  item Relay4/item
  item Relay5/item
  item Relay6/item
  item Relay7/item
  item Relay8/item
  /string-array
 /resources

 And in mu main.xml I am using a text view and toggle button


 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;
  xmlns:tools=http://schemas.android.com/tools;
  android:layout_width=match_parent
  android:layout_height=match_parent 
  
TextView
  android:id=@+id/textView1
  android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:layout_alignParentLeft=true
  android:layout_toLeftOf=@+id/toggleButton1
  android:textSize=20dp 
/TextView
  
 
   ToggleButton
  android:id=@+id/toggleButton1
  android:layout_width=wrap_content
  android:layout_height=wrap_content
   android:layout_alignParentRight=true
  android:layout_marginLeft=4dp
  android:layout_marginRight=10dp 
   android:text=@string/On_Off 
  
/ToggleButton
  

 /RelativeLayout

 when I click the toggle button it showing On and off...
 But when I click on the list I am not getting any responses..

 For my application I need to send some data while pressing the toggle 
 button with respect to button condtion

 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] Android List view with toggle button

2012-09-01 Thread Haris

Hai...

  I am writing an application something like list view with toggle 
button...
Here is my source code...


public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 ArrayAdapterString adapter=new 
ArrayAdapterString(getApplicationContext(),R.layout.main,R.id.textView1,getResources().getStringArray(R.array.Strings));
 setListAdapter(adapter);

 }
 @Override
 protected void onListItemClick(ListView l, View v, int position, long id) {
 String item = (String) getListAdapter().getItem(position);
 Toast.makeText(this, item+ selected, Toast.LENGTH_LONG).show();
 } 

And I am importing the list from string resources..and my sring.xml is

resources
string name=app_nameMyListViewWithToggleButton/string
 string name=hello_worldHello world!/string
 string name=menu_settingsSettings/string
 string name=title_activity_mainMyListViewWithToggle/string
 string name=On_OffON/OFF/string
 
 
 string-array name=Strings
 
 item Relay1/item
 item Relay2/item
 item Relay3/item
 item Relay4/item
 item Relay5/item
 item Relay6/item
 item Relay7/item
 item Relay8/item
 /string-array
/resources

And in mu main.xml I am using a text view and toggle button


RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;
 xmlns:tools=http://schemas.android.com/tools;
 android:layout_width=match_parent
 android:layout_height=match_parent 
 
   TextView
 android:id=@+id/textView1
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:layout_alignParentLeft=true
 android:layout_toLeftOf=@+id/toggleButton1
 android:textSize=20dp 
   /TextView
 

  ToggleButton
 android:id=@+id/toggleButton1
 android:layout_width=wrap_content
 android:layout_height=wrap_content
  android:layout_alignParentRight=true
 android:layout_marginLeft=4dp
 android:layout_marginRight=10dp 
  android:text=@string/On_Off 
 
   /ToggleButton
 

/RelativeLayout

when I click the toggle button it showing On and off...
But when I click on the list I am not getting any responses..

For my application I need to send some data while pressing the toggle 
button with respect to button condtion

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] Android List view with toggle button

2012-09-01 Thread Haris

Hai...

  I am writing an application something like list view with toggle 
button...
Here is my source code...


public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 ArrayAdapterString adapter=new 
ArrayAdapterString(getApplicationContext(),R.layout.main,R.id.textView1,getResources().getStringArray(R.array.Strings));
 setListAdapter(adapter);

 }
 @Override
 protected void onListItemClick(ListView l, View v, int position, long id) {
 String item = (String) getListAdapter().getItem(position);
 Toast.makeText(this, item+ selected, Toast.LENGTH_LONG).show();
 } 

And I am importing the list from string resources..and my sring.xml is

resources
string name=app_nameMyListViewWithToggleButton/string
 string name=hello_worldHello world!/string
 string name=menu_settingsSettings/string
 string name=title_activity_mainMyListViewWithToggle/string
 string name=On_OffON/OFF/string
 
 
 string-array name=Strings
 
 item Relay1/item
 item Relay2/item
 item Relay3/item
 item Relay4/item
 item Relay5/item
 item Relay6/item
 item Relay7/item
 item Relay8/item
 /string-array
/resources

And in mu main.xml I am using a text view and toggle button


RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;
 xmlns:tools=http://schemas.android.com/tools;
 android:layout_width=match_parent
 android:layout_height=match_parent 
 
   TextView
 android:id=@+id/textView1
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:layout_alignParentLeft=true
 android:layout_toLeftOf=@+id/toggleButton1
 android:textSize=20dp 
   /TextView
 

  ToggleButton
 android:id=@+id/toggleButton1
 android:layout_width=wrap_content
 android:layout_height=wrap_content
  android:layout_alignParentRight=true
 android:layout_marginLeft=4dp
 android:layout_marginRight=10dp 
  android:text=@string/On_Off 
 
   /ToggleButton
 

/RelativeLayout

when I click the toggle button it showing On and off...
But when I click on the list I am not getting any responses..

For my application I need to send some data while pressing the toggle 
button with respect to button condtion

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] Bleutooth chat Api 10 not working

2012-08-30 Thread Haris

Hai all I am trying with blue-tooth chat example for api-10, in my micromax 
pfhone..

When I scanning for devices it showing the list  for both secure and non 
secure.
But When I try to connect it showing unable to connect...

And UUID s are

private static final UUID MY_UUID_SECURE = 
UUID.fromString(fa87c0d0-afac-11de-8a39-0800200c9a66);
private static final UUID MY_UUID_INSECURE 
=UUID.fromString(8ce255c0-200a-11e0-ac64-0800200c9a66);

I tried 
thishttp://stackoverflow.com/questions/3397071/service-discovery-failed-exception-using-bluetooth-on-androidlink
 also...But no change.

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

Re: [android-developers] Re: Bleutooth chat Api 10 not working

2012-08-30 Thread Haris P P
No...The other device doesn't have the bluetooth chat application..
I want connect to a mobile device now...Later I need to connect to
embedded bluetooth module.

Does the other device need blue-tooth client on listening mode at the same
time or I just need to turn on the device discoverable option on it ?.

On Thu, Aug 30, 2012 at 8:43 PM, bob b...@coolfone.comze.com wrote:

 Are you attempting to connect to another device running the Bluetooth Chat
 example?


 If so, what type of device is it?



 On Thursday, August 30, 2012 2:37:20 AM UTC-5, Haris wrote:


 Hai all I am trying with blue-tooth chat example for api-10, in my
 micromax pfhone..

 When I scanning for devices it showing the list  for both secure and non
 secure.
 But When I try to connect it showing unable to connect...

 And UUID s are

 private static final UUID MY_UUID_SECURE = UUID.fromString(fa87c0d0-**
 afac-11de-8a39-0800200c9a66);
 private static final UUID MY_UUID_INSECURE =UUID.fromString(8ce255c0-**
 200a-11e0-ac64-0800200c9a66);

 I tried 
 thishttp://stackoverflow.com/questions/3397071/service-discovery-failed-exception-using-bluetooth-on-androidlink
  also...But no change.

 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




-- 
* Haris PP*

  *09975847673(pune)
   09744593643(kerala)*

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

Re: [android-developers] Android Activity And closing application

2012-08-28 Thread Haris P P
Hai  Kristopher I didn't get your point..

On Tue, Aug 28, 2012 at 12:32 PM, Kristopher Micinski 
krismicin...@gmail.com wrote:

 Hopefully you don't take this badly...

 Unfortunately this is the case where, if you want to exit the app, in
 Android,

 it just doesn't work like that,

 kris


 On Tue, Aug 28, 2012 at 12:34 AM, Haris P P haris...@gmail.com wrote:

 Thanks for your reply.

 On Mon, Aug 27, 2012 at 8:35 PM, Justin Anderson 
 magouyaw...@gmail.comwrote:

 Now I am following the second one...And its working perfectly...


 If it is working, then why change it?  If it ain't broken don't fix it...


 And also for go back to the previous layout I am just pressing the back
 button.Do I need to call the finish() methodOr the android do it
 automatically..


 You do not need to call finish() yourself in this scenario.


 And I noticed that when close the application by calling finish() the
 program is exiting. But In Application-mange application it showing an
 option for force stop..


 This is how Android works... just let it work its magic.


 Is there any method to  exit  application properly ?.


 No...

 Thanks,
 Justin Anderson
 MagouyaWare Developer
 http://sites.google.com/site/magouyaware



 On Mon, Aug 27, 2012 at 5:43 AM, Renuka Deshpande 
 renukanil.deshpa...@gmail.com wrote:

 Hello,

 Let OS kill the application. see these
 http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon


 http://stackoverflow.com/questions/5100728/how-to-force-stop-my-android-application-programatically


 http://stackoverflow.com/questions/6330200/how-to-quit-android-application-programmatically


 When you press back the current activity is automatically finish and
 removed from stack, so when you start same activity only one instance will
 be there. You dont need to finish activity programmatically yourself when
 you press back, Os does that.


 On Mon, Aug 27, 2012 at 3:44 PM, Haris haris...@gmail.com wrote:



 Hai all

   For my application I am using more than one layout, and I nedd to
 switch from layout to layout  
 I think there are two methods for this.

 1. Using setContentView switch to new layout.
 2. Or by creating new activity switch to new layout.

 Now I am following the second one...And its working perfectly...

 So which one I should use for my application...?

 And also for go back to the previous layout I am just pressing the
 back button.Do I need to call the finish() methodOr the android do
 it automatically..

 And I noticed that when close the application by calling finish() the
 program is exiting. But In Application-mange application it showing an
 option for force stop..

 Is there any method to  exit  application properly ?.

 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




 --
 Thanks  Regards,
 Renuka

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




 --
 * Haris PP*

   *09975847673(pune)
09744593643(kerala)*


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




-- 
* Haris PP*

  *09975847673(pune)
   09744593643(kerala)*

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

Re: [android-developers] Android Activity And closing application

2012-08-28 Thread Haris P P
Thanks..I understood

On Tue, Aug 28, 2012 at 1:22 PM, Kristopher Micinski krismicin...@gmail.com
 wrote:

 You don't just exit apps on Android,

 The system does it for you,

 kris


 On Tue, Aug 28, 2012 at 3:47 AM, Haris P P haris...@gmail.com wrote:

 Hai  Kristopher I didn't get your point..

 On Tue, Aug 28, 2012 at 12:32 PM, Kristopher Micinski 
 krismicin...@gmail.com wrote:

 Hopefully you don't take this badly...

 Unfortunately this is the case where, if you want to exit the app, in
 Android,

 it just doesn't work like that,

 kris


 On Tue, Aug 28, 2012 at 12:34 AM, Haris P P haris...@gmail.com wrote:

 Thanks for your reply.

 On Mon, Aug 27, 2012 at 8:35 PM, Justin Anderson magouyaw...@gmail.com
  wrote:

 Now I am following the second one...And its working perfectly...


 If it is working, then why change it?  If it ain't broken don't fix
 it...


 And also for go back to the previous layout I am just pressing the
 back button.Do I need to call the finish() methodOr the android 
 do
 it automatically..


 You do not need to call finish() yourself in this scenario.


 And I noticed that when close the application by calling finish() the
 program is exiting. But In Application-mange application it showing an
 option for force stop..


 This is how Android works... just let it work its magic.


 Is there any method to  exit  application properly ?.


 No...

 Thanks,
 Justin Anderson
 MagouyaWare Developer
 http://sites.google.com/site/magouyaware



 On Mon, Aug 27, 2012 at 5:43 AM, Renuka Deshpande 
 renukanil.deshpa...@gmail.com wrote:

 Hello,

 Let OS kill the application. see these
 http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon


 http://stackoverflow.com/questions/5100728/how-to-force-stop-my-android-application-programatically


 http://stackoverflow.com/questions/6330200/how-to-quit-android-application-programmatically


 When you press back the current activity is automatically finish and
 removed from stack, so when you start same activity only one instance 
 will
 be there. You dont need to finish activity programmatically yourself when
 you press back, Os does that.


 On Mon, Aug 27, 2012 at 3:44 PM, Haris haris...@gmail.com wrote:



 Hai all

   For my application I am using more than one layout, and I nedd to
 switch from layout to layout  
 I think there are two methods for this.

 1. Using setContentView switch to new layout.
 2. Or by creating new activity switch to new layout.

 Now I am following the second one...And its working perfectly...

 So which one I should use for my application...?

 And also for go back to the previous layout I am just pressing the
 back button.Do I need to call the finish() methodOr the android 
 do
 it automatically..

 And I noticed that when close the application by calling finish()
 the program is exiting. But In Application-mange application it 
 showing an
 option for force stop..

 Is there any method to  exit  application properly ?.

 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




 --
 Thanks  Regards,
 Renuka

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




 --
 * Haris PP*

   *09975847673(pune)
09744593643(kerala)*


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

[android-developers] Listening multiple button

2012-08-28 Thread Haris


  Hai all..

For my application I am using several buttons...
Is it possible to listen multiple button at the same time..
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] Android Activity And closing application

2012-08-27 Thread Haris


Hai all 

  For my application I am using more than one layout, and I nedd to switch 
from layout to layout  
I think there are two methods for this.

1. Using setContentView switch to new layout.
2. Or by creating new activity switch to new layout.

Now I am following the second one...And its working perfectly...

So which one I should use for my application...?

And also for go back to the previous layout I am just pressing the back 
button.Do I need to call the finish() methodOr the android do it 
automatically..

And I noticed that when close the application by calling finish() the 
program is exiting. But In Application-mange application it showing an 
option for force stop..

Is there any method to  exit  application properly ?. 

Thanks..

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

Re: [android-developers] Android Activity And closing application

2012-08-27 Thread Haris P P
Thanks for your reply.

On Mon, Aug 27, 2012 at 8:35 PM, Justin Anderson magouyaw...@gmail.comwrote:

 Now I am following the second one...And its working perfectly...


 If it is working, then why change it?  If it ain't broken don't fix it...


 And also for go back to the previous layout I am just pressing the back
 button.Do I need to call the finish() methodOr the android do it
 automatically..


 You do not need to call finish() yourself in this scenario.


 And I noticed that when close the application by calling finish() the
 program is exiting. But In Application-mange application it showing an
 option for force stop..


 This is how Android works... just let it work its magic.


 Is there any method to  exit  application properly ?.


 No...

 Thanks,
 Justin Anderson
 MagouyaWare Developer
 http://sites.google.com/site/magouyaware



 On Mon, Aug 27, 2012 at 5:43 AM, Renuka Deshpande 
 renukanil.deshpa...@gmail.com wrote:

 Hello,

 Let OS kill the application. see these
 http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon


 http://stackoverflow.com/questions/5100728/how-to-force-stop-my-android-application-programatically


 http://stackoverflow.com/questions/6330200/how-to-quit-android-application-programmatically


 When you press back the current activity is automatically finish and
 removed from stack, so when you start same activity only one instance will
 be there. You dont need to finish activity programmatically yourself when
 you press back, Os does that.


 On Mon, Aug 27, 2012 at 3:44 PM, Haris haris...@gmail.com wrote:



 Hai all

   For my application I am using more than one layout, and I nedd to
 switch from layout to layout  
 I think there are two methods for this.

 1. Using setContentView switch to new layout.
 2. Or by creating new activity switch to new layout.

 Now I am following the second one...And its working perfectly...

 So which one I should use for my application...?

 And also for go back to the previous layout I am just pressing the back
 button.Do I need to call the finish() methodOr the android do it
 automatically..

 And I noticed that when close the application by calling finish() the
 program is exiting. But In Application-mange application it showing an
 option for force stop..

 Is there any method to  exit  application properly ?.

 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




 --
 Thanks  Regards,
 Renuka

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




-- 
* Haris PP*

  *09975847673(pune)
   09744593643(kerala)*

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

2012-08-25 Thread Haris








Hai **  MagouyaWare...
Here is my image look like on first case
https://lh6.googleusercontent.com/-BcivHh5tubo/UDhsrc94C8I/AJI/7ZSyfv94zTg/s1600/1.jpg

And when screen rotating the image looks like...

https://lh3.googleusercontent.com/-ZFI3SeossPw/UDht4wPL2eI/AJQ/a7yXxVLct30/s1600/2.jpg

So can I use the linearyout with  gravity setting...


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

Re: [android-developers] Re: Android button position changes while the screen rotating

2012-08-25 Thread Haris
Thank you sree for your reply..

Now the problem  solved using the layoutland folder
And I refer the link..

http://wiresareobsolete.com/wordpress/2009/12/android-layouts-supporting-orientation/

On Saturday, 25 August 2012 11:54:37 UTC+5:30, sree wrote:

 you will use layoutland operation in your layout folder.


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

2012-08-24 Thread Haris
thanks all for your replay...
I will try it today

On Thursday, 23 August 2012 17:00:42 UTC+5:30, Haris wrote:

 Hai all I am new in android programming.

 For my application I am using image button and it successfully installed 
 on the device.
 But when I rotate the screen all the button position get changed... 
 and I need all the button placed at centre of the screen
 And here is my code


 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 

 TextView
 android:id=@+id/testText
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:textColor=#FFCC99
 android:textSize=24dp /

 ImageButton
 android:id=@+id/up
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:layout_alignParentRight=true
 android:layout_alignParentTop=true
 android:layout_marginRight=124dp
 android:layout_marginTop=80dp
 android:src=@drawable/up /

 ImageButton
 android:id=@+id/left
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:layout_alignParentRight=true
 android:layout_alignParentTop=true
 android:layout_below=@+id/up
 android:layout_marginRight=200dp
 android:layout_marginTop=150dp
 
 android:src=@drawable/left /

 ImageButton
 android:id=@+id/right
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:layout_alignParentRight=true
 android:layout_alignParentTop=true
 android:layout_below=@+id/up
 android:layout_marginRight=50dp
 android:layout_marginTop=150dp
 android:src=@drawable/right /

 ImageButton
 android:id=@+id/down
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:layout_below=@+id/up
 android:layout_alignParentRight=true
 android:layout_marginRight=124dp
 android:layout_marginTop=80dp
 android:src=@drawable/down /

 /RelativeLayout


 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

Re: [android-developers] Android button position changes while the screen rotating

2012-08-24 Thread Haris
Hai..

I changed the  AndroidManifest.xml as you said..
Its working that is the button not changing its postion..

But for my application I need to change the button postion.That is I am 
using left, right, up down buttons..

So it should be on the appropriate position while rotating the 
screen.. Any Idea?

On Friday, 24 August 2012 00:26:51 UTC+5:30, TreKing wrote:

 On Thu, Aug 23, 2012 at 6:30 AM, Haris hari...@gmail.com javascript:wrote:

 But when I rotate the screen all the button position get changed... 
 and I need all the button placed at centre of the screen


 Try using a LinearLayout with the proper gravity settings.

 On Thu, Aug 23, 2012 at 7:51 AM, Jadranko Bodiroga 
 jadrankobo...@gmail.com javascript: wrote:

 i suggest that to use one orientation of screen:


 Why? This is kludge that will cause more problems than it will fix in this 
 simple case. 


 -
 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: Android button position changes while the screen rotating

2012-08-24 Thread Haris
Thanks**  MagouyaWare for your valuable reply

On Thursday, 23 August 2012 17:00:42 UTC+5:30, Haris wrote:

 Hai all I am new in android programming.

 For my application I am using image button and it successfully installed 
 on the device.
 But when I rotate the screen all the button position get changed... 
 and I need all the button placed at centre of the screen
 And here is my code


 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 

 TextView
 android:id=@+id/testText
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:textColor=#FFCC99
 android:textSize=24dp /

 ImageButton
 android:id=@+id/up
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:layout_alignParentRight=true
 android:layout_alignParentTop=true
 android:layout_marginRight=124dp
 android:layout_marginTop=80dp
 android:src=@drawable/up /

 ImageButton
 android:id=@+id/left
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:layout_alignParentRight=true
 android:layout_alignParentTop=true
 android:layout_below=@+id/up
 android:layout_marginRight=200dp
 android:layout_marginTop=150dp
 
 android:src=@drawable/left /

 ImageButton
 android:id=@+id/right
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:layout_alignParentRight=true
 android:layout_alignParentTop=true
 android:layout_below=@+id/up
 android:layout_marginRight=50dp
 android:layout_marginTop=150dp
 android:src=@drawable/right /

 ImageButton
 android:id=@+id/down
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:layout_below=@+id/up
 android:layout_alignParentRight=true
 android:layout_marginRight=124dp
 android:layout_marginTop=80dp
 android:src=@drawable/down /

 /RelativeLayout


 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] Android button position changes while the screen rotating

2012-08-23 Thread Haris
Hai all I am new in android programming.

For my application I am using image button and it successfully installed on 
the device.
But when I rotate the screen all the button position get changed... 
and I need all the button placed at centre of the screen
And here is my code


RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical 

TextView
android:id=@+id/testText
android:layout_width=wrap_content
android:layout_height=wrap_content
android:textColor=#FFCC99
android:textSize=24dp /

ImageButton
android:id=@+id/up
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_alignParentRight=true
android:layout_alignParentTop=true
android:layout_marginRight=124dp
android:layout_marginTop=80dp
android:src=@drawable/up /

ImageButton
android:id=@+id/left
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_alignParentRight=true
android:layout_alignParentTop=true
android:layout_below=@+id/up
android:layout_marginRight=200dp
android:layout_marginTop=150dp

android:src=@drawable/left /

ImageButton
android:id=@+id/right
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_alignParentRight=true
android:layout_alignParentTop=true
android:layout_below=@+id/up
android:layout_marginRight=50dp
android:layout_marginTop=150dp
android:src=@drawable/right /

ImageButton
android:id=@+id/down
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_below=@+id/up
android:layout_alignParentRight=true
android:layout_marginRight=124dp
android:layout_marginTop=80dp
android:src=@drawable/down /

/RelativeLayout


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] Audio sampling

2012-07-23 Thread Haris


Hai...all..
 
I am new in android.. I just test the code for audio recording from the 
android developer site. It recorded fine using the AVD manager... 
But I am not able to see the recorded file in AVD Also I need sampling 
rate for each second of the recorded audio...Is it possible to create such 
an application in android..

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] Bug on Fragment multi-pane Layout???

2012-04-26 Thread Abdul Haris Ilmawan
hey,, is there anyone notice this??
I test the Multipane layout from source sample of multipane layout

let me ilustrate it..
In portrait condition,, i choose the 2nd item.. it show the detail on 
another activity -- normal
then rotate it to landscape, now the detail is side by side with the 
title.. -- normal

i rotate back to portrait,, shown the title list,, i choose 3rd item,, it 
show the detail on different activity -- normal
the problem is
when i rotate it to landscape again, its not showing the proper item, 
instead of showing the title list being mark at the 3rd item and the 
details of 3rd item shown..
it only show the 2nd item marked on the list and the details of 2nd item 
shown..

can anybody explain it to 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] parental control

2012-02-20 Thread muhammed haris
hey there i m new to android i wanted to create a parental control app
which could block some apps from starting specified by user.. can any1
suggest me where to start with i know that eventlog could be of help
but cant find how...

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

2011-05-25 Thread Haris Ambady
Even I have the same issue... 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