[android-developers] MediaPlayer onCompletion is not being called accurately
In my app i have created an audio player (only WAV files) using MediaPlayerhttp://developer.android.com/reference/android/media/MediaPlayer.htmlAPI. But the player doesn't give callback to onCompletion Listener everytime. Sometimes it gives callback but not everytime. I am doing some audio processing on wav file , like insertion and overwriting. Is it because any missing in audio header? Why it doesn't give callback when the playback is completed? here is the code: mMediaPlayer.setOnCompletionListener(new OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { // realease media player // update player ui } }); http://stackoverflow.com/questions/tagged/android Here is the code how i create and update wav header: public void createWAVHeader(int sRate,int byteRate,int nChannels,int BitsPerSample,long length){ byte[] header = new byte[44]; header[0] = 'R'; // RIFF/WAVE header header[1] = 'I'; header[2] = 'F'; header[3] = 'F'; header[4] = (byte) ((length+36) 0xff); header[5] = (byte) (((length+36) 8) 0xff); header[6] = (byte) (((length+36) 16) 0xff); header[7] = (byte) (((length+36) 24) 0xff); header[8] = 'W'; header[9] = 'A'; header[10] = 'V'; header[11] = 'E'; header[12] = 'f'; // 'fmt ' chunk header[13] = 'm'; header[14] = 't'; header[15] = ' '; header[16] = 16; // 4 bytes: size of 'fmt ' chunk header[17] = 0; header[18] = 0; header[19] = 0; header[20] = 1; // format = 1 header[21] = 0; header[22] = (byte) nChannels; header[23] = 0; header[24] = (byte) (sRate 0xff); header[25] = (byte) ((sRate 8) 0xff); header[26] = (byte) ((sRate 16) 0xff); header[27] = (byte) ((sRate 24) 0xff); header[28] = (byte) (byteRate 0xff); header[29] = (byte) ((byteRate 8) 0xff); header[30] = (byte) ((byteRate 16) 0xff); header[31] = (byte) ((byteRate 24) 0xff); header[32] = (byte) (2 * 16 / 8); // block align header[33] = 0; header[34] = (byte) BitsPerSample; // bits per sample header[35] = 0; header[36] = 'd'; header[37] = 'a'; header[38] = 't'; header[39] = 'a'; header[40] = (byte) (length 0xff); header[41] = (byte) ((length 8) 0xff); header[42] = (byte) ((length 16) 0xff); header[43] = (byte) ((length 24) 0xff); try { rafOut.write(header, 0, 44); } catch (IOException e) { e.printStackTrace(); }} Here is the code for updating the header when new audio data is been recorded public void updateHeader(String inFile){ long totalAudioLen = 0; long totalDataLen =0; // totalAudioLen + 36 FileInputStream in = null; try { in = new FileInputStream(inFile); totalAudioLen = (in.getChannel().size()-44); totalDataLen = (totalAudioLen) + 36; RandomAccessFile invFile = new RandomAccessFile(inFile, rw); invFile.seek(4); invFile.write((byte) (totalDataLen 0xff)); invFile.write((byte) ((totalDataLen 8) 0xff)); invFile.write((byte) ((totalDataLen 16) 0xff)); invFile.write((byte) ((totalDataLen 24) 0xff)); invFile.seek(40); invFile.write((byte) (totalAudioLen 0xff)); invFile.write((byte) ((totalAudioLen 8) 0xff)); invFile.write((byte) ((totalAudioLen 16) 0xff)); invFile.write((byte) ((totalAudioLen 24) 0xff)); invFile.close(); }catch (Exception e) { // TODO: handle exception } } -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Converting PCM to AMR-WB using AmrInputStream
My Android application needs to convert recorded audio in WAV to AMR-NB and AMR-WB. And i am done with converting to *AMR-NB* using *AmrInputStream*. In AmrInputStream, the value for SAMPLES_PER_FRAME is hard coded to *8000 * 20 / 1000* and the audio has no changes even after changing SAMPLES_PER_FRAME to *(16000*20/1000)*. Is it possible to convert PCM to *AMR-WB (16 khz)* using AmrInputStream ? -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] How to get free runtime memory in android using ndk?
I want to allocate a buffer size for a byte buffer in native code , depending upon the available runtime memory. How can i get the runtime free memory using native code? I have checked this successfully is java using the following code : MemoryInfo mi = new MemoryInfo();ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE); activityManager.getMemoryInfo(mi);long availableMegs = mi.availMem / 1048576L; -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Connecting to a wifi device from the android application
My application (supports 2.2 and later) needs to connect with a *wifi device * like FlashAir http://www.toshiba-components.com/FlashAir/index.html after scanning networks using WifiManagerhttp://developer.android.com/reference/android/net/wifi/WifiManager.html . Is it possible to connect to a device from the *application ? *or is it only possible by scanning and connecting devices from settings? -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Connecting to a wifi device from the android application
I am able to connect to the device ,only if the target device's wificonfiguration is once saved. Is it possible to create the wificonfiguration programatically and connect to it? On Thursday, 7 February 2013 22:05:51 UTC+5:30, Raneez wrote: My application (supports 2.2 and later) needs to connect with a *wifi device* like FlashAirhttp://www.toshiba-components.com/FlashAir/index.html after scanning networks using WifiManagerhttp://developer.android.com/reference/android/net/wifi/WifiManager.html . Is it possible to connect to a device from the *application ? *or is it only possible by scanning and connecting devices from settings? -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Exploring and Downloading files from a device over a wifi connection
I want my android application to connect to a device like FlashAirhttp://www.toshiba-components.com/FlashAir/index.html over *wifi* connection and *explore* its *directories* and *download* the selected files to the android device. I have gone through this posthttp://marakana.com/forums/android/examples/40.html and got some idea how to *scan* and *detect* devices over wifi. Now how can i access its *file directories* and *download* the files? -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Adjusting the mic sensitivity for recording audio in android
I am developing an android application which records audio in *PCM* using the *AudioRecord* API. I want to adjust the mic sensitivity to low, medium and high as the user chooses it in the settings. Is it possible to adjust the *mic sensitivity*? Your answers will be highly appreciated :) -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Accessing a webservice with nested complex type
I want to access a webservice in android which has a complex type inside another complex type. An example of the soap request is soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:tem=http://tempuri.org/; xmlns:pat= http://schemas.datacontract.org/2004/07/Patient_Service.App_Code.Common; soapenv:Header/ soapenv:Body tem:PatientLookups tem:oBenefitsandEligibilityEntity pat:ID?/pat:ID pat:Name?/pat:Name pat:Age?/pat:Age pat:ContactDetails pat:PatientContactEntity pat:FirstName/pat:FirstName pat:LastName/pat:LastName /pat:PatientContactEntity /pat:ContactDetails /tem:oBenefitsandEligibilityEntity /tem:PatientLookups /soapenv:Body NB: The nested complex types are marked in red color: I successfully called a webservice with single complex type by using KvmSerializable . But how it is possible to pass values to nested complex types? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to create soap request in ksoap2 for a wcf webservice method with complex types?
Please look at this question and give me some suggestions..i hate being stuck with something like this. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to create soap request in ksoap2 for a wcf webservice method with complex types?
@Piren That forum is inactive. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to create soap request in ksoap2 for a wcf webservice method with complex types?
And you are not supposed to comment here, if you dont have any idea about this. Directing to a inactive forum is not a good attitude, give a hand if you know something else go away! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] How to create soap request in ksoap2 for a wcf webservice method with complex types?
I have successfully accessed web services using ksoap2 but i am stuck with calling a web service method with data contracts. The webservice request in SoapUI is shown as : soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:tem=http://tempuri.org/; xmlns:pat=http://schemas.datacontract.org/2004/07/Patient_Service.App_Code.Common;soapenv:Header/soapenv:Body tem:PatientLookups tem:oBenefitsandEligibilityEntity pat:ID?/pat:ID pat:Name?/pat:Name pat:Age?/pat:Age pat:Address?/pat:Address /tem:oBenefitsandEligibilityEntity /tem:PatientLookups /soapenv:Body The arguments ID,Name,Age and Address have different namespaces Here is the code i used to create the request: request=new SoapObject(NAMESPACE,PatientLookups);SoapObject sub_element=new SoapObject(NAMESPACE, oBenefitsandEligibilityEntity); for(Map.EntryString,String entry: properties.entrySet()) { PropertyInfo pi=new PropertyInfo(); pi.setNamespace(entityNameSpace); pi.setName(entry.getKey()); pi.setValue(entry.getValue()); sub_element.addProperty(pi); } request.addSoapObject(sub_element); but i get this exception in logcat: SoapFault - faultcode: 'a:DeserializationFailed' faultstring: 'The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:oBenefitsandEligibilityEntity. The InnerException message was 'Error in line 1 position 411. Element 'http://tempuri.org/:oBenefitsandEligibilityEntity' contains data from a type that maps to the name 'http://tempuri.org/:oBenefitsandEligibilityEntity'. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to 'oBenefitsandEligibilityEntity' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details.' faultactor: 'null' detail: null at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:141) at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:140) at org.ksoap2.transport.Transport.parseResponse(Transport.java:100) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:214) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:96) at com.m2.action.WebServiceConnection.callWCFWebService(WebServiceConnection.java: how to create this soap request using ksoap? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Saving the fragment state before replacing it with another fragment.
In my app, i use a dual panel layout where each buttons on the left side replaces the fragments at the right side(Frame Layout). The FragmentTransaction.replace() method actually removes the current one and add another fragment to the container, how can i save the fragment instance before replacing and retrieve it back when i need it? Or is there anyway to change the fragments without replacing them? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Notifying the fragment when it is currently selected in a viewpager
Thanks Vinay! On Saturday, 29 September 2012 15:18:27 UTC+5:30, Raneez wrote: I use ViewPager loaded with fragments in it .The *onResume()* method of each fragments does some logic and so i get problems when the adjacent fragments(left and right) to the currently selected page are also loaded to provide smooth scrolling between the pages. Does the fragment recieve any *callbacks* when it get actually selected? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Notifying the fragment when it is currently selected in a viewpager
I use ViewPager loaded with fragments in it .The *onResume()* method of each fragments does some logic and so i get problems when the adjacent fragments(left and right) to the currently selected page are also loaded to provide smooth scrolling between the pages. Does the fragment recieve any *callbacks* when it get actually selected? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Fragments inside a ListFragment
Thanks mark murphy, you are really helpfull. Does the viewpager save data on each pages itself or do we need to save them explicitly? On Friday, 21 September 2012 16:21:11 UTC+5:30, Raneez wrote: I am using a *custom viewpager* which has Listfragment's loaded with * FragmentPagerAdapter*. Each ListFragment represents a *dual panel layout*, where each list item(Left) loads some other fragments to a *framelayout*(Right Panel). Is this a best practice? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Fragments inside a ListFragment
I am using a *custom viewpager* which has Listfragment's loaded with * FragmentPagerAdapter*. Each ListFragment represents a *dual panel layout*, where each list item(Left) loads some other fragments to a *framelayout*(Right Panel). Is this a best practice? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Fragments inside a ListFragment
Is there any alternate solution to implement this? On Friday, 21 September 2012 16:21:11 UTC+5:30, Raneez wrote: I am using a *custom viewpager* which has Listfragment's loaded with * FragmentPagerAdapter*. Each ListFragment represents a *dual panel layout*, where each list item(Left) loads some other fragments to a *framelayout*(Right Panel). Is this a best practice? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Fragments inside a ListFragment
I have used viewpager only with fragments, how to replace listfragments with listview in a viewpager? On Friday, 21 September 2012 16:21:11 UTC+5:30, Raneez wrote: I am using a *custom viewpager* which has Listfragment's loaded with * FragmentPagerAdapter*. Each ListFragment represents a *dual panel layout*, where each list item(Left) loads some other fragments to a *framelayout*(Right Panel). Is this a best practice? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 TableLayout to perform like expandable listview.
Okay, I have customized BaseExpandableListAdapter class and in getChildView() method i have created layouts for different groups : public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { if(groupPosition==0) { // Return TableLayout for group position 0. } else if(groupPosition==1) { // Return TableLayout for group position 1. } } am i going the right way so far? On Tuesday, 12 June 2012 18:29:07 UTC+5:30, Raneez wrote: Is it possible to use TableLayout to get the same function of ExpandableListView by dynamically adding the rows(when expanding) and removing the rows ( when hiding) ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 TableLayout to perform like expandable listview.
because , i need different table layouts for different groups in the expandable listview, and i find it difficult to implement. Can you please help me, i'l be happy if i could do it with expandable listview itself. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 TableLayout to perform like expandable listview.
I need to set different table layouts for respective group items ,also i want to set onClick listeners to each rows in that table. How it is done? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Using TableLayout to perform like expandable listview.
Is it possible to use TableLayout to get the same function of ExpandableListView by dynamically adding the rows(when expanding) and removing the rows ( when hiding) ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Different layouts for different groups in a Expandable ListView
I use an expandable listview in my application, where each group has different Table Layouts. And i want to set onClick Listener to each rows in the table. How is it possible? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Starting an activity from Fragments.
Let me explain the structure of my application, In my app i have 3 main tabs implemented using Fragments. And one of the main tab contains 3 sub tabs in its fragment, and one sub tab contains listview. Now i want to start an Activity when an item from the list is selected. How it is possible? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Starting an activity from Fragments.
This is listview onClivk listener lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView? arg0, View view, int position, long id) { RecordObjects obj=(RecordObjects)lv.getItemAtPosition(position); String name=obj.getName(); String url=obj.getUrl(); intent=new Intent(getActivity(),player.class); intent.putExtra(task,Draft); intent.putExtra(name,name); intent.putExtra(read_path,url); startActivityForResult(intent, 0); } }); and the error i got is: 05-09 16:19:07.723: D/PhoneWindow(7043): couldn't save which view has focus because the focused view android.widget.LinearLayout@44ecc1d8 has no id. 05-09 16:19:07.741: D/AndroidRuntime(7043): Shutting down VM 05-09 16:19:07.741: W/dalvikvm(7043): threadid=3: thread exiting with uncaught exception (group=0x4001b188) 05-09 16:19:07.751: E/AndroidRuntime(7043): Uncaught handler: thread main exiting due to uncaught exception 05-09 16:19:07.771: E/AndroidRuntime(7043): java.lang.RuntimeException: Unable to pause activity {com.m2.smartGui/ com.m2.smartGui.smartGuiPagerFragmentActivity}: java.lang.NullPointerException 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.app.ActivityThread.performPauseActivity(ActivityThread.java: 3162) 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.app.ActivityThread.performPauseActivity(ActivityThread.java: 3119) 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java: 3102) 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.app.ActivityThread.access$2400(ActivityThread.java:119) 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870) 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.os.Handler.dispatchMessage(Handler.java:99) 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.os.Looper.loop(Looper.java:123) 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.app.ActivityThread.main(ActivityThread.java:4363) 05-09 16:19:07.771: E/AndroidRuntime(7043): at java.lang.reflect.Method.invokeNative(Native Method) 05-09 16:19:07.771: E/AndroidRuntime(7043): at java.lang.reflect.Method.invoke(Method.java:521) 05-09 16:19:07.771: E/AndroidRuntime(7043): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 05-09 16:19:07.771: E/AndroidRuntime(7043): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 05-09 16:19:07.771: E/AndroidRuntime(7043): at dalvik.system.NativeStart.main(Native Method) 05-09 16:19:07.771: E/AndroidRuntime(7043): Caused by: java.lang.NullPointerException 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.support.v4.app.FragmentManagerImpl.saveFragmentBasicState(FragmentManager.java: 1576) 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.support.v4.app.FragmentManagerImpl.saveAllState(FragmentManager.java: 1617) 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.support.v4.app.FragmentActivity.onSaveInstanceState(FragmentActivity.java: 481) 05-09 16:19:07.771: E/AndroidRuntime(7043): at com.m2.smartGui.smartGuiPagerFragmentActivity.onSaveInstanceState(smartGuiPagerFragmentActivity.java: 78) 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.app.Activity.performSaveInstanceState(Activity.java:1022) 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java: 1180) 05-09 16:19:07.771: E/AndroidRuntime(7043): at android.app.ActivityThread.performPauseActivity(ActivityThread.java: 3144) 05-09 16:19:07.771: E/AndroidRuntime(7043): ... 12 more -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Starting an activity from Fragments.
The app crashes when i click on list item. Actually this listview resides in a tab which is in another tab of a fragment. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Starting an activity from Fragments.
no problem when changing tabs, the listview consists of details of recorded audio files, so when any list item is clicked, it should start new Activity player to play the audio file, but it goes wrong when an item is clicked. :( :( :( -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Starting an activity from Fragments.
instead of creating the intent and starting the activity, just do nothing. -- didnt crash. If that doesn't crash, construct the intent as before (but don't start the activity yet). If that is OK, pop up a message with Toast after creating the intent (so we are hopefully taking the focus away from the tab layout briefly). yes, pop up message was shown successfully. If all of that is OK, try creating a dummy activity of your own with a button, and have the intent use *that* class (and start the activity) - didnt work, application crashed. LogCat: 05-09 17:08:39.082: D/AndroidRuntime(13361): Shutting down VM 05-09 17:08:39.091: W/dalvikvm(13361): threadid=3: thread exiting with uncaught exception (group=0x4001b188) 05-09 17:08:39.091: E/AndroidRuntime(13361): Uncaught handler: thread main exiting due to uncaught exception 05-09 17:08:39.101: E/AndroidRuntime(13361): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.m2.smartGui/com.m2.smartGui.dummyActivity}; have you declared this activity in your AndroidManifest.xml? 05-09 17:08:39.101: E/AndroidRuntime(13361):at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java: 1404) 05-09 17:08:39.101: E/AndroidRuntime(13361):at android.app.Instrumentation.execStartActivity(Instrumentation.java: 1378) 05-09 17:08:39.101: E/AndroidRuntime(13361):at android.app.Activity.startActivityForResult(Activity.java:2749) 05-09 17:08:39.101: E/AndroidRuntime(13361):at android.support.v4.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java: 689) 05-09 17:08:39.101: E/AndroidRuntime(13361):at android.support.v4.app.Fragment.startActivityForResult(Fragment.java: 794) 05-09 17:08:39.101: E/AndroidRuntime(13361):at com.m2.smartGui.RecordActivity$Recordings $3.onItemClick(RecordActivity.java:201) 05-09 17:08:39.101: E/AndroidRuntime(13361):at android.widget.AdapterView.performItemClick(AdapterView.java:284) 05-09 17:08:39.101: E/AndroidRuntime(13361):at android.widget.ListView.performItemClick(ListView.java:3285) 05-09 17:08:39.101: E/AndroidRuntime(13361):at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640) 05-09 17:08:39.101: E/AndroidRuntime(13361):at android.os.Handler.handleCallback(Handler.java:587) 05-09 17:08:39.101: E/AndroidRuntime(13361):at android.os.Handler.dispatchMessage(Handler.java:92) 05-09 17:08:39.101: E/AndroidRuntime(13361):at android.os.Looper.loop(Looper.java:123) 05-09 17:08:39.101: E/AndroidRuntime(13361):at android.app.ActivityThread.main(ActivityThread.java:4363) 05-09 17:08:39.101: E/AndroidRuntime(13361):at java.lang.reflect.Method.invokeNative(Native Method) 05-09 17:08:39.101: E/AndroidRuntime(13361):at java.lang.reflect.Method.invoke(Method.java:521) 05-09 17:08:39.101: E/AndroidRuntime(13361):at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 05-09 17:08:39.101: E/AndroidRuntime(13361):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 05-09 17:08:39.101: E/AndroidRuntime(13361):at dalvik.system.NativeStart.main(Native Method) 05-09 17:08:39.121: I/dalvikvm(13361): threadid=7: reacting to signal 3 05-09 17:08:39.152: I/dalvikvm(13361): Wrote stack trace to '/data/anr/ traces.txt' -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Starting an activity from Fragments.
Sorry, It worked! I forgot to add the activity in manifest. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Starting an activity from Fragments.
Thank you Jason Teagle, The error was in player activity, the player class needed a native library and that library was missing. You were so kind to listen me. Thankyou so much. On May 9, 4:46 pm, Jason Teagle teagle.ja...@gmail.com wrote: Sorry, It worked! I forgot to add the activity in manifest. (Don't worry, I just learned something about activities there as well!) OK, so the dummy activity worked, and that also means that taking focus away from the tab arrangement *shouldn't* be the problem - since that would have happened for your dummy activity. Is the 'player' activity one of your own classes? I'm afraid the fault points to that now. I recommend you start isolating parts of that (in its onCreate() ) and try to narrow down the cause like we did here. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] AMR noise reduction
I recorded AMR audio using MediaRecorder class. The waveform for the AMR audio looks very difficult to understand the speech data. How can we avoid the noise and draw the waveform correctly? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Inserting Recorded Audio file (AMR) in another one
Anyone there to help me? I am stuck with this part and I really need some help. Please On Feb 19, 3:05 pm, Raneez rane...@gmail.com wrote: My Android app records audio in both AMR and WAV format. And my application needs to insert second recorded audio file inside the first one at a position where it is paused. I did it right with WAV files, but the AMR file after insertion is not able to be played in Android MediaPlayer, it gives some error when it reaches the inserted position.But the same file plays fine in AMR players. The steps i followed are: 1. Writing the data from file1 upto pause position: raf3=new RandomAccessFile(result,rw); raf3.setLength(0); int d=0; //Write data from record1 upto the pause position * while(d!=pos) { raf3.write(bytes[d]); d++; } 2. Writing the data to be inserted from file2 //write all the data from record 2 * int l=0; raf3.writeBytes( ); while(l!=bytesread1) { raf3.write(bytes1[l]); l++; } 3. Writing the remaining data from file1 after pause position while(d!=size) { raf3.write(bytes[d]); d++; } Is there anything wrong with what i have done? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Inserting Recorded Audio file (AMR) in another one
My Android app records audio in both AMR and WAV format. And my application needs to insert second recorded audio file inside the first one at a position where it is paused. I did it right with WAV files, but the AMR file after insertion is not able to be played in Android MediaPlayer, it gives some error when it reaches the inserted position.But the same file plays fine in AMR players. The steps i followed are: 1. Writing the data from file1 upto pause position: raf3=new RandomAccessFile(result,rw); raf3.setLength(0); int d=0; //Write data from record1 upto the pause position * while(d!=pos) { raf3.write(bytes[d]); d++; } 2. Writing the data to be inserted from file2 //write all the data from record 2 * int l=0; raf3.writeBytes( ); while(l!=bytesread1) { raf3.write(bytes1[l]); l++; } 3. Writing the remaining data from file1 after pause position while(d!=size) { raf3.write(bytes[d]); d++; } Is there anything wrong with what i have done? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Transparent progress layer on top of imageview
My app display a waveform for the recorded audio in a imageview. I want to display a transparent layer over this waveform which progress with respect to the duration of the audio when it is played. How it is done? Or is there any UI controls in android to do this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] recording voice level meter
I am developing a voice related app. I want show the power or level of voice being recorded at realtime. Is there any inbuilt component or anything else to do this? I have seen a meter in mediastore.audio.record_sound_action. I want to use such meter in my app. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] AudioTrack in MediaController
I used mediaplayer to play audio files using the MediaController..its easy to show mediacontroller from the MediaPlayer.OnPrepared(MediaPlayer mp) method when the file is ready for playback. But I need to use AudioTrack as player for Wav files , how it is possible to use it with MediaController? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] keeping internal memory data while upgrading the android application with new version
I want to upgrade my app 1.0 with new version 1.1 , and also I need to keep the previous datas(such as audio or video files) in the internal memory after upgradation. Is it possible? If yes, how it is done? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] inserting audio clip in another audio file
I have two recorded audio files record1 and record2. I want to insert the record2 file at a position from where i pause while playing record1. for example record1 plays ONE THREE record2 plays TWO so after insertion the record1 should play like ONE TWO THREE PLS HELP. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Pause and Resume in Audio recording
Is there any way to pause and resume audio recording in android? I used MediaRecorder for recording amr and AudioRecord for wav, now i want to pause and insert a new audio after pausing and continue the recorded audio after resume. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] How to merge two amr files to a single file?
I have recorded two amr files using MediaRecorder. Now i want to combine them. Please direct me to achieve this task. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Writing a wav audio file using RandomAccessFile
I want to write a wav audio file using randomacessfile, but when i check through DDMS i find no such file in the sd card. What is the problem with this? I also wrote permission to write in external storage in the manifest file: uses-permission android:name=android.permission.WRITE_EXTERNAL_STORAGE / Here is my code: private RandomAccessFile randomAccessWriter; File f=new File(mFileName); randomAccessWriter = new RandomAccessFile(f, rw); randomAccessWriter.setLength(0); // Set file length to 0, to prevent unexpected behavior in case the file already existed randomAccessWriter.writeBytes(RIFF); randomAccessWriter.writeInt(0); randomAccessWriter.writeBytes(WAVE); randomAccessWriter.writeBytes(fmt ); .. .. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Runtime exception while audio recording
I get the following error while trying to record audio: E/AndroidRuntime(759): java.lang.RuntimeException: setAudioSource failed. E/AndroidRuntime(759): at android.media.MediaRecorder.setAudioSource(Native Method)). Please help me out. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Moving from one activity to previous activities.
My application consists of 2 activities and 1 list activity. List activity -- list of titles from google rss feed. 2nd activity -- shows the details of the item. 3rd activity -- WebView , which shows the content of the url. From the 3rd activity i want to go back to list activity and show the previous contents when the back key is pressed. How it is done? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] WebView error
i get some error when i try to display the contents of a url. The error shown by log cat is : 01-19 17:33:00.999: E/webkit(838): illegal format for expires: Thursday, 19-January-2012 12:11:30 GMT -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Performing read or write operations on a xml file in Internal Storage
My application needs to write and read data from a xml file which is stored in Internal Storage. I wrote some data to xml by using FileOutputStream. FileOutputStream fout=openFileOutput(user.xml,MODE_WORLD_READABLE); OutputStreamWriter out=new OutputStreamWriter(fout); out.write(xml_content); And i'm using XmlPullParser to read data from the xml, but i am not able to get an InputStream for the parser. Please help me out from this problem. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Performing read or write operations on a xml file in Internal Storage
The path of xml file is /data/data/com.examples.LoginXml/files/ user.xml InputStream in = null; try { FileInputStream fis = openFileInput(user.xml); in=new BufferedInputStream(fis); } catch(Exception e) {} Is there anything wrong? still i cant get an input stream to the file -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Appending new tagsto an existing xml file.
This is how my user.xml file looks like: --- ?xml version=1.0 encoding=UTF-8? login account usernameuser1/username passwordpass1/password /account account usernameuser2/username passwordpass2/password /account account usernameuser3/username passwordpass3/password /account /login --- Now i want to add new users to this xml file. I tried it with DOM , but i couldn't find a solution, please do help. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en