First, open the simulator.
Then, connect to the simulator
C: \ Users \ billgates> Telnet localhost 5554
Android Console: Type 'help' for a list of commandsOK
5554 indicates the port of the simulator on the local machine. You can use ADB devices to view the Port:
C: \ Users \ billgates> ADB Devices
List of devices attachedEmulator-5554 Device
Connect to the simulator and enter the HELP command to view help. Enter the command and press enter to view the
The Android system provides telephone-related interfaces for calling, such as obtaining the phone status and mobile phone service, as well as obtaining the phone status. Therefore, you can perform different operations based on the phone status.
This example mainly analyzes a code for automatically answering incoming calls. The code is written by someone else and learned together:
To listen to the phone stat
first, the use of command simulation(i), Analog call1. Open command line cmd and enter Telnet.2. Then enter o localhost 5,554 to return to the car and connect to the emulator.3. Enter GSM call 13549243178, display OK is successful (phone number can be arbitrarily specified)(b), Analog SMS1. Open command line cmd and enter Telnet.2. Then enter o localhost 5,554 to return to the car and connect to the emulator.3.sms send 13549545612 Hello, show OK is successful (phone number can be arbitrarily spe
the files obtained in (1) (2) and the generated apk in a folder, go to this directory, perform the signature operation:Java-jar Signapk.jar Platform.x509.pem platform.pk8 original apk new. apk2. Refer to the JAR package project compiled by Android source code, directly using the callMethods to invoke directly:Phonefactory.makedefaultphones (context);Phone p = phonefactory.getdefaultphone ();CallManager cm = Callmanager.getinstance ();Cm.registerphone
the hover window to get a click event.In addition modify Androidmanifest mainactivity (Android.intent.action.MAIN) for the activity that you need. The default is untiyplayernativtiactivtiy when exporting.Problems found:When running with Eclipse or packaging the installer apk, in the Unity C # codeThe #if Untiy_editor was established. Other words. You need to write the relevant code for Android execution directly instead of the macro definition.I just
I have been studying the implementation of voice calls recently. Now I have recorded my Implementation ideas here. However, this is a simple idea and a learning conclusion after Google and Baidu because of the first access to voice calls.
I think a voice call system has at least four modules. These are PCM (Pulse Code Modulation) Speech collection, encoding/decoding, network transmission, and audio playback
savedinstancestate) {super.oncreate (savedinstancestate);//Setcontentview (R.layout.main); TextView TV = new TextView (this), Tv.settext ("" +intfromjni ()); Setcontentview (TV); public static native int intfromjni ();//Port static {system.loadlibrary ("Myfirstjni");}}Where Intfromjni is the function to be called from so. We need to generate. h files for so files first.3. Jump to the Android project's bin\classes directory via Cygwin and enter the J
and C + + execution performance is far above Java, such as to invoke some of the driver class interface, such as ...
This article demonstrates how Java calls C + + code, which is the use of JNI.JNI layer, can be divided into the upper Jni, with the lower JNI.The JNI upper layer is implemented in Java, and the JNI lower layer is implemented in C + +.The approximate invocation relationship is this:The implementation of the JNI upper and lower laye
), ContentProvider added a new method that can be used to make cross-process method calls, as defined in the ContentProvider method:Bundle call(String method, String arg, Bundle extras)In terms of ease of use, this is not aidl so troublesome, and more extensibility, and no broadcast too dependent on the system, API 11 should be the main drawback, and other shortcomings temporarily did not find, welcome to add.
BroadcastBroadcast is the simplest: t
To listen to Android calls and answer calls, you only need to write a receiver inherited from broadcastreceiverimport android in step 2. app. service; import android. content. broadcastreceiver; import android. content. context; i
Android calls camera error setParameters failed deep Parsing1. Camera
Camera is supported in the Android framework and allows you to take photos and videos. Therefore, you will always encounter some problems when using camera development, such as the following:
E/AndroidRuntime (1542): java. lang. RuntimeException: setParameters failedE/AndroidRuntime (1542): at
;....\build\intermediates\classes\debug [ Your package name + class containing the native method]Mine is:g:\demo\qrreinrein\app\src\main>javah-d Jni-classpath D:\sl\android-develop\android-sdk-windows\platforms\ Android-22\android.jar, .... \.. \build\intermediates\classes\debug Com.cirein.qrcode.QRCodeManagerWhen finished, a JNI file is generated under the Mian
can set the encoding of the audio * Audioencoder Inner class defines two encodings in detail: Audioencoder.default, AUDIOENCODER.AMR_NB */Mediarecorder.setaudioencoder (MediaRecorder.AudioEncoder.DEFAULT); /** * After setting the recording, save the location of the audio file */mediarecorder.setoutputfile ("FILE:///SDCARD/MYVIDO/A.3PG"); /** * Be sure to call the Prepare method before you call start to start recording. */try {mediarecorder.prepare (); Mediarecorder.start (); }
bad things go ahead ...} catch (FileNotFoundException e) {TODO auto-generated Catch blockE.printstacktrace ();}Break}}Super.onactivityresult (Requestcode, ResultCode, data);}Don't be happy, it's too early, and the key question:The above code as long as you can use Google, generally can find to piece together. However, just like this, you will also get an unknown error ... Samsung's system camera, layout is flat, if your activity happens to be vertical version, then get this callback URI, it is
#endifFourth step: Writing C codeNote that the C code must be written in the same way as the previous header file, which differs from the normal C function.1#include"HelloJNI.h"2#include 3 4JniexportvoidJnicall Java_hellojni_printhello (JNIENV *env, Jobject obj) {5printf"Hello world!\n");6 return;7 }8 9JniexportvoidJnicall java_hellojni_printstring (jnienv * env, jobject obj, jstringstring) {Ten Const Char*str = (*env)->getstringutfchars (env,string,0); Oneprintf"%s!\n", str); A ret
, right-click, select Build Path, and then select Configure Build Pathxxxxx. On the right side of the popup dialog box, select the Order and Export tab. Tick the KSOAP2 jar package you just added, then select OK)As follows:Once the package is successfully imported, you can start writing code (EH, go directly to the code.) Detailed comments on the code):Layout file Main.xml:XML version= "1.0" encoding= "Utf-8"?>LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/
Sometimes, we take a picture or record a video, the library app does not recognize these newly generated files by default so open the library or video player found that the files are not found, you need to call Mediascanner scan to come out. A class was found from ffmpeg to scan media files. Public classFfmpegmediascannernotifierImplementsmediascannerconnectionclient {Privatemediascannerconnection mconnection; PrivateString MPath; PrivateFfmpegmediascannernotifier (context context, String path)
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.