[android-developers] camera preview problem
Hi friends, i have to take picture from my application and need to store it database. i used following preview code in my app class Preview extends SurfaceView implements SurfaceHolder.Callback { // 1 private static final String TAG = Preview; SurfaceHolder mHolder; // 2 public Camera camera; Size mPreviewSize; ListSize mSupportedPreviewSizes; Preview(Context context) { super(context); // Install a SurfaceHolder.Callback so we get notified when the // underlying surface is created and destroyed. mHolder = getHolder(); // 4 mHolder.addCallback(this); // 5 mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); // 6 } // Called once the holder is ready public void surfaceCreated(SurfaceHolder holder) { // 7 // The Surface has been created, acquire the camera and tell it where // to draw. camera = Camera.open(); // 8 try { camera.setPreviewDisplay(holder); // 9 camera.setPreviewCallback(new PreviewCallback() { // 10 // Called for each frame previewed public void onPreviewFrame(byte[] data, Camera camera) { // 11 Log.d(TAG, onPreviewFrame called at: + System.currentTimeMillis()); Preview.this.invalidate(); // 12 } }); } catch (IOException e) { // 13 e.printStackTrace(); } } // Called when the holder is destroyed public void surfaceDestroyed(SurfaceHolder holder) { // 14 Log.d(TAG,Stopping preview in SurfaceDestroyed().); camera.setPreviewCallback(null); camera.stopPreview(); camera.release(); // camera = null; } // Called when holder has changed public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { // 15 Camera.Parameters p = camera.getParameters(); p.setPreviewSize(w, h); camera.setParameters(p); camera.startPreview(); } public void setCamera(Camera camera) { camera = camera; if (camera != null) { mSupportedPreviewSizes = camera.getParameters().getSupportedPreviewSizes(); requestLayout(); } } public void switchCamera(Camera camera) { setCamera(camera); try { camera.setPreviewDisplay(mHolder); } catch (IOException exception) { Log.e(TAG, IOException caused by setPreviewDisplay(), exception); } Camera.Parameters parameters = camera.getParameters(); parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height); requestLayout(); camera.setParameters(parameters); } } the same code working well in samsung galaxy tab(model no GT-P1010). but the camera preview is not clear in samsung galaxy Verizon (model SCH-I800). The preview is very blurry, but the photo it takes is good. what might be problem is it there any fault in my code? how to solve this? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Problem in Asynctask Execution in standby mode
Thanks Guys.. i solved this problem. the solution is we need to dismiss the progressDialog and set this to null in onPause method. And in onPostExecute method we have to check progressDialog!=null before dismiss this dialog... Thnak you for your response -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Problem in Asynctask Execution in standby mode
Hi friends, I am using AsyncTask concept to download data from server. private class DownloadTask extends AsyncTaskVoid,Void,String { private ProgressDialog progressDialog; @Override protected void onPreExecute() { super.onPreExecute(); progressDialog = new ProgressDialog(ActivityTab.this); progressDialog.setProgress(10); progressDialog.setSecondaryProgress(32); progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); progressDialog.setMessage(Downloading...); progressDialog.show(); } protected String doInBackground(Void... params) { String result= ; result = download(); return result; } protected void onPostExecute(String result) { if(progressDialog.isShowing()) progressDialog.dismiss(); Toast.makeText(getApplicationContext(), +result.toString(),Toast.LENGTH_LONG).show(); } } in download button click i called new DownloadTask().execute(); This is working well. the thing is if device goes to standby mode (Screen goes off) while showing this downloading.. progressbar mean my application getting force closed. it says like IllegalStateException. how to solve this probelm? it is there any way to prevent screen from locking untill complete this download process? please help me. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] android application gets killed in stand by mode
Hi friends, When the device screen blanks or goes to stand by mode (or they turn it off) my app gets killed and sometimes forces closed as well . but the app should keep running and show up as soon as they turn on and unlock the screen after it has gone blank. how to get this please help me. Thanks, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: need help on menu in android
Thank you so much TreKing and JonFHancock... it's worked for me.. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] need help on menu in android
Hi friends, i have two spinner and three edit text fields in my form at top row. now i want to move these fields into menu which only pops up when you hit the menu button. is it there any way to get this? please help me. Thanks, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] need help on spinner
Hi friends, i dont want to show spinner items while i touch (onTouch) on spinner. it will shows the spinner item only on onitemseleted. in touch event just i want to do some calculation only no need to select item from spinner. how can i get this? is it possible? 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] need help on spinner
Hi friends, i dont want to show spinner items while i touch (onTouch) on spinner. it will shows the spinner item only on onitemseleted. in touch event just i want to do some calculation only no need to select item from spinner. how can i get this? is it possible? 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] need help on spinner
Hi friends, i dont want to show spinner items while i touch (onTouch) on spinner. it will shows the spinner item only on onitemseleted. in touch event just i want to do some calculation only no need to select item from spinner. how can i get this? is it possible? 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] pass date into .net webservice
Hi friends, can anyone know how to pass the date from android application into .net webservice? i want to pass date from android into .net via webservice. this is my code... SimpleDateFormat dateFormater = new SimpleDateFormat(MM/dd/); Date myDate = dateFormater.parse(12/03/2011); java.sql.Date sqltDate = new java.sql.Date(myDate.getTime()); request = new SoapObject(NAMESPACE,methodName); envelope.dotNet = true; request.addProperty(InputDate,sqltDate); but i am getting error message like cannot serialize : 2011-12-03 . how can i solve this? any idea? Note : in .net DateTime datatype used to retrive this. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] application has stopped unexpectedly in camera previewmmode
hi friends, Am using camera to take snap in my application.While am in a camera preview mode if any interruption occurs like lock mode, go to back the application has stopped unexpectedly. Any one tell me suggestions what to do so that the application does not gets close. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] application has stopped unexpectedly in camera preview mode
hi friends, Am using camera to take snap in my application.While am in a camera preview mode if any interruption occurs like lock mode, go to back the application has stopped unexpectedly. Any one tell me suggestions what to do so that the application does not gets close. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] need help on take snapshot and save
Hi friends, i want to take snapshot and save it in database in android.i dont have any idea about this. i need some information related to this. can anyone please help to start this application? Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: need help on take snapshot and save
oh sorry.. i want to take snapshot from camera and save it in sqllite db. thanks On Aug 22, 3:12 pm, Appaholics raghavs...@appaholics.in wrote: Snapshot of the screen or through the camera? You will need to provide a lot more information. On Mon, Aug 22, 2011 at 3:15 PM, sktniran sktniranjanad...@gmail.comwrote: Hi friends, i want to take snapshot and save it in database in android.i dont have any idea about this. i need some information related to this. can anyone please help to start this application? Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- -- Raghav Sood CEO/Founder/Owner/Dictator/Tyrant at Appaholics (Basically all titles required to have complete control)http://www.raghavsood.com/https://market.android.com/developer?pub=Appaholicshttp://www.appaholics.in/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: pass hashtable from one activity to another activity
thanks worked for me On Aug 9, 7:25 pm, Streets Of Boston flyingdutc...@gmail.com wrote: Use a Bundle instead of a Map (HashMap/Hashtable). *Bundle bundle = new Bundle();* *...* *... // copy contents of hash map into bundle * *...* *intent.putExtra(myhashmap, bundle);* *...* In other activity: ** *Bundle bundle = intent.getBundleExtra(myhashmap);* *...* But Mark has some good advice. If your hash map is substantially large, you may want to use some other model (database and such). -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] key from value in hash table
Hi is it there any way to retrive key from value in hashtable? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] relative layout
hi friends, i want to add spinner1,btn1,btn2,spinner2 in single row dynamically. likewise i have to add 'n' no of rows. i am using Relative Layout. the problem is when i am adding these controls dynamically the height of btn and spinner will differ. the two btns slightly moved up. any 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] pass hashtable from one activity to another activity
hi how to pass hash table from one activity to another using intent.putExtra? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en