[android-developers] Re: android bluetooth
As far as I can see, Android does not currently support playing sound (beeps or other) through a mono (SCO) BT headset. I believe that BT stereo (A2DP) headsets work, though. Have not tried. You might want to check this thread for more info: http://code.google.com/p/android/issues/detail?id=7906 As for getting info on headset button activations in your app, I believe that this requires support for the AVRCP profile. Again, this is commonly seen for stereo headsets, but not for mono. I don't think that the Android BT stack supports AVRCP. This wikipedia article gives a good intro to BT profiles, if you need that: http://en.wikipedia.org/wiki/Bluetooth_profile If you manage to get it to work, be aware that the various manufacturer's interpretation of the BT spec tend to vary a bit... In other words: I'd recommend to test the functionality with every headset that you wish to claim supported by your app. Good luck! BR Per On 24 Dec., 06:51, Jags jag...@gmail.com wrote: Thanks a ton IV, I am happy as long as I get some relevant solution :) . 1. Beep, means I did not mean default handset beep. I meant in my custom application i play a sound. if my hedset is paired when i am playing the sound in my custom application using Mediaplayer class, will it be heard in my headset ? 2. will i be able to capture volume up/down key press in the headset in my application ? if yes how ? regards On Dec 24, 5:53 am, Indicator Veritatis mej1...@yahoo.com wrote: Yes, that is right. You did not get your point across properly. You are doing better in this post, though, despite the disappointing typo of '[oint' for 'point'. But if you do know that the beep is at headsets[sic] control, why you even asking where it is? That makes no sense. The truth of the matter is that the Bluetooth spec does not mandate the beep. The implementer may chose to do it in the headset software, as it is the only choice that makes sense: otherwise the user gets no audio feedback to know that pairing just happened. The only feedback that the Android application gets is that now the headset is listed in the list of bound devices returned by getBondedDevices(). That is, you can sense when the headset was paired by polling getBondedDevices(), but you cannot cause the beep, nor can you sense when the headset does its own beep. You can only rely on what the headset manufacturer chose to implement in their own Bluetooth code. On Dec 22, 9:52 pm,Jagsjag...@gmail.com wrote: thanks IV, I guess i could not put my [oint across properly. Beep is at headsets control, i know. Now when the headset is paired, and my custom application plays a beep, does it automatically beep in the headset or in the handset ? if it automatically beeps in the headset, good, if not what can i do in my custom app to make the beep heard in the headset ? more to that i also need to capture some keypress volume up and down from the headset in my application will I be able to do that in my application ? how ? documentation is not clear on this ! thanks and regards Jagat On Dec 17, 10:57 am, Indicator Veritatis mej1...@yahoo.com wrote: I don't know why this thread is getting spam, but I can offer a guess why you are not getting answers. Your questions seems to strongly imply you have not studied the basics of how to do Bluetooth (whether on Android or not). Specifically, the beep you are interested in controlling is under the headset's control: it is NOT controllable from Android. Nor should it be, so don't wait for it to be added in a future version. On Dec 16, 1:21 am,Jagsjag...@gmail.com wrote: is this message a spam ? Nobody is able to see my message or what ? dont get answers, only get spams posted in the forum ! On Dec 16, 11:03 am, hanika han...@securitywall.in wrote: hi Thanks Regards, cid:image002@01CA2AEF.10F60770 Vijay Patel Test Engineer Elitecore Technologies Ltd. 904, Silicon tower, off C.G Road, Ahmedabad-380 006 Gujarat (INDIA), Tel: +91-79-66065606 | HYPERLINK mailto:vijay.pa...@elitecore.comvijay.pa...@elitecore.com HYPERLINK http://www.cyberoam.comwww.cyberoam.com P Please do not print this email unless it is absolutely necessary. Spread environmental awareness. image001.jpg 2KViewDownload -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Camera preview not restarting after picture taken
Hi Mark, I've looked at your code, thanks for the link. In my app I'm using the new addcallbackwithbuffer and setpreviewcallbackwithbuffer methods. I'm using them to capture preview frames and process them. I think there may be a bug because the camera take picture routine is stalling. I suspect memory issues, but nothing is obvious in logcat. I'm testing on a tmo G2. Best, Stephen On Dec 23, 12:12 pm, Mark Murphy mmur...@commonsware.com wrote: Here is a sample project that does not suffer from this issue: https://github.com/commonsguy/cw-advandroid/tree/master/Camera/Picture If you see the same symptoms with this project, let me know what your device is. Hi On Thu, Dec 23, 2010 at 3:10 PM, Stephen Lebed srle...@gmail.com wrote: Has anyone come across this and found a solution? I'm calling camera.startPreview() after the picture is taken, but the preview is frozen. Best, Stephen -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: JNI CallVoidMethod can t call
Then I manage to do what I want by using obj in CallVoidMethod. I am sure to tried it before but debug is hard with JNI. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: call c++ function with jni and android ndk
Enclose contents of your cpp with following #ifdef __cplusplus extern C { #endif your cpp functions #ifdef __cplusplus } #endif On 22 дек, 14:30, TobyKaos aubrun.thib...@chaos-interactive.com wrote: Hello, I first run samples found in androind ndk and I create my own in C. I successfully print a hello world with c function. but now I want to call c++ function. Then I change file extensions to .cpp and remake with ndk-build. Ok that seems to work fine. I refresh my eclispe project. Ok eclispe seems to find my hello world function in new .so lib made in c++. Then I launched debug and application failed because it does not find c ++ function. My function is the same but I modify jni function in it to match c++ jni. My TestSTL.java package com.project.teststl; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class TestSTL extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.main); TextView tv = new TextView(this); tv.setText( stringFromJNI() ); setContentView(tv); } native public static String stringFromJNI(); static { //System.loadLibrary(stlport_shared); System.loadLibrary(teststl); } } * my test.cpp file #include string.h #include jni.h #include stdlib.h #include stdio.h /* Call to initialize the graphics state */ JNIEXPORT jstring JNICALL Java_com_project_teststl_TestSTL_stringFromJNI( JNIEnv* env, jobject obj ) { jstring s = (env)-NewStringUTF( Hello from JNI !); return s; } I repeat, in C all is ok (I just modify NewStringUTF for C or C++ because are not the same definition). 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
Re: [android-developers] How to go to Home screen..?
Hi swaroop, Here what you mentioned the class HomeScreen which is user defined class. I asked about Mobile HomeScreen. On Fri, Dec 24, 2010 at 1:24 PM, swaroop chandak swaroop.andr...@gmail.comwrote: Simple dude.. just call intent for this homescreen class.. like.. Intent homeScreen= *new* Intent(*this*,HomeScreen.*class*); startActivity(homeScreen); Swaroop On Fri, Dec 24, 2010 at 1:21 PM, Abhilash baddam abhilash.androiddevelo...@gmail.com wrote: Hi friends, When the user clicks on a button, I want to navigate the screen into Home Screen. How can we achieve this. Regards, Abhilash -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to use ndk to compile t emplate classes?
You can try to implement in a .cpp file and when you need to use the class, #include xxx.cpp? 2010/12/24 袁堂夫 yuantangf...@gmail.com As you know that template classes are implemented in the .h header files, and the ndk is not build the .h files. When the ndk link the obj files, it will failed that the template classes are not implemented. Who can help me fix this? Thank you very much, please~ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to use ndk to compile t emplate classes?
搞错了,ndk可以自动编译.h里面的代码的 2010/12/24 赵杨阳 angelbear198...@gmail.com: You can try to implement in a .cpp file and when you need to use the class, #include xxx.cpp? 2010/12/24 袁堂夫 yuantangf...@gmail.com As you know that template classes are implemented in the .h header files, and the ndk is not build the .h files. When the ndk link the obj files, it will failed that the template classes are not implemented. Who can help me fix this? Thank you very much, please~ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to go to Home screen..?
Intent homeIntent = new Intent( Intent.ACTION_MAIN ); homeIntent.addCategory( Intent.CATEGORY_HOME ); Pent On Dec 24, 7:51 am, Abhilash baddam abhilash.androiddevelo...@gmail.com wrote: Hi friends, When the user clicks on a button, I want to navigate the screen into Home Screen. How can we achieve this. Regards, Abhilash -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] The default camera error
I run the camera app on simulator.But it crash ,after I instead code with setEGLConfigChooser(5, 6, 5, 0, 0, 0) for GLRootView.java. It can work. But when I switch from camera model to video recorder.It crashed. How to fix it? 12-24 16:25:41.580: ERROR/audio_input(34): unsupported parameter: x- pvmf/media-input-node/cap-config-interface;valtype=key_specific_value 12-24 16:25:41.580: ERROR/audio_input(34): VerifyAndSetParameter failed 12-24 16:25:41.610: ERROR/CameraInput(34): Unsupported parameter(x- pvmf/media-input-node/cap-config-interface;valtype=key_specific_value) 12-24 16:25:41.620: ERROR/CameraInput(34): VerifiyAndSetParameter failed on parameter #0 12-24 16:25:41.859: ERROR/PVOMXEncNode(34): PVMFOMXEncNode- Audio_AMRNB::DoPrepare(): Got Component OMX.PV.amrencnb handle 12-24 16:25:41.859: ERROR/PVOMXEncNode(34): PVMFOMXEncNode- Audio_AMRNB::DoPrepare(): Got Component OMX.PV.amrencnb handle 12-24 16:25:41.959: ERROR/AuthorDriver(34): Command 13 completed with error -17 12-24 16:25:41.959: ERROR/MediaRecorder(2034): prepare failed: -17 12-24 16:25:41.959: ERROR/videocamera(2034): prepare failed for /mnt/ sdcard/DCIM/Camera/VID_20101224_162541.3gp 12-24 16:25:42.059: ERROR/CameraInput(34): Unsupported parameter(x- pvmf/media-input-node/cap-config-interface;valtype=key_specific_value) 12-24 16:25:42.059: ERROR/CameraInput(34): VerifiyAndSetParameter failed on parameter #0 12-24 16:25:42.069: ERROR/audio_input(34): unsupported parameter: x- pvmf/media-input-node/cap-config-interface;valtype=key_specific_value 12-24 16:25:42.069: ERROR/audio_input(34): VerifyAndSetParameter failed 12-24 16:25:42.139: ERROR/AndroidRuntime(2034): FATAL EXCEPTION: main 12-24 16:25:42.139: ERROR/AndroidRuntime(2034): java.lang.RuntimeException: java.io.IOException: prepare failed. 12-24 16:25:42.139: ERROR/AndroidRuntime(2034): at com.android.camera.VideoCamera.initializeRecorder(VideoCamera.java: 942) 12-24 16:25:42.139: ERROR/AndroidRuntime(2034): Caused by: java.io.IOException: prepare failed. 12-24 16:25:42.139: ERROR/AndroidRuntime(2034): at android.media.MediaRecorder._prepare(Native Method) 12-24 16:25:42.139: ERROR/AndroidRuntime(2034): at android.media.MediaRecorder.prepare(MediaRecorder.java:503) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to redirect GPS nmea from /dev/ttymxc to somewhere
Dear Anil, I follow your comment to implement HAL. AP - LocationManager can read Location information now. Very appreciate for you help. I have another problem. How can I let GpsStatus.Listener() and GpsStatus.NmeaListener() work fine? I think I must implement something in HAL too, but I have no idea about this. In HAL, I implement the following function. nmea_reader_init nmea_reader_set_callback nmea_reader_update_time nmea_reader_update_date nmea_reader_update_latlong nmea_reader_update_altitude nmea_reader_update_bearing nmea_reader_update_speed nmea_reader_parse What else function should I implement? Very appreciate for any help or comment. On 12月13日, 下午3時00分, Anil Sasidharan anil...@gmail.com wrote: Hi, You need to implement gps HAL to hook this data up into Android's LocationService JNI. Warm Regards, Anil On Mon, Dec 13, 2010 at 12:27 PM, nelsonchung chihchun.ch...@gmail.comwrote: I can read gps nmea from /dev/ttymxc1 under linux shell command mode like this - cat /dev/ttymxc1. But, I want to know how/where to set in order to let AP level application - LocationManager can get gps nmea via JNI/Android. How/Where should I set? Should I implement some codes followed gps.h? Or Can I redirect the nmea from /dev/ttymxc1 to somewhere? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.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
Re: [android-developers] Re: How to go to Home screen..?
Thanks Pent, It's working fine. Thanks a lot. On Fri, Dec 24, 2010 at 2:32 PM, Pent tas...@dinglisch.net wrote: Intent homeIntent = new Intent( Intent.ACTION_MAIN ); homeIntent.addCategory( Intent.CATEGORY_HOME ); Pent On Dec 24, 7:51 am, Abhilash baddam abhilash.androiddevelo...@gmail.com wrote: Hi friends, When the user clicks on a button, I want to navigate the screen into Home Screen. How can we achieve this. Regards, Abhilash -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] zoomSupported = false for android camera zooming.
Hi!11 i have camera ,which i have opened well , but onzoomclicklistener its giving error that 12-24 15:00:29.511: ERROR/AndroidRuntime(12320): java.lang.IllegalArgumentException: invalid zoom value=1 i have printed in log about the zoom supoort and its printing the log 12-24 15:00:26.961: DEBUG/zoom support(12320): zoomSupported = false please suggest me... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Database Remote Access
On 23 Dic, 23:48, kennedyximenes kennedy.xime...@gmail.com wrote: Hi, I am developing an Android App and I need to connect to read and retrieve data from a remote database. On the one side I have a SQL Server Database and on the other side I have my Android application. I would like a tutorial or a practical example describing all processes and how to do that. Thank you for any help. I don't have any tutorial, but this is a quite common asked question. The best practice seems to be to put some webservice(ish) stuff between your android app and the dbms, and expose an interface to do whatever you want to do with the dbms. Hope this helps, Federico -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: GK:How to set the FOCUS to my activity or listview
Hi Kindly some one add-on some suggestion for my query. thanks. ganesh r. On Dec 24, 1:46 pm, Ganesh Kumar R. ganesh...@gmail.com wrote: Hi all., Am facing one problem on my application. After i selected the contact it will show contact details.There i need by default my listview should be focued. Tried with requestFocus(). it failed. How can i achieve this ?? Many tnx in advance.., br., Ganesh R. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] loading xml items to an array not working... what is wrong with my code?
Hi, I have a xml file call groups.xml. I want to read the value name and store in array lv_arrr and load it into an adapter: lv1.setAdapter(new ArrayAdapterString(this, R.layout.group_list, R.id.grouplist, lv_arrr)); The program crash during runtime. What did I do wrong in the code can anyone help to take a look? Many thanks. ---/res/xml/groups.xml--- ?xml version=1.0 encoding=utf-8? !-- This is a mock score XML chunk -- groups group name=Apple / group name=Orange / group name=Pineapple / /groups --- public class Manual extends Activity { private ListView lv1; private String lv_arrr[]; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.manual); XmlResourceParser allGroups = getResources().getXml(R.xml.groups); try { processGroups(allGroups); } catch (Exception e) { //Log.e(DEBUG_TAG, Failed to load malls, e); } lv1=(ListView)findViewById(R.id.myListView); lv1.setAdapter(new ArrayAdapterString(this, R.layout.group_list, R.id.grouplist, lv_arrr)); lv1.setTextFilterEnabled(true); lv1.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView? a, View v, int position, long id) { AlertDialog.Builder adb=new AlertDialog.Builder(Manual.this); adb.setTitle(LVSelectedItemExample); adb.setMessage(Selected Item is = +lv1.getItemAtPosition(position)); adb.setPositiveButton(Ok, null); adb.show(); } }); } private void processGroups(XmlResourceParser groups) throws XmlPullParserException, IOException { int eventType = -1; // Find Score records from XML while (eventType != XmlResourceParser.END_DOCUMENT) { if (eventType == XmlResourceParser.START_TAG) { // Get the name of the tag (eg scores or score) String strName = groups.getName(); if (strName.equals(group)) { String Name = groups.getAttributeValue(null, name); lv_arrr[eventType] = Name; } } eventType = groups.next(); } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: How to go to Home screen..?
Hi pent, I am getting problem while using that. My problem is suppose i have 3 activities in my application.. for example i am in second activity in that activity i have one button when the user clicks on that activity i used ur code what u have sent. then the user is going to home screen upto now it's working fine. But when again i run this application it's starts from that second activity where i terminated application to home screen. What may be the problem. Regards, Abhilash On Fri, Dec 24, 2010 at 2:42 PM, Abhilash baddam abhilash.androiddevelo...@gmail.com wrote: Thanks Pent, It's working fine. Thanks a lot. On Fri, Dec 24, 2010 at 2:32 PM, Pent tas...@dinglisch.net wrote: Intent homeIntent = new Intent( Intent.ACTION_MAIN ); homeIntent.addCategory( Intent.CATEGORY_HOME ); Pent On Dec 24, 7:51 am, Abhilash baddam abhilash.androiddevelo...@gmail.com wrote: Hi friends, When the user clicks on a button, I want to navigate the screen into Home Screen. How can we achieve this. Regards, Abhilash -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to go to Home screen..?
That's the normal behaviour when you press the home key. To change it, you need to look at the flags set in your manifest for your various activities: http://developer.android.com/guide/topics/manifest/activity-element.html And possibly the flags you set when you launch those activities: http://developer.android.com/reference/android/content/Intent.html I can't give you specific instructions because I always end up fiddling for ages to get the right combination myself :-) Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: android bluetooth
You are welcome. Now as for your handset beep: there is no API in the android.bluetooth packet for generating the headset beep on a remote device. The best you can hope for is that the headset manufacturer publishes a protocol for setting this using the RFCOMM a.k.a. SPP link to the device. But I have never seen a Bluetooth headset that does this. But you should also look at https://sites.google.com/a/android.com/opensource/projects/bluetooth-faq On Dec 23, 9:51 pm, Jags jag...@gmail.com wrote: Thanks a ton IV, I am happy as long as I get some relevant solution :) . 1. Beep, means I did not mean default handset beep. I meant in my custom application i play a sound. if my hedset is paired when i am playing the sound in my custom application using Mediaplayer class, will it be heard in my headset ? 2. will i be able to capture volume up/down key press in the headset in my application ? if yes how ? regards On Dec 24, 5:53 am, Indicator Veritatis mej1...@yahoo.com wrote: Yes, that is right. You did not get your point across properly. You are doing better in this post, though, despite the disappointing typo of '[oint' for 'point'. But if you do know that the beep is at headsets[sic] control, why you even asking where it is? That makes no sense. The truth of the matter is that the Bluetooth spec does not mandate the beep. The implementer may chose to do it in the headset software, as it is the only choice that makes sense: otherwise the user gets no audio feedback to know that pairing just happened. The only feedback that the Android application gets is that now the headset is listed in the list of bound devices returned by getBondedDevices(). That is, you can sense when the headset was paired by polling getBondedDevices(), but you cannot cause the beep, nor can you sense when the headset does its own beep. You can only rely on what the headset manufacturer chose to implement in their own Bluetooth code. On Dec 22, 9:52 pm,Jagsjag...@gmail.com wrote: thanks IV, I guess i could not put my [oint across properly. Beep is at headsets control, i know. Now when the headset is paired, and my custom application plays a beep, does it automatically beep in the headset or in the handset ? if it automatically beeps in the headset, good, if not what can i do in my custom app to make the beep heard in the headset ? more to that i also need to capture some keypress volume up and down from the headset in my application will I be able to do that in my application ? how ? documentation is not clear on this ! thanks and regards Jagat On Dec 17, 10:57 am, Indicator Veritatis mej1...@yahoo.com wrote: I don't know why this thread is getting spam, but I can offer a guess why you are not getting answers. Your questions seems to strongly imply you have not studied the basics of how to do Bluetooth (whether on Android or not). Specifically, the beep you are interested in controlling is under the headset's control: it is NOT controllable from Android. Nor should it be, so don't wait for it to be added in a future version. On Dec 16, 1:21 am,Jagsjag...@gmail.com wrote: is this message a spam ? Nobody is able to see my message or what ? dont get answers, only get spams posted in the forum ! On Dec 16, 11:03 am, hanika han...@securitywall.in wrote: hi Thanks Regards, cid:image002@01CA2AEF.10F60770 Vijay Patel Test Engineer Elitecore Technologies Ltd. 904, Silicon tower, off C.G Road, Ahmedabad-380 006 Gujarat (INDIA), Tel: +91-79-66065606 | HYPERLINK mailto:vijay.pa...@elitecore.comvijay.pa...@elitecore.com HYPERLINK http://www.cyberoam.comwww.cyberoam.com P Please do not print this email unless it is absolutely necessary. Spread environmental awareness. image001.jpg 2KViewDownload -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: How to go to Home screen..?
Any help On Fri, Dec 24, 2010 at 3:48 PM, Pent tas...@dinglisch.net wrote: That's the normal behaviour when you press the home key. To change it, you need to look at the flags set in your manifest for your various activities: http://developer.android.com/guide/topics/manifest/activity-element.html And possibly the flags you set when you launch those activities: http://developer.android.com/reference/android/content/Intent.html I can't give you specific instructions because I always end up fiddling for ages to get the right combination myself :-) Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android - InputStream SQLiteDatabase - How to read more than one xml file
I'have this code public class DatabaseHelper extends SQLiteOpenHelper { public static final String DATABASE_NAME = prova; protected Context context; public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, 1); this.context = context; } @Override public void onCreate(SQLiteDatabase db) { String s; try { Toast.makeText(context, 1, 2000).show(); InputStream in = context.getResources().openRawResource(R.raw.mysql); DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(in, null); NodeList statements = doc.getElementsByTagName(st); for (int i=0; ist.getLength(); i++) { s = st.item(i).getChildNodes().item(0).getNodeValue(); db.execSQL(s); } } catch (Throwable t) { Toast.makeText(context, t.toString(), 5).show(); } } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL(DROP TABLE IF EXISTS employees); onCreate(db); } } This class read myxml file and executes sql instruction that are in the statements . Because the XML file is about 4MB I'have to split it in three or four files, but I don't know how to modify the code to do this. Thanks for any suggestion. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to go to Home screen..?
Well this one seems promising: android:finishOnTaskLaunch Whether or not an existing instance of the activity should be shut down (finished) whenever the user again launches its task (chooses the task on the home screen) — true if it should be shut down, and false if not. The default value is false. ... Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: loading xml items to an array not working... what is wrong with my code?
I think it is something to do with this. --- if (strName.equals(group)) { String Name = groups.getAttributeValue(null, name); lv_arrr[eventType] = Name; --- When I check, Name did contain the correct value. I remember array starts with [0] so I create another counter call i with i++ to replace lv_arrr[i] = Name; Somehow lv_arrr still contain null. Why is that so? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to detect when bluetooth is turned on by user?
Please read http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html and notice that getDefaultAdapter() returns a real Adapter only if Bluetooth support exists. If Bluetooth support exists, but is turned off, then getState() returns STATE_OFF. At least that is the way it is supposed to work: I have vague memories of getDefaultAdapter() returning null when the adapter was turned off on my T-mobile G2. But I can't vouch for that, and am not taking out the time to test for it now. There is a broadcast action you can wait for: ACTION_STATE_CHANGED. Wait for this and then check to see what it changed to: on or off. On Dec 23, 11:15 am, martien huijsmans martien.huijsm...@gmail.com wrote: Hi, I have a implemented a Android service which start a Bluetooth server. This is based on the example Connecting as a server as found onhttp://developer.android.com/guide/topics/wireless/bluetooth.html. How can I detect if Bluetooth if is turned on by the user? Is there a notification in Adroid that my service can subscribe to? In my current implementation I periodically poll the BluetoothAdapter as shown below itsBTAdapter.isEnabled(). Regards Martien -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Intent filter question
Hello, Is it possible to act on specific data in an intent? (Say, if a URL matches a regular expression.) I am able to trigger my application when someone clicks on a URL, but I don't want the app to be in the browseable list unless a URL matches a regular expression, say. Any pointers? Kind regards, Tor -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: How to go to Home screen..?
Means I have to change in manifest file ? i have to add android:finishOnTaskLaunch=true in manifest file? if u dont mind can u explain me clearly On Fri, Dec 24, 2010 at 4:10 PM, Pent tas...@dinglisch.net wrote: Well this one seems promising: android:finishOnTaskLaunch Whether or not an existing instance of the activity should be shut down (finished) whenever the user again launches its task (chooses the task on the home screen) — true if it should be shut down, and false if not. The default value is false. ... Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Outgoing call states
Hi, Is it any additional listeners to listen call state such as BUSY, NO_ANSWER, I just have only CALL_STATE_IDLE, CALL_STATE_OFFHOOK? I have an app that calls the special service numbers, if one of them is busy or no answer is need to try another one. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to go to Home screen..?
Means I have to change in manifest file ? i have to add android:finishOnTaskLaunch=true in manifest file? if u dont mind can u explain me clearly Yes, under each activity that you want to behave like that. Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Intent filter question
On Dec 24, 11:25 am, Tor tor.hough...@gmail.com wrote: Hello, Is it possible to act on specific data in an intent? (Say, if a URL matches a regular expression.) I am able to trigger my application when someone clicks on a URL, but I don't want the app to be in the browseable list unless a URL matches a regular expression, say. Any pointers? Intent matching is described here: http://developer.android.com/reference/android/content/IntentFilter.html I think this one from my manifest only matches paths ending in .prf.xml. intent-filter action android:name=android.intent.action.VIEW/ category android:name=android.intent.category.DEFAULT / category android:name=android.intent.category.BROWSABLE / data android:scheme=http android:host=* android:pathPattern=.* \\.prf\\.xml / /intent-filter Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Database storage filling and securing
Hi, I have large amount of data that I should query and display to user. What are recommended strategies for: 1) filling database (I would like to do it outside phone and just provided it somehow) 2) secure database so it isn't readable unless you are using app Thanks. -- God is Real, unless declared Integer. J. Allan Toogood, FORTRAN programmer -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Outgoing call states
Hi, Is it any additional listeners to listen call state such as BUSY, NO_ANSWER, I just have only CALL_STATE_IDLE, CALL_STATE_OFFHOOK? There's RINGING too :-) Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Outgoing call states
Yes :), but I wrote what I catch. On 24 Грд, 14:33, Pent tas...@dinglisch.net wrote: Hi, Is it any additional listeners to listen call state such as BUSY, NO_ANSWER, I just have only CALL_STATE_IDLE, CALL_STATE_OFFHOOK? There's RINGING too :-) Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Android - InputStream SQLiteDatabase - How to read more than one xml file
use transactions, it will be much faster On Fri, Dec 24, 2010 at 5:39 AM, giuseppe giuma...@gmail.com wrote: I'have this code public class DatabaseHelper extends SQLiteOpenHelper { public static final String DATABASE_NAME = prova; protected Context context; public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, 1); this.context = context; } �...@override public void onCreate(SQLiteDatabase db) { String s; try { Toast.makeText(context, 1, 2000).show(); InputStream in = context.getResources().openRawResource(R.raw.mysql); DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(in, null); NodeList statements = doc.getElementsByTagName(st); for (int i=0; ist.getLength(); i++) { s = st.item(i).getChildNodes().item(0).getNodeValue(); db.execSQL(s); } } catch (Throwable t) { Toast.makeText(context, t.toString(), 5).show(); } } �...@override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL(DROP TABLE IF EXISTS employees); onCreate(db); } } This class read myxml file and executes sql instruction that are in the statements . Because the XML file is about 4MB I'have to split it in three or four files, but I don't know how to modify the code to do this. Thanks for any suggestion. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Problem with password based encryption of image files
Hi, I'm trying to encrypt image files on Android with password based encryption. To save the encrypted image I just do this: FileOutputStream fos = new FileOutputStream(thumbnailFile); CipherOutputStream cos = new CipherOutputStream(fos, encryptCipher); Bitmap thumbnail = Bitmap.createScaledBitmap(bm2, 140, 140, true); thumbnail.compress(Bitmap.CompressFormat.JPEG, 80, cos); and to read it, this: FileInputStream fis = new FileInputStream(f); CipherInputStream cis = new CipherInputStream(fis, decryptCipher); Bitmap b = BitmapFactory.decodeStream(cis); but the Bitmap ends up as null. The code works when I bypass the encryption; that is when I use the File(Input|Output)Streams rather than the Cipher(Input|Output)streams. My Ciphers are created as follows: public void initCiphers(char password[]) { PBEKeySpec pbeKeySpec; PBEParameterSpec pbeParamSpec; SecretKeyFactory keyFac; byte[] salt = { (byte)0xc7, (byte)0x73, (byte)0x21, (byte)0x8c, (byte)0x7e, (byte)0xc8, (byte)0xee, (byte)0x99 }; int count = 20; pbeParamSpec = new PBEParameterSpec(salt, count); pbeKeySpec = new PBEKeySpec(password); try { keyFac = SecretKeyFactory.getInstance(PBEWithMD5AndDES); SecretKey pbeKey = keyFac.generateSecret(pbeKeySpec); encryptCipher = Cipher.getInstance(PBEWithMD5AndDES); decryptCipher = Cipher.getInstance(PBEWithMD5AndDES); encryptCipher.init(Cipher.ENCRYPT_MODE, pbeKey, pbeParamSpec); decryptCipher.init(Cipher.DECRYPT_MODE, pbeKey, pbeParamSpec); } catch (Exception e) { Log.v(tag, e.toString()); } } I don't get any exceptions. There is obviously some problem with using Cipher(Output|Input)Streams with the android functions for encoding and/or decoding images, but since those functions are opaque and there are no exceptions, its hard to know what it is. I suspect it has to do with padding or flushing. Any assistance would be gratefully appreciated. Matthew Fleming, MD DermVision, LLC -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: c2DM error when third-party server sends data to push
Can someone knowledgable with C2DM help me resolve this issue please. Thanks Nagaraj On Thu, Dec 23, 2010 at 10:20 AM, nagaraj nraj.tes...@gmail.com wrote: I am trying to push data from my server hosting a webservice but I get the following error: htmlhead meta http-equiv=content-type content=text/html;charset=utf-8 title411 Length Required/title style!-- body {font-family: arial,sans-serif} div.nav {margin-top: 1ex} div.nav A {font-size: 10pt; font-family: arial,sans-serif} span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight: bold} div.nav A,span.big {font-size: 12pt; color: #cc} div.nav A {font-size: 10pt; color: black} A.l:link {color: #6f6f6f} A.u:link {color: green} //--/style script!-- var rc=411; //-- /script /head body text=#00 bgcolor=#ff table border=0 cellpadding=2 cellspacing=0 width=100%trtd rowspan=3 width=1% nowrap bfont face=times color=#0039b6 size=10G/fontfont face=times color=#c41200 size=10o/fontfont face=times color=#f3c518 size=10o/fontfont face=times color=#0039b6 size=10g/fontfont face=times color=#30a72f size=10l/fontfont face=times color=#c41200 size=10e/fontnbsp;nbsp;/b tdnbsp;/td/tr trtd bgcolor=#3366ccfont face=arial,sans-serif color=#ffbError/b/td/tr trtdnbsp;/td/tr/table blockquote H1Length Required/H1 POST requests require a codeContent-length/code header. p /blockquote table width=100% cellpadding=0 cellspacing=0trtd bgcolor=#3366ccimg alt= width=1 height=4/td/tr/table /body/html Here is the java code that posts message to google c2dm which inturn will send a push notification to the device: private void postData(String auth, String id, String data) { DefaultHttpClient client = new DefaultHttpClient(); HttpPost httppost = new HttpPost( https://android.apis.google.com/c2dm/send;); ListNameValuePair formparams = new ArrayListNameValuePair(); formparams.add(new BasicNameValuePair(registration_id, id)); formparams.add(new BasicNameValuePair(data.payload, data)); formparams.add(new BasicNameValuePair(collapse_key, something)); //formparams.add(new BasicNameValuePair(Content-length, +data.length())); if (null != id) { formparams.add(new BasicNameValuePair(id, id)); } UrlEncodedFormEntity entity = null; try { entity = new UrlEncodedFormEntity(formparams, UTF-8); } catch (UnsupportedEncodingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } httppost.setEntity(entity); Header header = new BasicHeader(Authorization: GoogleLogin auth=, auth); Header header2 = new BasicHeader(Content-length=, +data.length()); httppost.addHeader(header); httppost.addHeader(header2); httppost.getParams().setParameter(Content-length:, +data.length()); HttpContext localContext = new BasicHttpContext(); HttpResponse response = null; try { response = client.execute(httppost, localContext); HttpEntity entity2 = response.getEntity(); System.out.println(); System.out.println(response.getStatusLine()); Header[] headers = response.getAllHeaders(); for (int i = 0; i headers.length; i++) { System.out.println(headers[i]); } System.out.println(); if (response.getEntity() != null) { System.out.println(EntityUtils.toString(response.getEntity())); } } catch (Exception e) { System.err.println(e); } finally { } } Note: 1. I successfully got the registration id from the client (device) 2. I successfully get the Auth from an earlier post on the server side Any help will be greatly appreciated Thank you -Nagaraj -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 with password based encryption of image files
Also -- if I use NullCipher as the encyption and decription ciphers for Cipher(Output|Input)Stream, it works. Here's a theory: since PBEWithMD5AndDES uses CBC mode with PKCS5Padding, it could be that Bitmap.compress is flushing its OutputStream where it should not -- which would be at any point prior to closing the stream. Ordinarily this would not create a problem, but with a CipherOutputStream using a padding cipher, it would cause extra padding bytes to be inserted in the output. I supposed I could try to find the the source code for Bitmap.compress, to see if this is in fact what is happening ... Matthew Fleming On Dec 24, 7:36 am, Matthew Fleming mgf...@gmail.com wrote: Hi, I'm trying to encrypt image files on Android with password based encryption. To save the encrypted image I just do this: FileOutputStream fos = new FileOutputStream(thumbnailFile); CipherOutputStream cos = new CipherOutputStream(fos, encryptCipher); Bitmap thumbnail = Bitmap.createScaledBitmap(bm2, 140, 140, true); thumbnail.compress(Bitmap.CompressFormat.JPEG, 80, cos); and to read it, this: FileInputStream fis = new FileInputStream(f); CipherInputStream cis = new CipherInputStream(fis, decryptCipher); Bitmap b = BitmapFactory.decodeStream(cis); but the Bitmap ends up as null. The code works when I bypass the encryption; that is when I use the File(Input|Output)Streams rather than the Cipher(Input|Output)streams. My Ciphers are created as follows: public void initCiphers(char password[]) { PBEKeySpec pbeKeySpec; PBEParameterSpec pbeParamSpec; SecretKeyFactory keyFac; byte[] salt = { (byte)0xc7, (byte)0x73, (byte)0x21, (byte)0x8c, (byte)0x7e, (byte)0xc8, (byte)0xee, (byte)0x99 }; int count = 20; pbeParamSpec = new PBEParameterSpec(salt, count); pbeKeySpec = new PBEKeySpec(password); try { keyFac = SecretKeyFactory.getInstance(PBEWithMD5AndDES); SecretKey pbeKey = keyFac.generateSecret(pbeKeySpec); encryptCipher = Cipher.getInstance(PBEWithMD5AndDES); decryptCipher = Cipher.getInstance(PBEWithMD5AndDES); encryptCipher.init(Cipher.ENCRYPT_MODE, pbeKey, pbeParamSpec); decryptCipher.init(Cipher.DECRYPT_MODE, pbeKey, pbeParamSpec); } catch (Exception e) { Log.v(tag, e.toString()); } } I don't get any exceptions. There is obviously some problem with using Cipher(Output|Input)Streams with the android functions for encoding and/or decoding images, but since those functions are opaque and there are no exceptions, its hard to know what it is. I suspect it has to do with padding or flushing. Any assistance would be gratefully appreciated. Matthew Fleming, MD DermVision, LLC -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 - InputStream SQLiteDatabase - How to read more than one xml file
Thank You for the answer. I'm new in android so can you explain to me with an example and some code? Thanks On 24 Dic, 14:15, Agus agus.sant...@gmail.com wrote: use transactions, it will be much faster On Fri, Dec 24, 2010 at 5:39 AM, giuseppe giuma...@gmail.com wrote: I'have this code public class DatabaseHelper extends SQLiteOpenHelper { public static final String DATABASE_NAME = prova; protected Context context; public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, 1); this.context = context; } �...@override public void onCreate(SQLiteDatabase db) { String s; try { Toast.makeText(context, 1, 2000).show(); InputStream in = context.getResources().openRawResource(R.raw.mysql); DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(in, null); NodeList statements = doc.getElementsByTagName(st); for (int i=0; ist.getLength(); i++) { s = st.item(i).getChildNodes().item(0).getNodeValue(); db.execSQL(s); } } catch (Throwable t) { Toast.makeText(context, t.toString(), 5).show(); } } �...@override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL(DROP TABLE IF EXISTS employees); onCreate(db); } } This class read myxml file and executes sql instruction that are in the statements . Because the XML file is about 4MB I'have to split it in three or four files, but I don't know how to modify the code to do this. Thanks for any suggestion. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Fill-remainder layout?
I'm used to Java Swing layout managers (especially GridBagLayout), and I haven't been able to figure out to do something relatively simple with the Android layouts. I want to have a bar of controls at the top, and another bar of controls at the bottom. Then I want to have an area in the middle that uses whatever space is left over. (mainly for graphics drawing) I'm currently using a RelativeLayout with 2 Linear layouts for the top and bottom. I just haven't been able to find a combination of layouts that lets me have a view just fill the middle remainder area. I'm trying to start with a simple background color on a view in this area. if I use wrap_content it's way too small. If I use fill_parent it fills the ENTIRE parent, including the areas used by the 2 bars of controls. How do I define something to just fill the remaining space in the middle? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Fill-remainder layout?
layout_weight=1.0 will cause the view to fill any remaining space. If the view in the middle might be bigger than the available space it will push the bottom row off however. There's a solution for that. Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android - InputStream SQLiteDatabase - How to read more than one xml file
If you're doing this to load up the DB, it's simpler/faster to just include the pre-built DB in your app and then copy it to the right place once installed. (Be sure to name it .jpg or some such if larger than 1M to avoid the compression mess.) On Dec 24, 4:39 am, giuseppe giuma...@gmail.com wrote: I'have this code public class DatabaseHelper extends SQLiteOpenHelper { public static final String DATABASE_NAME = prova; protected Context context; public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, 1); this.context = context; } @Override public void onCreate(SQLiteDatabase db) { String s; try { Toast.makeText(context, 1, 2000).show(); InputStream in = context.getResources().openRawResource(R.raw.mysql); DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(in, null); NodeList statements = doc.getElementsByTagName(st); for (int i=0; ist.getLength(); i++) { s = st.item(i).getChildNodes().item(0).getNodeValue(); db.execSQL(s); } } catch (Throwable t) { Toast.makeText(context, t.toString(), 5).show(); } } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL(DROP TABLE IF EXISTS employees); onCreate(db); } } This class read myxml file and executes sql instruction that are in the statements . Because the XML file is about 4MB I'have to split it in three or four files, but I don't know how to modify the code to do this. Thanks for any suggestion. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Fill-remainder layout?
Here is a couple ways: 1 - RelativeLayout: RelativeLayout fill_parent, fill_parent LinearLayout id=@+id/top_bar layout_height=wrap_content *layout_alignParentTop=true* ... / LinearLayout id=@+id/bottom_bar layout_height=wrap_content *layout_alignParentBottom=true* ... / MiddleView layout_height=doesn't matter *layout_below=@id/top_bar layout_above=@id/bottom_bar* ... / /RelativeLayout 2 - LinearLayout LinearLayout fill_parent, fill_parent, vertical LinearLayout id=@+id/top_bar layout_height=wrap_content ** ... / MiddleView ***layout_**height=wrap_content layout_weight=1* ... / LinearLayout id=@+id/bottom_bar layout_height=wrap_content ** ... / /LinearLayout -- Kostya 24.12.2010 19:34, John Lussmyer ?: I'm used to Java Swing layout managers (especially GridBagLayout), and I haven't been able to figure out to do something relatively simple with the Android layouts. I want to have a bar of controls at the top, and another bar of controls at the bottom. Then I want to have an area in the middle that uses whatever space is left over. (mainly for graphics drawing) I'm currently using a RelativeLayout with 2 Linear layouts for the top and bottom. I just haven't been able to find a combination of layouts that lets me have a view just fill the middle remainder area. I'm trying to start with a simple background color on a view in this area. if I use wrap_content it's way too small. If I use fill_parent it fills the ENTIRE parent, including the areas used by the 2 bars of controls. How do I define something to just fill the remaining space in the middle? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Fill-remainder layout?
24.12.2010 19:49, Pent пишет: If the view in the middle might be bigger than the available space it will push the bottom row off however. There's a solution for that. This case can be correctly handled by using a RelativeLayout, as I just described in my other message. -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Image doesn't appear from sqlite
What's varying? The data won't be read back into the same address, but into a new byte array, and [...@ is just a byte array at a certain address. Dump a few bytes of the arrays (eg, first and last 10) so you can compare their contents. On Dec 22, 4:46 pm, Amiral 4mi...@gmail.com wrote: Hi all. I would like to save an image from Internet to database, I've tried to convert images into bytearray and store them in a database. Here my code: this is to created table: myDB.execSQL(CREATE TABLE IF NOT EXISTS News (Title VARCHAR(20), imageUrl BLOB, publishDate TIMESTAMP, expiredDate TIMESTAMP);); and this is my Method to Insert table: public void insertlistNews(String city,byte[] newsImageUrl, String publishDate, String expiredDate){ try { myDB.execSQL(INSERT INTO News (title,imageUrl,publishDate,expiredDate) + VALUES (' + city + ',' + imageUrl + ',' + publishDate+ ',' + expiredDate');); Log.i(Android, Table created);} catch (Exception e) { Log.i(Android, No Table created + e.getMessage()); } //for check bytearray in database Log.i(Android, Image saved in database: + urlFrontImage); } The last my method for getNews from db: public ArrayList getAllNews() { ArrayList news = new ArrayListNews(); Cursor c = myDB.rawQuery(SELECT title,imageUrl,publishDate,expiredDate FROM News WHERE publishedDate = DATETIME() and expiredDate = DATETIME() ORDER BY publishedDate DESC;, null); if (c != null) { c.moveToFirst(); int count = 0; while (c.moveToNext()) { if (count == 0) c.moveToFirst(); String title = c.getString(0); byte[] image = c.getBlob(1); String publishDate = c.getString(2); String expiredDate = c.getString(3); NewsItem nl = new NewsItem(title, image, publishDate, expiredDate); Log.i(Android, Image get from db: +image); news.add(nl); count++; } } return news; } when I run it the newsimage not appear and the Log like this: 12-22 00:11:49.362: INFO/Android(307): Image saved in database: [...@437cbdb8 12-22 00:11:51.052: INFO/Android(307): Image saved in database: [...@437db710 12-22 00:11:51.862: INFO/Android(307): Image saved in database: [...@437c1338 12-22 00:12:07.962: INFO/Android(307): Image get from db: [...@4382d370 12-22 00:12:07.982: INFO/Android(307): Image get from db db: [...@4382d9c0 12-22 00:12:07.992: INFO/Android(307): Image get from db: [...@4382e0e0 why results can vary between insert and getNews? -- Best Regards = Amiral -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Cannot define a float as a resource?
You could always use floatToIntBits/intBitsToFloat. But keep in mind that the resources are actually char data anyway, and you might as well just use parseFloat on a String (though then you have to catch NumberFormatException). On Dec 23, 1:33 am, Zsolt Vasvari zvasv...@gmail.com wrote: Thanks, Dianne. I am now just retrieving an int from 0 - 100 and divide it by 100 and set it as the weight. It works fine, but it's just extra code and I am lazy person, which is why I asked. :) On a related question: I am defining the width of my pop-up window as 500dp, this fits nicely into my HDPI screen on my Nexus One (480x800), but the same 500dp on an MDPI device (320x480) is wider than the screen and I need to set the width to 460dp. I would have thought using DIP as the unit of measure would deal with this. Thanks, Tom On Dec 23, 9:41 am, Dianne Hackborn hack...@android.com wrote: Oh also you can just do a percentage dimension (50%) and retrieve it with a base value of 1 or 100 as desired. On Wed, Dec 22, 2010 at 5:40 PM, Dianne Hackborn hack...@android.comwrote: You can use them as attributes, but unfortunately right now there is no way to get them as direct resources. Well you can probably do it by being tricky -- use item to define a raw resource, and Resources.getValue() to retrieve its value. (One reason why this doesn't exist is if it made entries in R. for float values it would create code that can't compile since float is a keyboard. :p I solved that with ints by calling them integers, and booleans by calling them bools, but we never really needed floats so I never tried to come up with something to call them.) On Wed, Dec 22, 2010 at 5:04 PM, Zsolt Vasvari zvasv...@gmail.com wrote: Am I missing something or there is no mechanism to define a float value as a resource? I am trying to have a locale dependent weight added to some of my buttons. Right now, as a workaround, I am defining the weight as an Integer and then divide and manualy set it. But why would there be such a seemingly arbitrary decision made as not to allow floats but allow ints? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them.- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Image does't appear from sqlite
The addresses vary because they're different objects. You need to dump some of the actual byte arrays to see if they're different. You could even write code to compare input and output. On Dec 21, 6:40 pm, Muhammad Amiral 4mi...@gmail.com wrote: Hi all. I would like to save an image from Internet to database, I've tried to convert images into bytearray and store them in a database. Here my code: this is to created table: myDB.execSQL(CREATE TABLE IF NOT EXISTS News (Title VARCHAR(20), imageUrl BLOB, publishDate TIMESTAMP, expiredDate TIMESTAMP);); and this is my Method to Insert table: public void insertlistNews(String city,byte[] newsImageUrl, String publishDate, String expiredDate){ try { myDB.execSQL(INSERT INTO News (title,imageUrl,publishDate,expiredDate) + VALUES (' + city + ',' + imageUrl + ',' + publishDate+ ',' + expiredDate');); Log.i(Android, Table created); } catch (Exception e) { Log.i(Android, No Table created + e.getMessage()); } //for check bytearray in database Log.i(Android, Image saved in database: + urlFrontImage); } The last my method for getNews from db: public ArrayList getAllNews() { ArrayList news = new ArrayListNews(); Cursor c = myDB.rawQuery(SELECT title,imageUrl,publishDate,expiredDate FROM News WHERE publishedDate = DATETIME() and expiredDate = DATETIME() ORDER BY publishedDate DESC;, null); if (c != null) { c.moveToFirst(); int count = 0; while (c.moveToNext()) { if (count == 0) c.moveToFirst(); String title = c.getString(0); byte[] image = c.getBlob(1); String publishDate = c.getString(2); String expiredDate = c.getString(3); NewsItem nl = new NewsItem(title, image, publishDate, expiredDate); Log.i(Android, Image get from db: +image); news.add(nl); count++; } } return news; } when I run it the newsimage not appear and the Log like this: 12-22 00:11:49.362: INFO/Android(307): Image saved in database: [...@437cbdb8 12-22 00:11:51.052: INFO/Android(307): Image saved in database: [...@437db710 12-22 00:11:51.862: INFO/Android(307): Image saved in database: [...@437c1338 12-22 00:12:07.962: INFO/Android(307): Image get from db: [...@4382d370 12-22 00:12:07.982: INFO/Android(307): Image get from db db: [...@4382d9c0 12-22 00:12:07.992: INFO/Android(307): Image get from db: [...@4382e0e0 why results can vary between the insert and getNews? -- Best Regards = Amiral -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Opera callbacks
Hi, I have an application that takes the user to a service provider's website to perform a login as part of an oauth process. Some users are having problems using Opera Mini. It seems like it can't handle the response call back scheme. Chrome works well so, I was wondering if it's possible to create an Intent which specifies Chrome. (or perhaps someone has come across this problem?) Regards, Julius. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: UnsupportedOperationException: glGenFramebuffersOES
Ok, but I can actually use GL20, thanks a lot for your help. On 23 Dic, 10:49, Igor Korobka igok...@gmail.com wrote: I'm not an expert in area of OpenGL on Android, but GLES11Ext. glGenFramebuffersOES(1,viewFramebuffer); doesn't work on NexusOne either. But the same action with the OpenGL ES 2.0 works just fine: gl20.glGenFramebuffers(1, bufferId); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Which JSON Parser is better
JSON is blazingly simple. You can write your own parser in a day using about 600 lines of code. (Another 300 lines of code and maybe 3 hours to write the encoder end.) It should be possible to examine the versions you're considering and see which appears to be more professionally written and better tuned to your needs. Storage requirements for any well-written parsers should be about the same. On Dec 23, 12:43 am, cool.manish mannishga...@gmail.com wrote: Hi All, I want to use some JSON parser in my application. I get to know about lots of available JSON parser like Android default org.json library, JSONTokenizer, gson, jackson etc. Is there any benifit of using gson rather than Android default parser? I am bit confused which one of them is better keeping in mind their usability and apk size. Regards, Manish -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to analyze native stack trace when application crashes ?
I don't know if exists tools for what are you talking about, but I meet these errors type when I use OpenGL,which is native (no Java) and I try to pass it an null pointer/object. Check there types of situation can be right for solve problems. I hope I helped you! pedr0 On 23 Dic, 11:37, Sly_bzh sl...@laposte.net wrote: I wonder how to debug when an application crash and that a native stack trace is reported in the logcat. Hereby some questions that could be useful for other developpers =) Q1 ; how do you analyze the native stack trace that is reported in the Logcat when application crashes ? Q2 : Do you know tools that perfectly works for this ? Q3 : How do you debug this kind of situation ? Thanks in advance for your answers. P.S. hereby an example of the stack trace I wanna to debug : 12-23 11:14:50.224: INFO/DEBUG(48): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 12-23 11:14:50.224: INFO/DEBUG(48): Build fingerprint: 'android- devphone1/dream_devphone/dream/trout:1.6/DRC83/14721:userdebug/ adp,test-keys' 12-23 11:14:50.224: INFO/DEBUG(48): pid: 3437, tid: 3437 com.example.myapplication 12-23 11:14:50.224: INFO/DEBUG(48): signal 11 (SIGSEGV), fault addr 98054b41 12-23 11:14:50.224: INFO/DEBUG(48): r0 r1 032c r2 98054b21 r3 460da230 12-23 11:14:50.224: INFO/DEBUG(48): r4 0003 r5 4000c238 r6 460e3000 r7 ad084aa8 12-23 11:14:50.224: INFO/DEBUG(48): r8 ad083e1c r9 a9d223d9 10 4000c238 fp ad083e1c 12-23 11:14:50.224: INFO/DEBUG(48): ip 4000c1e8 sp be9ae620 lr 0003 pc ad01622c cpsr 6010 12-23 11:14:50.384: INFO/DEBUG(48): #00 pc 0001622c /system/ lib/libdvm.so 12-23 11:14:50.384: INFO/DEBUG(48): #01 pc 00016cb4 /system/ lib/libdvm.so 12-23 11:14:50.394: INFO/DEBUG(48): #02 pc 000153e4 /system/ lib/libdvm.so 12-23 11:14:50.394: INFO/DEBUG(48): #03 pc 000483f4 /system/ lib/libdvm.so 12-23 11:14:50.394: INFO/DEBUG(48): #04 pc 000591b2 /system/ lib/libdvm.so 12-23 11:14:50.394: INFO/DEBUG(48): #05 pc 00013198 /system/ lib/libdvm.so 12-23 11:14:50.404: INFO/DEBUG(48): #06 pc 00017be4 /system/ lib/libdvm.so 12-23 11:14:50.404: INFO/DEBUG(48): #07 pc 0001762c /system/ lib/libdvm.so 12-23 11:14:50.404: INFO/DEBUG(48): #08 pc 000529a8 /system/ lib/libdvm.so 12-23 11:14:50.414: INFO/DEBUG(48): #09 pc 00059eda /system/ lib/libdvm.so 12-23 11:14:50.414: INFO/DEBUG(48): #10 pc 00013198 /system/ lib/libdvm.so 12-23 11:14:50.414: INFO/DEBUG(48): #11 pc 00017be4 /system/ lib/libdvm.so 12-23 11:14:50.424: INFO/DEBUG(48): #12 pc 0001762c /system/ lib/libdvm.so 12-23 11:14:50.424: INFO/DEBUG(48): #13 pc 0005282c /system/ lib/libdvm.so 12-23 11:14:50.424: INFO/DEBUG(48): #14 pc 0003f790 /system/ lib/libdvm.so 12-23 11:14:50.434: INFO/DEBUG(48): #15 pc 0002bdfc /system/ lib/libandroid_runtime.so 12-23 11:14:50.434: INFO/DEBUG(48): #16 pc 0002c8fe /system/ lib/libandroid_runtime.so 12-23 11:14:50.434: INFO/DEBUG(48): #17 pc 8bf2 /system/ bin/app_process 12-23 11:14:50.434: INFO/DEBUG(48): #18 pc bd60 /system/ lib/libc.so 12-23 11:14:50.444: INFO/DEBUG(48): #19 pc b000163c /system/ bin/linker 12-23 11:14:50.444: INFO/DEBUG(48): stack: 12-23 11:14:50.444: INFO/DEBUG(48): be9ae5e0 43738000 /dev/ ashmem/mspace/dalvik-heap/2 (deleted) 12-23 11:14:50.444: INFO/DEBUG(48): be9ae5e4 43737fff 12-23 11:14:50.444: INFO/DEBUG(48): be9ae5e8 45ea4000 /dev/ ashmem/dalvik-heap-markstack (deleted) 12-23 11:14:50.444: INFO/DEBUG(48): be9ae5ec 0002 12-23 11:14:50.444: INFO/DEBUG(48): be9ae5f0 be9ae5f8 [stack] 12-23 11:14:50.444: INFO/DEBUG(48): be9ae5f4 ad014930 /system/ lib/libdvm.so 12-23 11:14:50.444: INFO/DEBUG(48): be9ae5f8 0002 12-23 11:14:50.444: INFO/DEBUG(48): be9ae5fc 0001 12-23 11:14:50.444: INFO/DEBUG(48): be9ae600 12-23 11:14:50.454: INFO/DEBUG(48): be9ae604 00065e60 [heap] 12-23 11:14:50.454: INFO/DEBUG(48): be9ae608 12-23 11:14:50.454: INFO/DEBUG(48): be9ae60c ad038729 /system/ lib/libdvm.so 12-23 11:14:50.454: INFO/DEBUG(48): be9ae610 033c 12-23 11:14:50.454: INFO/DEBUG(48): be9ae614 be9ae610 [stack] 12-23 11:14:50.454: INFO/DEBUG(48): be9ae618 df002777 12-23 11:14:50.454: INFO/DEBUG(48): be9ae61c e3a070ad 12-23 11:14:50.454: INFO/DEBUG(48): #00 be9ae620 032c 12-23 11:14:50.454: INFO/DEBUG(48): be9ae624 98054b21 12-23 11:14:50.454: INFO/DEBUG(48): be9ae628 4000c238 /dev/ ashmem/mspace/dalvik-heap/zygote/0 (deleted) 12-23 11:14:50.454: INFO/DEBUG(48): be9ae62c 4000c1e8 /dev/ ashmem/mspace/dalvik-heap/zygote/0 (deleted) 12-23 11:14:50.454: INFO/DEBUG(48): be9ae630 4000c238 /dev/
Re: [android-developers] Re: Image doesn't appear from sqlite
+0.02 - this code: public void insertlistNews(String city,*byte[] newsImageUrl*, String publishDate, String expiredDate){ [snip] + VALUES (' + city + ',*' + imageUrl + '*,' + publishDate+ ',' + expiredDate');); appends a byte[] to a String. This is the same as appending String.valueOf(imageUri), which calls byte[].toString, which *does not* return the contents of the array, but rather its type marker and address - which does look like [...@437c1338 and so on. If you want to insert byte[] values into the database, use one of: - SQLiteStatement and bindBlob(int index, byte[] value) - DatabaseUtils.InsertHelper and bind(int index, byte[] value) - ContentValues, put(String key, byte[] value), and SQLiteDatabase.insert() If you mean to insert the URL as a string, make sure you use a String variable for the URL to build your SQL statement. Perhaps you are trying to do both (your code sample uses two different variable names: newsImageUrl and imageUrl), so do each one as described above. -- Kostya 24.12.2010 20:13, DanH ?: What's varying? The data won't be read back into the same address, but into a new byte array, and [...@ is just a byte array at a certain address. Dump a few bytes of the arrays (eg, first and last 10) so you can compare their contents. On Dec 22, 4:46 pm, Amiral4mi...@gmail.com wrote: Hi all. I would like to save an image from Internet to database, I've tried to convert images into bytearray and store them in a database. Here my code: this is to created table: myDB.execSQL(CREATE TABLE IF NOT EXISTS News (Title VARCHAR(20), imageUrl BLOB, publishDate TIMESTAMP, expiredDate TIMESTAMP);); and this is my Method to Insert table: public void insertlistNews(String city,byte[] newsImageUrl, String publishDate, String expiredDate){ try { myDB.execSQL(INSERT INTO News (title,imageUrl,publishDate,expiredDate) + VALUES (' + city + ',' + imageUrl + ',' + publishDate+ ',' + expiredDate');); Log.i(Android, Table created);} catch (Exception e) { Log.i(Android, No Table created + e.getMessage()); } //for check bytearray in database Log.i(Android, Image saved in database: + urlFrontImage); } The last my method for getNews from db: public ArrayList getAllNews() { ArrayList news = new ArrayListNews(); Cursor c = myDB.rawQuery(SELECT title,imageUrl,publishDate,expiredDate FROM News WHERE publishedDate= DATETIME() and expiredDate= DATETIME() ORDER BY publishedDate DESC;, null); if (c != null) { c.moveToFirst(); int count = 0; while (c.moveToNext()) { if (count == 0) c.moveToFirst(); String title = c.getString(0); byte[] image = c.getBlob(1); String publishDate = c.getString(2); String expiredDate = c.getString(3); NewsItem nl = new NewsItem(title, image, publishDate, expiredDate); Log.i(Android, Image get from db: +image); news.add(nl); count++; } } return news; } when I run it the newsimage not appear and the Log like this: 12-22 00:11:49.362: INFO/Android(307): Image saved in database: [...@437cbdb8 12-22 00:11:51.052: INFO/Android(307): Image saved in database: [...@437db710 12-22 00:11:51.862: INFO/Android(307): Image saved in database: [...@437c1338 12-22 00:12:07.962: INFO/Android(307): Image get from db: [...@4382d370 12-22 00:12:07.982: INFO/Android(307): Image get from db db: [...@4382d9c0 12-22 00:12:07.992: INFO/Android(307): Image get from db: [...@4382e0e0 why results can vary between insert and getNews? -- Best Regards = Amiral -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Split screen om android
Indeed, this is not the group for info about how to do this. However, before you go, I'd like you to minimize the set of changes you're thinking about. This group is about programming using the SDK, so I think it's appropriate to discuss what we SDK users would like to see. (Up to a point, anyway). While I'd like to see support for multiple windows, I'd also like to see it involve as few changes to the SDK, and be as upward-compatible for older programs, as possible. And, of course, I'd like the user usage model to be as natural for users as possible. Android already supports multiple activities being visible. The tricks I see needed are: 1) Launching an app using a particular window area. Somehow the home screen app needs a hook here, and you need a policy for when to launch activities into the other vs this by default. I think the default policy should be same app, same window, and that this should be overridable via a value in the intent. 2) Figuring out what the back button should mean here. I think you may only need a single activity stack here. Even if the user has been alternating between screen areas, it would just remove the most recent activity. The long-press Home key could be used to bring up activities in either window and give the user the ability to reorder and select which activities are shown simultaneously. The one enhancement here I'd suggest would be to show which screen portion they're currently displayed on -- and allow the user to drag them to the other side. 3) Applications need to be able to discover which area they are in, and what areas are available, and their geometric relationship. They need this to be able to be able to fill in the intent with the suggestion of where to launch, and they may need to know where they are in order to animate transitions appropriately. Or it may be able to automate that with a standard transition when one activity launches another that ends up in a different window area. In fact, it may be essential, when handling older apps, to suppress the animations supplied and supply something more suitable, as, say, a right-to-left slide out/slide-in, will look completely bizarre if the starting activity is on the left, and the ending activity is on the right (or worse, bottom-left, top-right). On Dec 23, 7:17 pm, TreKing treking...@gmail.com wrote: On Wed, Dec 22, 2010 at 6:14 AM, irulz vinay@gmail.com wrote: I will really appreciate any input on this. Is thr anything I am missing ? Try the porting or platform groups for questions regarding modifying the source. --- -- 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] Recycling MotionEvents
Hi there. Have a custom gesture class that detects 'buildup' gestures for a drawing program. In the class, I test the current MotionEvent and in ACTION_MOVE, set a private field mCurEvent to the current event, process it and then set a private mPrevEvent to the same event so that on the next ACTION_MOVE, I can compare the current and previous events to determine distance moved, etc. Example: switch (ev.getAction()) { case MotionEvent.ACTION_MOVE: mCurEvent = MotionEvent.obtainNoHistory(ev); if (mPrevEvent != null) { compare the two events } mPrevEvent = MotionEvent.obtainNoHistory(ev); break; Everything works fine, until I start trying to clean up the code and .recycle() MotionEvents on ACTION_UP, ACTION_CANCEL. Recycling the current and previous event frees up resources, but on the next touchdown and move, mCurEvent and mPrevEvent are being allocated to the exact same object address space, meaning that setting mCurEvent = MotionEvent.obtainNoHistory(ev); is also setting the mPrevEvent variable that shares that points to the same object... I'd like to recycle the events as there could be MANY created with lots of ACTION_MOVE events... but doing so seems to have these results. Any strategies or recommendations? Thanks, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Fill-remainder layout?
Thanks, I did finally get it done with a relative layout. The only problem I ran into was making sure there were no forward references in the id's. (Which is why your example had the middle layout at the bottom.) I was just trying to modify my existing layout, and it had the middle in the middle! :-) I had to move it to the bottom of the file so it could reference the bottom panel in it's layout_above entry. On Fri, Dec 24, 2010 at 9:06 AM, Kostya Vasilyev kmans...@gmail.com wrote: 24.12.2010 19:49, Pent пишет: If the view in the middle might be bigger than the available space it will push the bottom row off however. There's a solution for that. This case can be correctly handled by using a RelativeLayout, as I just described in my other message. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: loading xml items to an array not working... what is wrong with my code?
On Fri, Dec 24, 2010 at 4:44 AM, Mystique joven.ch...@gmail.com wrote: Somehow lv_arrr still contain null. Why is that so? I don't know, but you can figure this out quite easily by stepping through your debugger or printing out the value of Name and the corresponding group in each iteration to see at what point you get a null. - 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
Re: [android-developers] Re: Fill-remainder layout?
24.12.2010 20:54, John Lussmyer пишет: The only problem I ran into was making sure there were no forward references in the id's. (Which is why your example had the middle layout at the bottom.) I was just trying to modify my existing layout, and it had the middle in the middle! :-) I had to move it to the bottom of the file so it could reference the bottom panel in it's layout_above entry. You don't *have* to declare an id where it's first used to identify a view (as opposed to referring to it). It's perfectly legal to do this: View *** note the plus sign here *** layout_above=@+id/anchor_view .../ View id=@id/anchor_view .../ or even this: View *** note the plus sign here *** layout_above=@+id/anchor_view .../ View *** and here *** id=@+id/anchor_view .../ Note that view declaration order in XML is the initial Z-order (top-to-bottom is back-to-front), so sometimes forward references are necessary. -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Using Ant script '.apk' file is not getting created
I don't see anywhere that you're invoking the resource compiler, or including its output in the compilation. That's what the compiler is complaining about -- the 'R' class is defined by the resource compiler, and needs to be compiled together with the rest of the application. Instead, you're trying to compile it AFTER the rest of the application (that's your second invocation of 'javac'), and I don't see anywhere that you're actually generating it anyway. I don't recognize just how you generated this file, perhaps this is the output of Eclipse's import facility. In any event, it doesn't appear to be what you want. Wny not let the 'android' command set up your build files, as per the documentation: http://developer.android.com/intl/de/guide/developing/other-ide.html Yes, you can do this even though you're using Eclipse. On Dec 22, 7:12 am, Saurabh srajawat@gmail.com wrote: Hi, I have a build.xml file which performs following task. 1. Clean the project. and 2. Build the project. Using command prompt I am trying to clean and build the project. I am successfully able to clean the project but while creating the build file I am getting an error. The Bin folder is getting created but no .apk file. I have used following code: --- --- -- ?xml version=1.0 encoding=UTF-8 standalone=no? !-- WARNING: Eclipse auto-generated file. Any modifications will be overwritten. To include a user specific buildfile here, simply create one in the same directory with the processing instruction ? eclipse.ant.import? as the first entry and export the buildfile again. -- project basedir=. default=build name=CalculatorApplication property environment=env/ property name=CalculatorApplicationTest.location value=../ CalculatorApplicationTest/ property name=debuglevel value=source,lines,vars/ property name=target value=1.6/ property name=source value=1.6/ path id=Android 1.5.libraryclasspath pathelement location=D:/Downloads/Android/android-sdk- windows/platforms/android-3/android.jar/ /path path id=JUnit 4.libraryclasspath pathelement location=D:/Android/eclipse-java-galileo-win32/ plugins/org.junit4_4.5.0.v20090824/junit.jar/ pathelement location=D:/Android/eclipse-java-galileo-win32/ plugins/org.hamcrest.core_1.1.0.v20090501071000.jar/ /path path id=CalculatorApplication.classpath pathelement location=bin/ path refid=Android 1.5.libraryclasspath/ path refid=JUnit 4.libraryclasspath/ /path target name=init mkdir dir=bin/ copy includeemptydirs=false todir=bin fileset dir=src exclude name=**/*.java/ /fileset /copy copy includeemptydirs=false todir=bin fileset dir=gen exclude name=**/*.java/ /fileset /copy /target target name=clean delete dir=bin/ /target target depends=clean name=cleanall/ target depends=build-subprojects,build-project name=build/ target name=build-subprojects/ target depends=init name=build-project echo message=${ant.project.name}: ${ant.file}/ javac debug=true debuglevel=${debuglevel} destdir=bin source=${source} target=${target} includeantruntime=false src path=src/ classpath refid=CalculatorApplication.classpath/ /javac javac debug=true debuglevel=${debuglevel} destdir=bin source=${source} target=${target} src path=gen/ classpath refid=CalculatorApplication.classpath/ /javac /target target description=Build all projects which reference this project. Useful to propagate changes. name=build-refprojects ant antfile=${CalculatorApplicationTest.location}/build.xml dir=${CalculatorApplicationTest.location} inheritAll=false target=clean/ ant antfile=${CalculatorApplicationTest.location}/build.xml dir=${CalculatorApplicationTest.location} inheritAll=false target=build propertyset propertyref name=build.compiler/ /propertyset /ant /target target description=copy Eclipse compiler jars to ant lib directory name=init-eclipse-compiler copy todir=${ant.library.dir} fileset dir=${ECLIPSE_HOME}/plugins includes=org.eclipse.jdt.core_*.jar/ /copy unzip dest=${ant.library.dir} patternset includes=jdtCompilerAdapter.jar/ fileset dir=${ECLIPSE_HOME}/plugins includes=org.eclipse.jdt.core_*.jar/ /unzip /target target description=compile project with Eclipse compiler name=build-eclipse-compiler property name=build.compiler
[android-developers] draw9patch fails because find_java fails because it can't find SwingWorker
I just tried to use the draw9patch program, invoked via draw9patch.bat. It fails with: C:\Projects\android-sdk-windows\toolscall java -Djava.ext.dirs=lib\ -jar lib\dr aw9patch.jar Exception in thread AWT-EventQueue-0 java.lang.NoClassDefFoundError: org/jdesk top/swingworker/SwingWorker at com.android.draw9patch.Application$1.run(Application.java:48) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.jdesktop.swingworker.SwingWorke r at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 9 more Apparently some jar that it depends on is missing. It wasn't provided with the Android SDK. Which one do I need to find? (Win7 64 bit, latest java installed.) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] draw9patch fails because find_java fails because it can't find SwingWorker
The missing jar is a component of the Google Web Toolkit: http://code.google.com/webtoolkit/download.html Download the GWT SDK, extract the .zip file, grab gwt-dev.jar, and drop into android-sdk-windows\tools\lib. This didn't use to be necessary and only broke with the latest SDK release, 8.0.1. Care to file a bug at http://tools.android.com/feedback ? -- Kostya 24.12.2010 21:44, John Lussmyer пишет: I just tried to use the draw9patch program, invoked via draw9patch.bat. It fails with: C:\Projects\android-sdk-windows\toolscall java -Djava.ext.dirs=lib\ -jar lib\dr aw9patch.jar Exception in thread AWT-EventQueue-0 java.lang.NoClassDefFoundError: org/jdesk top/swingworker/SwingWorker at com.android.draw9patch.Application$1.run(Application.java:48) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.jdesktop.swingworker.SwingWorke r at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 9 more Apparently some jar that it depends on is missing. It wasn't provided with the Android SDK. Which one do I need to find? (Win7 64 bit, latest java installed.) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Demo vs Paid and that 15 minutes of refund policy
Now that the market refund policy has changed to 15 minutes, it has become more important to have a demo version for every paid app. What are the best practices to maintain a demo version for a paid app, specially when the development is done in Eclipse. I know that using ant build file lot of crazy stuff can be done. However one would like to avoid dealing with ant build files for hobby app development. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Getting an ImageViews size before it's displayed
I'm building some parts of my UI dynamically, and really need to know an ImageView's size before it's painted on screen. How can I do this? My code currently does this: ImageView iv = new ImageView(this.getApplicationContext()); iv.setImageResource(R.drawable.icon); iv.setAdjustViewBounds(true); iv.setScaleType(ImageView.ScaleType.CENTER); animView.addView(iv); debugTxt( w= + iv.getWidth() + , h= + iv.getHeight()); And the debug msg shows the sizes as 0. When I later use the sizes in my calculations, it throws everything off. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Demo vs Paid and that 15 minutes of refund policy
I used the emulator, CamStudio and made a video demo of my products and created a channel on YouTube. That may work better than a demo version depending on what your product does. Now the only problem is after supplying the link to the video (which the Market has an entry for) is waiting for them to post it. On Dec 24, 11:41 am, dipu contac...@gmail.com wrote: Now that the market refund policy has changed to 15 minutes, it has become more important to have a demo version for every paid app. What are the best practices to maintain a demo version for a paid app, specially when the development is done in Eclipse. I know that using ant build file lot of crazy stuff can be done. However one would like to avoid dealing with ant build files for hobby app development. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Beginner type question on scope
What error does the compiler give? The code you posted appears to be missing a ; between score++ and break -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Intent filter question
On Dec 24, 1:28 pm, Pent tas...@dinglisch.net wrote: Intent matching is described here: http://developer.android.com/reference/android/content/IntentFilter.html I think this one from my manifest only matches paths ending in .prf.xml. intent-filter action android:name=android.intent.action.VIEW/ category android:name=android.intent.category.DEFAULT / category android:name=android.intent.category.BROWSABLE / data android:scheme=http android:host=* android:pathPattern=.* \\.prf\\.xml That is excellent! Thank you! Tor -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] XmlSerializer issue
Eclipse has a Java debugger. Have you used it? In my experience, breakpointing and stepping through code is the best way to find out why code isn't working the way you expect it to. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Beginner type question on scope
Yep, you don't understand scope very well. It's a concept common to most modern languages, and one you need to understand to make any progress. Question: Can onClick see the variable scope that's defined in onCreate? If not, where could you define scope so that it would be seen in both methods? On Dec 22, 4:15 pm, Eric webcemeter...@gmail.com wrote: I am jumping into android dev. I am a web developer(.net) . I watched a pretty good video on android dev, but have a question I cannot figure out. Below is my code: package com.example.helloandroid; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; public class HelloAndroid extends Activity implements OnClickListener { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { Button Btn1, Btn2, Btn3; TextView Txt1; int score =15; super.onCreate(savedInstanceState); setContentView(R.layout.main); //Start the Events Btn1 = (Button)findViewById(R.id.Btn_1); Btn2 = (Button)findViewById(R.id.Btn_2); Btn3 = (Button)findViewById(R.id.Btn_3); Txt1 = (TextView)findViewById(R.id.Txt1); //Initialize the text box Txt1.setText(String.valueOf(score)); //Button Listeners Btn1.setOnClickListener(this); Btn2.setOnClickListener(this); Btn3.setOnClickListener(this); } @Override public void onClick(View src) { // TODO Auto-generated method stub switch(src.getId()) { case R.id.Btn_1: score++ break; case R.id.Btn_2: break; case R.id.Btn_3: break; } } } My question is this. The variable score seems to be out of scope in the onclick function. In fact, it will not compile and gives me an error, but the instructor ran it no problem...and it seemed to me that we had the same code. Any Thoughts? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to detect click on complex images/polygons
The first thing that comes to mind is java.awt.Polygon.contains(). I've used it, but obviously with AWT and also with polygon data from http://www.census.gov/geo/www/cob/ One approach then would be to find a similar Android polygon class that can be used to draw and hit test your map and a way to convert the map's bitmap image into a vector image, or at least a vector overlay for the bounds hit test. There are some ways you can get vector from a bitmap. I've used Visio by putting the image on one layer and tracing out the vector shapes in another layer, then writing some VB to export the shape vector data to XML. Do you have Adobe CS? That might have some tools for converting bitmap shapes to vectors. Or perhaps the image was originally authored with vectors? There may also be some clever ways to do hit tests on the color values in the bitmap. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Suggestions on sharing code between standard Java Android
I don't have actual experience doing this in Android, but I can offer some suggestions from general experience with Java and software archtecture. How much can you exploit MVC? What part of the code is the View? How much of the code is the Model? If a large part of the code is the Model, that is the business rules, logic, data conversion, etc., then there's a good chance that with some refactoring, you can get that part of the code to run on Android after some refactoring. Unless the code was actually architected to run on different platforms - which it probably wasn't, blinded by the sirens of WORA - chances are there'll be some painful refactoring. BTW, is the existing code base covered with unit tests? That would help. My rule of portable code is: Code isn't portable until it's been ported. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: My App should get information of every Http Get.
It's not possible from the SDK. You'll need to root the phone or run it on a Wifi network with a packet sniffer or proxy. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Suggestions on sharing code between standard Java Android
I'd create a common CVS project and check it out into two different environments. It does take a little discipline to prevent the two copies from diverging, but if you check in/out on a regular schedule it should work. On Dec 23, 12:56 pm, Eric e...@alum.mit.edu wrote: We have a large, complex, Java client/server application that is deployed in Java Swing. We hope to leverage this codebase and reuse a lot of the client-side model, controller, and communication code in a new Android port of this application. Does anyone have thoughts on how best to do this (FYI, I use Jetbrains IDEA as my IDE, not Eclipse)? For example, several questions come to mind: - is it better to create a new IDE project for the Android project, or just add an Android module to the existing IDE project (I prefer the latter to take advantage of global refactorings). - if adding an Android module to the current IDE project, how does one best share lower-level Modules across Java Swing and Android? Things become very problematic because Android does not ship with the full standard JDK, and therefore code must be moved, refactored, or even deleted if it depends on JDK packages that are not available on Android. This means that for a pre-existing Util module to be shared across the platforms, we may have to create a new lower-level version of that Module that only depends on the packages that Android has available to it. - I've also found through experimentation that when I try to depend on a pre-existing module that has Jar dependencies of it's own, the Dalvik conversion process doesn't always successfully convert that Jar into Android format (possibly because it contains unsupported code). What's confusing is that the Dalvik conversion works on certain jars that contain unsupported code, but not on others. So the conversion process must be ignoring code that isn't referenced somehow. In summary, I've encountered a lot of problems trying to depend on third- party jars on Android, and I'm wondering if anyone else has the same problems, or suggestions? - another way to approach this is to copy the shared code into the Android project and give up the ideal of trying to share the code, and just maintain two distinct code bases (this is not at all ideal, but it may be the most painless route). - I have another specific question about the Dalvik VM conversion process. Exactly how does that process work? Does it strip out code that is unsupported on Android? For example, I had a JAXB generated file which referenced the import javax.xml.bind.annotation.* classes that are not available on Android. With my Android module SDK set to the main JDK, that code DID compile and DID get converted to Dalvik, despite the fact it references classes that are not available on Android. I did this by adding a dependency to another pure-java module that has the jaxb.jar as its dependency. Did the Dalvik converter actually convert the entire JAXB jar and put it onto Android, or did it just strip out the JAXB classes and references from the bytecode that are not available on Android? I'm very curious about how this all works, because the answer will have a significant impact on how we move forward on our project. We have a lot of code that is written to the standard JDK that we'd like to reuse on Android. The code certainly does references packages that are not available on Android, but we may not necessarily hit those code paths from inside Android. But if the system will automatically strip out the unavailable code paths for us, to allow us to reuse the same source code, that would be very beneficial. Just wondering if anyone has insights on 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] Did sensor orientation change in SDK 2.3?
The following test was with Nexus S lying flat on table with display up. When running the ApiDemos/Sensor application in SDK 2.2, the red and green lines (i.e., x-axis accelerometer and y-axis accelerometer, respectively) are at the 0 g axis and the blue line (i.e., z-axis accelerometer) is at the -1 g axis. However, when running the ApiDemos Sensor application in SDK 2.2, the blue line is at the +1 g axis. Looking at Sensor.java, it appears to me that the application's scaling is the same. Looking through the documented API differences, I didn't see any mention of sensor orientation change. Yet, the screen y-axis appears in the ApiDemos/Sensor applications in SDK 2.2 and SDK 2.3 are inverted. What changed? - Greg -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Did sensor orientation change in SDK 2.3?
I meant to write, in SDK 2.3, the blue line is at the +1 g axis. On Dec 24, 5:02 pm, greg sep...@eduneer.com wrote: The following test was with Nexus S lying flat on table with display up. When running the ApiDemos/Sensor application in SDK 2.2, the red and green lines (i.e., x-axis accelerometer and y-axis accelerometer, respectively) are at the 0 g axis and the blue line (i.e., z-axis accelerometer) is at the -1 g axis. However, when running the ApiDemos Sensor application in SDK 2.2, the blue line is at the +1 g axis. Looking at Sensor.java, it appears to me that the application's scaling is the same. Looking through the documented API differences, I didn't see any mention of sensor orientation change. Yet, the screen y-axis appears in the ApiDemos/Sensor applications in SDK 2.2 and SDK 2.3 are inverted. What changed? - Greg -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Getting an ImageViews size before it's displayed
Ok, found it. I can use iv.getDrawable().getIntrinsicWidth() and height. On Fri, Dec 24, 2010 at 11:55 AM, John Lussmyer johnlussm...@gmail.comwrote: I'm building some parts of my UI dynamically, and really need to know an ImageView's size before it's painted on screen. How can I do this? My code currently does this: ImageView iv = new ImageView(this.getApplicationContext()); iv.setImageResource(R.drawable.icon); iv.setAdjustViewBounds(true); iv.setScaleType(ImageView.ScaleType.CENTER); animView.addView(iv); debugTxt( w= + iv.getWidth() + , h= + iv.getHeight()); And the debug msg shows the sizes as 0. When I later use the sizes in my calculations, it throws everything off. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] repeating a set of animation sequentially
I have a set of 3 animations that I want to play sequentially, and have them repeat. I can put them in an AnimationSet, and use a startOffset to start them all in the correct order - BUT they then each start repeating by their duration setting - so they end up running simultaneously after the first play. Is there any way to create a list of animations that when they repeat - it repeats the list, not each individual animation? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Developers near Orlando?
I asked this a couple months ago but didn't get much response. Hope you don't mind my asking if any developers near Orlando might want to 'collaborate' (that means help me debug my apps!) on a few projects? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: TCP Socket and Client within the Emulator
I too would be interested in this. On Dec 23, 5:27 am, CodeJunkie techarchit...@gmail.com wrote: I am trying to create a TCP Socketserver in the emulator and also create a client that will connect to it within the emulator. Should this still need Forwarding rules to be set. Please advise. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Getting a strange MessageQueue warning w/ DefaultHttpClient in AsyncTask
I'm doing a set of HTTP posts (using DefaultHttpClient), each in its own AsyncTask. Functionally, it works fine but I'm getting the warning below in the log. This warning appears for each instance of the AsyncTask. I'm guessing that the HTTP Client in posting a message (to itself?), then the task exits, then the message is undeliverable. Has anyone seen this behavior before or have an idea how I might prevent the warning? 12-24 16:45:30.669: WARN/MessageQueue(7888): Handler{448b0288} sending message to a Handler on a dead thread 12-24 16:45:30.669: WARN/MessageQueue(7888): java.lang.RuntimeException: Handler{448b0288} sending message to a Handler on a dead thread 12-24 16:45:30.669: WARN/MessageQueue(7888): at android.os.MessageQueue.enqueueMessage(MessageQueue.java:179) 12-24 16:45:30.669: WARN/MessageQueue(7888): at android.os.Handler.sendMessageAtTime(Handler.java:457) 12-24 16:45:30.669: WARN/MessageQueue(7888): at android.os.Handler.sendMessageDelayed(Handler.java:430) 12-24 16:45:30.669: WARN/MessageQueue(7888): at android.os.Handler.sendMessage(Handler.java:367) 12-24 16:45:30.669: WARN/MessageQueue(7888): at android.os.Message.sendToTarget(Message.java:348) 12-24 16:45:30.669: WARN/MessageQueue(7888): at android.os.AsyncTask$3.done(AsyncTask.java:214) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.util.concurrent.FutureTask$Sync.innerSet(FutureTask.java:252) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.util.concurrent.FutureTask.set(FutureTask.java:112) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:310) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java: 1068) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.util.concurrent.ThreadPoolExecutor $Worker.run(ThreadPoolExecutor.java:561) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.lang.Thread.run(Thread.java:1096) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: XmlSerializer issue
Call XmlSerializer.flush() -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] MMS messages
Thanks Kapil, but it is only for the permission, and I don't know how to register my class to monitor the incoming MMS. On Wed, Dec 22, 2010 at 9:59 PM, Kapil Lokhande kpl.lokha...@gmail.comwrote: see this http://developer.android.com/reference/android/Manifest.permission.html#RECEIVE_MMS On Thu, Dec 23, 2010 at 11:05 AM, Yves Liu yves...@gmail.com wrote: I left a break point in my code, and it never triggered for SMS_receive. I even put MMS_receive, and it didn't work. Any suggestions? On Tue, Dec 21, 2010 at 5:49 PM, xiaoxiong weng ad...@littlebearz.comwrote: I believe it's the same as SMS_receive but you parse the data as setType(image/png); I might be wrong :S On Mon, Dec 20, 2010 at 5:55 PM, Yves Liu yves...@gmail.com wrote: Anyone knows? On Sat, Dec 18, 2010 at 3:10 PM, yves...@gmail.com yves...@gmail.comwrote: Hi I use android.provider.Telephony.SMS_RECEIVED to listen to new SMS message received. But what should I use to listen to MMS message received? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- littleb...@littlebearz.com +1-647-771-2551 SMS Call 24/7 This message and any attached documents contain information from the LittleBearZ that may be confidential and/or privileged. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Basic String Array question :(
Sorry, if this is too basic and not entirely Android.. but android is part java too, so I don't have to hop forum. I believe someone else might encounter this too. I'm putting some statement in the Android basically reading an xml file and cast the value into an array to be use as listview but I encounter some problem. To keep thing simple and readable, I simplify it as below: String[] lv_arr; for(int i=1; i11; i++){ lv_arr[i] = hello; } When I toast the value of lv_arr[i] it is null. If I do this: String[] lv_arr = {hello, hello, hello} + the for loop, I can get the hello value when I do the toast. but [3]-[10] is still null value. Why is that so? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: draw9patch fails because find_java fails because it can't find SwingWorker
You need this file: swingworker http://code.google.com/p/dividere/downloads/detail?name=swing-worker-1.1.jarcan=2q= On Dec 25, 2:44 am, John Lussmyer johnlussm...@gmail.com wrote: I just tried to use the draw9patch program, invoked via draw9patch.bat. It fails with: C:\Projects\android-sdk-windows\toolscall java -Djava.ext.dirs=lib\ -jar lib\dr aw9patch.jar Exception in thread AWT-EventQueue-0 java.lang.NoClassDefFoundError: org/jdesk top/swingworker/SwingWorker at com.android.draw9patch.Application$1.run(Application.java:48) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.jdesktop.swingworker.SwingWorke r at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 9 more Apparently some jar that it depends on is missing. It wasn't provided with the Android SDK. Which one do I need to find? (Win7 64 bit, latest java installed.) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Developers near Orlando?
I live west of Orlando and would not mind helping out. Just email me when you work out the specifics. carol.bol...@gmail.com Carol On Fri, Dec 24, 2010 at 10:37 PM, BobG bobgard...@aol.com wrote: I asked this a couple months ago but didn't get much response. Hope you don't mind my asking if any developers near Orlando might want to 'collaborate' (that means help me debug my apps!) on a few projects? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Help with animation
I have a LinearLayout with 2 vertical components: View1 View2 I would like to smoothly animate-in View1. I am using the following animation: scale android:fromXScale=1.0 android:toXScale=1.0 android:fromYScale=0.0 android:toYScale=1.0 android:pivotX=0 android:pivotY=0 android:duration=@android:integer/config_longAnimTime/ I am doing a: view1.startAnimation(animation); view1.setVisibility(View.VISIBLE); It works, but the problem is that View2 snaps down and View1 fills the gap. How do I make it so View2 slide down smoothly? I've tried postponing the setVisibilty() call to after the animation had finished, but then View1 slides down over View2 which looks even worse. 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] My game, what do you think help me out
So, I would like you guys to try out my app I just updated it, its called doodle bike. I figured you could help me alot more then the average users could. So tell me what you think about the tilting the physics, bike speed, levels style,art and everything. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: LocationManager.KEY_PROXIMITY_ENTERING
Still having this problem. Does entering false/true work for anybody? I yes, with what radius put in for the proximity alert? - Original Message - From: Hendrik Greving To: Android Developers Sent: Thursday, December 23, 2010 10:57 AM Subject: LocationManager.KEY_PROXIMITY_ENTERING LocationManager.KEY_PROXIMITY_ENTERING is true for the intent of a proximityAlert I was adding. No matter where I am going, I never receive false. Anybody else seeing 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
Re: [android-developers] Basic String Array question :(
On Fri, Dec 24, 2010 at 8:12 PM, Mystique joven.ch...@gmail.com wrote: String[] lv_arr; for(int i=1; i11; i++){ lv_arr[i] = hello; } When I toast the value of lv_arr[i] it is null. If this is your actual code, you need to initialize the array. String[] lv_arr = new String[11]; Second, array indexing is zero-based, so you would start your loop from 0 and go to 9 (where i 10). If I do this: String[] lv_arr = {hello, hello, hello} + the for loop, I can get the hello value when I do the toast. but [3]-[10] is still null value. You've initialized an array to exactly three elements. Anything after that (index 3 and above) is non-existent. These are really basic Java concepts. If you don't understand this, I highly recommend you go study Java on it's own and figure this stuff out before trying to do an Android project. You're going to run into a lot of headaches if you try to learn both at the same time. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Demo vs Paid and that 15 minutes of refund policy
On Fri, Dec 24, 2010 at 1:41 PM, dipu contac...@gmail.com wrote: What are the best practices to maintain a demo version for a paid app, specially when the development is done in Eclipse. Look into Android Library Projects. Also, although the Google Groups search sucks, try searching the group - this question has been asked and discussed before. - 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] Job Opportunity/ Freelance Android Developer
Hi Guys, If you got two years experience on Android and have completed one or more UI design projects and interested for full time job or freelance project. Send me your CV at argongol...@gmail.com. Regards, argongold -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Help with animation
On Fri, Dec 24, 2010 at 8:18 PM, Zsolt Vasvari zvasv...@gmail.com wrote: How do I make it so View2 slide down smoothly? Animate it as well, with a Translation animation, perhaps? - 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: Basic String Array question :(
Dear King, array indexing is zero-based, so you would start your loop from 0 and go to 9 (where i 10) Right sir, I'm aware it's for illustration and I forgot to change it. You've initialized an array to exactly three elements. Anything after that This part is essential, if I do not know how many element I have then I cannot declare it predefine but declare array without value to be filled later. That is why I have a for loop to extract value from a XML field to fill into the array. But the array seems to be null unless I have pre- initialise it with something. The for loop only fill the data for dummy value I put, if I initialise 3 dummy values the for loop fill exactly 3 values and leave the rest empty. If i set set 5 dummy values, the 5 get filled correctly. Java is not my native and I have read a few java books and written full running android apps. Then, still unable to figure this out... maybe I need some beer :D On Dec 25, 11:08 am, TreKing treking...@gmail.com wrote: On Fri, Dec 24, 2010 at 8:12 PM, Mystique joven.ch...@gmail.com wrote: String[] lv_arr; for(int i=1; i11; i++){ lv_arr[i] = hello; } When I toast the value of lv_arr[i] it is null. If this is your actual code, you need to initialize the array. String[] lv_arr = new String[11]; Second, array indexing is zero-based, so you would start your loop from 0 and go to 9 (where i 10). If I do this: String[] lv_arr = {hello, hello, hello} + the for loop, I can get the hello value when I do the toast. but [3]-[10] is still null value. You've initialized an array to exactly three elements. Anything after that (index 3 and above) is non-existent. These are really basic Java concepts. If you don't understand this, I highly recommend you go study Java on it's own and figure this stuff out before trying to do an Android project. You're going to run into a lot of headaches if you try to learn both at the same time. --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Help with animation
Really? That's the only way? Not very object oriented ... I can have any number of views under View2, they would all need to be translated. Seems very heavy handed. On Dec 25, 11:16 am, TreKing treking...@gmail.com wrote: On Fri, Dec 24, 2010 at 8:18 PM, Zsolt Vasvari zvasv...@gmail.com wrote: How do I make it so View2 slide down smoothly? Animate it as well, with a Translation animation, perhaps? --- -- 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
Re: [android-developers] Re: Basic String Array question :(
On Fri, Dec 24, 2010 at 9:32 PM, Mystique joven.ch...@gmail.com wrote: This part is essential, if I do not know how many element I have then I cannot declare it predefine but declare array without value to be filled later. Then don't use an array - try ArrayList. - 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]
Hi there is bitter truth behind christmas which I felt personally when jesus was on earth nobody cared him even he was punished by some bad people on cross sign including some innocent people but while dying he said to everyone I am dying for all of you and today everyone missing him its just a formality of doing and celebrating christmas I mean to say when we have anything near we dont care but after missing that same thing we start caring well by the way this christmas inspiring to us we should care everyone and never make any difference it does not matter who is big or small matter should be good for others but you know everyone celebrating no body think what are the main reason behind this celebration I thought deeply and paid homage to that great man who came on earth and was good human being that is JESUS -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Help with animation
On Fri, Dec 24, 2010 at 9:45 PM, Zsolt Vasvari zvasv...@gmail.com wrote: Really? That's the only way? Not very object oriented ... No idea if it's the only or even best option, honestly. Haven't done any animations, but AFAIK they don't actually modify the views, just how they're rendered. So if you have another view depenedent on the animation of the first, I think you'd have to animate it as well. I can have any number of views under View2, they would all need to be translated. Seems very heavy handed. I would expect an animation applied to a ViewGroup to also apply to it's children as well - but again, I don't know much on the topic. Just throwing out an idea. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Help with animation
I think View1 is always going to have an intrinsic height of its measured height for the layout. That is to say, an animation isn't going to change a view's measured height over time, it will just change the way it appears on screen over the duration of the animation. The mere presence of View1 in your layout will cause the layout to set aside its measured dimensions. I could be wrong, but I don't think an animation with a layout like this is going to achieve the effect you're looking for. You may have to do something where you change the measured height of the view over time and invalidate the view/layout at every tick to get it to re- render everything. Doug On Dec 24, 6:18 pm, Zsolt Vasvari zvasv...@gmail.com wrote: I have a LinearLayout with 2 vertical components: View1 View2 I would like to smoothly animate-in View1. I am using the following animation: scale android:fromXScale=1.0 android:toXScale=1.0 android:fromYScale=0.0 android:toYScale=1.0 android:pivotX=0 android:pivotY=0 android:duration=@android:integer/config_longAnimTime/ I am doing a: view1.startAnimation(animation); view1.setVisibility(View.VISIBLE); It works, but the problem is that View2 snaps down and View1 fills the gap. How do I make it so View2 slide down smoothly? I've tried postponing the setVisibilty() call to after the animation had finished, but then View1 slides down over View2 which looks even worse. 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: draw9patch fails because find_java fails because it can't find SwingWorker
Don't file a bug because there is already one open: http://code.google.com/p/android/issues/detail?id=12979 On Dec 24, 11:04 am, Kostya Vasilyev kmans...@gmail.com wrote: The missing jar is a component of the Google Web Toolkit: http://code.google.com/webtoolkit/download.html Download the GWT SDK, extract the .zip file, grab gwt-dev.jar, and drop into android-sdk-windows\tools\lib. This didn't use to be necessary and only broke with the latest SDK release, 8.0.1. Care to file a bug athttp://tools.android.com/feedback? -- Kostya 24.12.2010 21:44, John Lussmyer пишет: I just tried to use the draw9patch program, invoked via draw9patch.bat. It fails with: C:\Projects\android-sdk-windows\toolscall java -Djava.ext.dirs=lib\ -jar lib\dr aw9patch.jar Exception in thread AWT-EventQueue-0 java.lang.NoClassDefFoundError: org/jdesk top/swingworker/SwingWorker at com.android.draw9patch.Application$1.run(Application.java:48) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.jdesktop.swingworker.SwingWorke r at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 9 more Apparently some jar that it depends on is missing. It wasn't provided with the Android SDK. Which one do I need to find? (Win7 64 bit, latest java installed.) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Getting a strange MessageQueue warning w/ DefaultHttpClient in AsyncTask
I can't imagine that Apache HttpClient would be doing anything with Android handlers unless Google modified it to do so, unless maybe you are using AndroidHttpClient. Are you perhaps making any AsyncTask method calls inside some kind of asynchronous callback from HttpClient? Care to share any code? Doug On Dec 24, 5:07 pm, Bret Foreman bret.fore...@gmail.com wrote: I'm doing a set of HTTP posts (using DefaultHttpClient), each in its own AsyncTask. Functionally, it works fine but I'm getting the warning below in the log. This warning appears for each instance of the AsyncTask. I'm guessing that the HTTP Client in posting a message (to itself?), then the task exits, then the message is undeliverable. Has anyone seen this behavior before or have an idea how I might prevent the warning? 12-24 16:45:30.669: WARN/MessageQueue(7888): Handler{448b0288} sending message to a Handler on a dead thread 12-24 16:45:30.669: WARN/MessageQueue(7888): java.lang.RuntimeException: Handler{448b0288} sending message to a Handler on a dead thread 12-24 16:45:30.669: WARN/MessageQueue(7888): at android.os.MessageQueue.enqueueMessage(MessageQueue.java:179) 12-24 16:45:30.669: WARN/MessageQueue(7888): at android.os.Handler.sendMessageAtTime(Handler.java:457) 12-24 16:45:30.669: WARN/MessageQueue(7888): at android.os.Handler.sendMessageDelayed(Handler.java:430) 12-24 16:45:30.669: WARN/MessageQueue(7888): at android.os.Handler.sendMessage(Handler.java:367) 12-24 16:45:30.669: WARN/MessageQueue(7888): at android.os.Message.sendToTarget(Message.java:348) 12-24 16:45:30.669: WARN/MessageQueue(7888): at android.os.AsyncTask$3.done(AsyncTask.java:214) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.util.concurrent.FutureTask$Sync.innerSet(FutureTask.java:252) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.util.concurrent.FutureTask.set(FutureTask.java:112) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:310) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java: 1068) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.util.concurrent.ThreadPoolExecutor $Worker.run(ThreadPoolExecutor.java:561) 12-24 16:45:30.669: WARN/MessageQueue(7888): at java.lang.Thread.run(Thread.java:1096) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: repeating a set of animation sequentially
On Dec 24, 2:33 pm, John Lussmyer johnlussm...@gmail.com wrote: Is there any way to create a list of animations that when they repeat - it repeats the list, not each individual animation? Use OnAnimationEnd to fire up the animation set again? Doug -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Basic String Array question :(
Tried ArrayList and it works! On Dec 25, 11:45 am, TreKing treking...@gmail.com wrote: On Fri, Dec 24, 2010 at 9:32 PM, Mystique joven.ch...@gmail.com wrote: This part is essential, if I do not know how many element I have then I cannot declare it predefine but declare array without value to be filled later. Then don't use an array - try ArrayList. --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Which JSON Parser is better
The JSON library built into Android (org.json) should be more than efficient for your needs on a mobile device. If there are inefficiencies in it, they almost certainly won't be large enough to cause a visible slowdown in your app unless you are transmitting a drastic amount of information over JSON - which isn't really what it's for.* *In addition, by using the built in library you can be assured that there will be fewer bugs than in something you write yourself simply because the included library is older and more widely deployed. Lastly, you save yourself the time, however minimal, of re-inventing the wheel. Before you write your own JSON parser, I'd just write your app with the included code. Later on, if you notice performance problems you can then measure and eliminate them no matter where they originate. Pre-optimizing is a dangerous game to play. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Fill-remainder layout?
I really think what you're trying to do is most easily expressed as a LinearLayout (itself using width and height to fill parent) using the layout_weight property to make the middle view grab any extra space. If found that it's easy to go overboard with a verbose RelativeLayout when all that's needed is a LinearLayout (and it's probably runs faster to boot). Doug On Dec 24, 9:54 am, John Lussmyer johnlussm...@gmail.com wrote: Thanks, I did finally get it done with a relative layout. The only problem I ran into was making sure there were no forward references in the id's. (Which is why your example had the middle layout at the bottom.) I was just trying to modify my existing layout, and it had the middle in the middle! :-) I had to move it to the bottom of the file so it could reference the bottom panel in it's layout_above entry. On Fri, Dec 24, 2010 at 9:06 AM, Kostya Vasilyev kmans...@gmail.com wrote: 24.12.2010 19:49, Pent пишет: If the view in the middle might be bigger than the available space it will push the bottom row off however. There's a solution for that. This case can be correctly handled by using a RelativeLayout, as I just described in my other message. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Basic String Array question :(
Yeah, if you don't know the size in advance use ArrayList or Vector. On Dec 24, 9:32 pm, Mystique joven.ch...@gmail.com wrote: Dear King, array indexing is zero-based, so you would start your loop from 0 and go to 9 (where i 10) Right sir, I'm aware it's for illustration and I forgot to change it. You've initialized an array to exactly three elements. Anything after that This part is essential, if I do not know how many element I have then I cannot declare it predefine but declare array without value to be filled later. That is why I have a for loop to extract value from a XML field to fill into the array. But the array seems to be null unless I have pre- initialise it with something. The for loop only fill the data for dummy value I put, if I initialise 3 dummy values the for loop fill exactly 3 values and leave the rest empty. If i set set 5 dummy values, the 5 get filled correctly. Java is not my native and I have read a few java books and written full running android apps. Then, still unable to figure this out... maybe I need some beer :D On Dec 25, 11:08 am, TreKing treking...@gmail.com wrote: On Fri, Dec 24, 2010 at 8:12 PM, Mystique joven.ch...@gmail.com wrote: String[] lv_arr; for(int i=1; i11; i++){ lv_arr[i] = hello; } When I toast the value of lv_arr[i] it is null. If this is your actual code, you need to initialize the array. String[] lv_arr = new String[11]; Second, array indexing is zero-based, so you would start your loop from 0 and go to 9 (where i 10). If I do this: String[] lv_arr = {hello, hello, hello} + the for loop, I can get the hello value when I do the toast. but [3]-[10] is still null value. You've initialized an array to exactly three elements. Anything after that (index 3 and above) is non-existent. These are really basic Java concepts. If you don't understand this, I highly recommend you go study Java on it's own and figure this stuff out before trying to do an Android project. You're going to run into a lot of headaches if you try to learn both at the same time. --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en