天道酬勤,学无止境

android

Detect supported audio encoders on Android to prevent crash “The given audio encoder 2 is not found”

When an Android device does not support a mandatory audio-encoder, you get: (X=numeric index of the encoder) E/MediaProfiles(4048): The given audio encoder X is not found A/AudioSource(4048): frameworks/base/media/libstagefright/AudioSource.cpp:58 CHECK(channels == 1 || channels == 2) failed. A/libc(4048): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1) In native code. No Exception to react to. App is just force closed. Is there any way to query an Android >3.x device if AAC AMR-NB and AMR-WB are actually supported? Documentation ( http://developer.android.com/guide/appendix/media-formats

2021-06-15 18:17:11    分类:问答    android   media   mediarecorder   amr   stagefright

Android Instant App - Play Console release/deploy error and DAL(digital Asset Link) not linked

I'm trying to figure out why the play store will not accept my instant app build. I have successfully deployed an Alpha regular app release to testers since it is a prerequisite to release an instant app. I am trying to deploy a development release instant app. What am I doing wrong? I tried to add as much detail as possible. Do I need to use the Digital Asset Link API service at the following link for a production instant app or is that for something else? https://console.developers.google.com/apis/api/digitalassetlinks.googleapis.com/overview I get the following error when uploading the

2021-06-15 18:12:49    分类:问答    android   applinks   android-instant-apps   google-play-console   digital-assets-links

Android 10: How to delete MediaStore item and it's associated data on file system programmatically?

I am updating my app to use Scoped Storage feature introduced in Android 10. My app works with MediaStore and displays images, videos and audio files and provides ability for user to delete item. What I did earlier to delete file: Got path from MediaStore.MediaColumns.DATA Used new File(path).delete() to delete that file Manually updating MediaStore Now that MediaStore.MediaColumns.DATA is not available I migrated to deleting items from MediaStore using ContentResolver.delete() For example I have uri of the item: content://media/external/images/media/502 (its valid uri, I display it's

2021-06-15 18:11:49    分类:问答    android   mediastore   scoped-storage

How to check whether 3g is active or not in android

i am trying to check whether 3G is active or not in my handset and after that i have to fire an Intent. So plz anybody help me out Thanks in advance:)

2021-06-15 18:05:10    分类:问答    android   3g-network

Activity restarted when application is exited from unexception handler

In my application I use a global exception handler to avoid force close.But an activity is started after calling system.exit(0)....???? the logcat shown is: 07-18 12:41:12.569: WARN/Resources(8453): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f07000a} 07-18 12:41:14.648: INFO/ActivityManager(571): Displayed activity com.fss/.Loading: 2643 ms 07-18 12:41:14.689: INFO/System.out(8453): >>>>>>>>SentRequestBE 07-18 12:41:14.689: INFO/System.out(8453): >>>>>>>>StaticStore.dialog.getProgress()0==100 07-18 12:41:15.399: INFO/System.out(8453): >>>>>>>>SentRequestBE 07-18 12:41:15.429: INFO

2021-06-15 18:05:07    分类:问答    android

Which ARM based development boards should I use?

I want to start a project in which I want to do authenticated boot for Android based on ARM's TrustZone technology. Which board should I use? The minimal requirements: ARM V7 instruction set USB, VGA/HDMI connectors touch-screen connectors Flash capabilities 512 MB RAM TrustZone enabled JTAG connector and DB-9 UART port power supply Board should have documentation available Android drivers and codecs as I will run Android on it. So far, I found the Freescale i.MX53, the Pandaboard, the Beagle board xM (which has TrustZone disabled, apparently), the Atmel-based boards, the Versiatile Express

2021-06-15 18:00:32    分类:问答    android   arm   trust-zone

ECDH using Android KeyStore generated private key

I'm trying to implement ECDH in Android using a private generated by Android KeyStore Provider. public byte[] ecdh(PublicKey otherPubKey) throws Exception { try { ECPublicKey ecPubKey = (ECPublicKey) otherPubKey; KeyAgreement keyAgreement = KeyAgreement.getInstance("ECDH"); PrivateKey pk = (PrivateKey) LoadPrivateKey("Backend"); keyAgreement.init(pk); keyAgreement.doPhase(ecPubKey, true); return (keyAgreement.generateSecret()); } catch (Exception e) { Log.e("failure", e.toString()); return null; } } However, this exception is catched in keyAgreement.init(pk) : E/failure: java.security

2021-06-15 18:00:02    分类:问答    java   android   keystore

CheckedTextView not checked

I want a Multiselected (checked) listview. When I select an item then the green check mark must appear. For this I use CheckedTextViews. The ListView gets the data from the database. I'm using a SimpleCursorAdapter for that. When you click on the button then the selected entries(IDs) will be passed to the next activity. My problem is that the check marks of the CheckedTextView does not appear. But the IDs will be passed to the next activity. What am I doing wrong? How to fix it? selecttest.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk

2021-06-15 17:59:34    分类:问答    android   listview   simplecursoradapter   checkedtextview

SAX parsing: how to fetch child nodes

I'm using SAX parsing in android. For below XML: <?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel> <title>Game Analysis</title> <item> <title>GTA</title> <description>ABC</description> <pubDate>Sat, 21 Feb 2012 05:18:23 GMT</pubDate> <enclosure type="audio/mpeg" url="http://URL.mp3" length="6670315"/> </item> <item> <title>CoD</title> <description>XYZ</description> <pubDate>Sat, 21 Feb 2011 05:18:23 GMT</pubDate> <enclosure type="audio/mpeg" url="http://URL.mp3" length="6670315"/> </item> </channel> </rss> I need to fetch the first occurance of <title> (just below ). Then

2021-06-15 17:58:42    分类:问答    java   android   xml   sax

Android Studio Unknown Emulator running and can't be terminated

I have one emulator actively running at the moment but I see two emulators running when I run the app. One of them is an Unknown Emulator. When I choose the Unknown emulator, the console shows this error: Error: Could not access the Package Manager. Is the system running? How do I terminate this Unknown Simulator? I think it's using my system's resources and degrading the performance.

2021-06-15 17:54:29    分类:问答    android   android-emulator   android-studio