I. Yesterday. Describes the use of the Mediametadataretriever class to get the first frame of video: http://blog.csdn.net/u012561176/article/details/47858099, today, To introduce the use of the Mediametadataretriever class to obtain media information.?? 1. The Mediametadataretriever constructor is used for the class: Mediametadataretriever ()2. Some of the regular usages of the Mediametadataretriever class are used: The Setdatasource (String path) or
, you can use the following method:
1234567891011121314151617181920212223242526272829303132333435
private void saveToSD(Bitmap bmp, String dirName,String fileName) throws IOException {// 判断sd卡是否存在if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {File dir = new File(dirName);// 判断文件夹是否存在,不存在则创建if(!dir.exists()){dir.mkdir();} File file = new File(dirName + fileName);// 判断文件是否存在,不存在则创建if (!file.exists()) {file.createNewFile();}FileOutputStream fos = null
If Bluetooth is paired and connected manually, get the connected device:1. Check the connection status:Java code
int A2DP = Bluetoothadapter.getprofileconnectionstate (BLUETOOTHPROFILE.A2DP);
int headset = bluetoothadapter.getprofileconnectionstate (Bluetoothprofile.headset);
int health = bluetoothadapter.getprofileconnectionstate (bluetoothprofile.health);
2, depending on whether there is a connection to obtain the connected d
These two requests are implemented on Android, primarily using Apache's HTTP LibraryThe GET request is implemented as follows:
The code is as follows
Copy Code
GET Request//////////////////public void Getrequestweb (View v){HttpGet httpget = new HttpGet ("http://www.pan-apps.com");HttpClient client = new Defaulthttpclient ();InputStream
Method"));Params.add (New Basicnamevaluepair ("Param2", "second parameter"));try {HttpPost Postmethod = new HttpPost (BASEURL);Postmethod.setentity (New urlencodedformentity (params, "utf-8")); Fill in the post entity with the parametersHttpResponse response = Httpclient.execute (Postmethod); Execute POST methodLOG.I (TAG, "Rescode =" + Response.getstatusline (). Getstatuscode ()); Get the response codeLOG.I (TAG, "result =" + entityutils.tostring (r
============ Problem Description ============After Android installs the app, can you get the files in the Meta-inf directory of the package?After installing the app on the phone and then opening the app, does the SDK in the app have access to the Meta-inf file in the app package?Why do you do this?Because the same app package, you need to play a different channel ID inside. And then keep the signatures cons
package is not installed");E.printstacktrace ();}Note: This is sure to get processname.2. Get package information:Only the application series of information, the package series of information and for the obtained, you can handle:Packagemanager has a method:Public abstract PackageInfo Getpackageinfo (String packagename, int flags)It queries the system for the PackageInfo information for the package named: P
Next article:Android Map Api usage and development (2) Positioning my location, Map pop-up bubble, get the address through latitude and longitude
In this floating search box, you can use the address name to obtain the longitude, latitude, and detailed address, and locate these functions. This is a complete map.
The predecessors said that they should not duplicate the same wheel. I hope this example will be helpful to those who are studying or making m
650) this.width=650; "Title=" Android app uses ultrasound to get user privacy Android apps use ultrasound to get user privacy "alt=" Android apps use ultrasound to get user privacy Android
() {@Override Public voidOnCheckedChanged (Radiogroup Group,intcheckid) { //TODO auto-generated Method Stub//Setting the contents of the TextView displays the selection result of the checkboxSetText (); } }; Private voidFindview () {//TODO auto-generated Method Stub//get the corresponding control object by FindviewbyidRadiogroup1 =(Radiogroup) F
// Accept Messages sent from a child thread Handler New Handler () { @Override publicvoid handlemessage (Message msg) { // // to perform received notifications, the update UI is executed in the same order as the queue, i.e. FIFO Super . Handlemessage (msg); Bundle B=msg.getdata (); }Create a child threadThread thread =NewThread (NewRunnable () {@Override Public voidrun () {//TODO
1. View note Set to final type such as Final view layout= ...2, Get the text box object when the format EditText e = (EditText) Layout.findviewbyid (r.id);//Here's the layout. The final View objectYou can't get the text in the dialog box without paying attention to it!private void Getwifiinfo () {TODO auto-generated Method Stub/*** The default style is used when
Private String getappversion () {Packagemanager _packagemanager=getpackagemanager (); try {PackageInfo _packageinfo=_ Packagemanager.getpackageinfo (Getpackagename (), 0);//Can get all the information of the application return _packageinfo.versionname;} catch (Namenotfoundexception e) {//TODO auto-generated catch Blocke.printstacktrace (); return "";}}Google has defined two version attributes for APK :versi
In Android, to get the focus of the control, you need to setfocus it first and then Requestfocus.Take button as an example:Btn.setfocusable (TRUE);Btn.setfocusableintouchmode (TRUE);Btn.requestfocus ();Btn.requestfocusfromtouch ();Get a lost focus listener Btn.setonfocuschangelistener (New Onfocuschangelistener () { @Override public void Onfocuschange (View
Android basic learning: Get the current apk version
/*** Get the apk version number currentVersionCode ** @ param ctx * @ return */public static int getAPPVersionCodeFromAPP (Context ctx) {int currentVersionCode = 0; PackageManager manager = ctx. getPackageManager (); try {PackageInfo info = manager. getPackageInfo (ctx. getPackageName (), 0); String appVersionN
Recently, during registration, many apps directly enter the verification code when receiving text messages from their mobile phones. The user's automatic input is omitted on the interface. This is really user-friendly, so I made a new one myself.
Steps:
First, I used ContentObserver to listen for text messages. (You 'd better know the verification code sent from that number)
Then, you can get the verification code from the group that uses regular expr
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.