Today, I used Huawei 8600 to run the project. I suddenly saw that oncreate was executed twice!How can we tolerate the existence of such a strange thing!
Of course, at the beginning, I found that the project was not going in. After printing, I found that ondestory was automatically called,That is, the project is automatically exited once oncreate-> onresume-> onpause-> onstop-> ondestory is executed.
I don't want to worry about the trouble. Then I removed ondestory, and I found that although the
Android calls call. The SMS function can be called directly or indirectly. You can set the intent attribute to achieve this:
Direct call without user confirmation:
// Call intent = new intent (intent. action_call, Uri. parse ("Tel: 10086"); startactivity (intent );
// SMS string smscontent = "ye"; // Note: SMS must be divided before being sent smsmanager SMS = smsmanager. getdefault (); List
The caller
The following methods are all tested successfully:
1. Use commands to simulate
(1) simulate incoming calls
1. Open command line CMD and enter Telnet and press Enter.2. Enter o localhost 5554Press enter to connect to emulator.3. Enter GSM call 13656563636. If OK is displayed, the call is successful (the phone number can be specified at will)
(2) simulate text messages
1. Open command line CMD and enter Telnet and press Enter.2. Enter o localhost 5554 a
In the project to have a software scoring function, a very common, very simple function, but it cost me a lot of effort. The effects you need to achieve are as follows:Would have thought that the general software will have "to score", "pro, to a favorable comment" such a function, but search on the internet did not search, asked three groups plus 5 children's shoes, analysis log, anti-compilation look at the source, finally found the URI, get him really not easy ah.[Java]View Plaincopy
If there are no new requirements for the system, direct calls are the most direct. The following describes how to call a system camera to take pictures and save images and call a system album. First, let's take a look at the core method of calling the System camera: Intent camera = new Intent (MediaStore. ACTION_IMAGE_CAPTURE); startActivityForResult (camera, 100); the data returned by the camera is obtained through the following callback method, and
... return;}
Create a Java object from C + +
Here's how:1. Creating a homogeneous object from a native method of the Java layerSteps:I. Getting classes from objectsIi. getting the ID of a class's constructor through a classIii. creating a new object based on the method ID and classvoid Jnicall Java_nativemethod *env, jobject thiz,jint i) { ... = (*env). Getobjectclass (thiz); = (*env). Getmethodid (Clazz,"","() V"); = (*env). NewObject (clazz,mid); ...
//invoking the system default browser//Reference:// http://www.cnblogs.com/zhwl/archive/2011/11/15/2249848.html // 1190000003912694 CaseR.id.tv_about_weibo://about Weibo//Open directly//Intent intent= New Intent ();//intent.setaction ("Android.intent.action.VIEW");//Uri Weibo_url = Uri.parse (Tvaboutweibo.gettext (). toString ());//Intent.setdata (weibo_url);//startactivity (Intent); //pop up a box to select a browser, select the browser and then enterIntent intent=NewIn
In the project, the last one to contact us, the request is to click the number and email address can send mail, this time to solve the solution there are two, one is to call the system to send mail software, you can add a mailbox account can send mail, the second is to use JavaMail to send mail. In the online various Baidu, also has the test, the discovery all can not send the mail, also modifies such as QQ or 163 mailbox of what management password, opened the POP3,, SMAP service, can not recei
1. Try using postdelayed (Runnable A, int time), because post puts the message in Looper and returns, but there is no other message in the looper that will be taken out immediately, so it is possible to do the operation in the run, instead of refreshing the button in time.2. In addition, the time-consuming operation of this practice is still done by the UI thread: Instead of you think of another thread.It is advisable to use the following method:Defines a thread.Class MyThread extends thread{Han
Try {classAndroid system-level API contains a lot of classes, of course, these underlying classes will be the public API link, but sometimes you may need to break through the limitations of the system to do something, then this time the reflection is a sharp weapon.This does not reflect the meaning of the reflection, give the above examples, mainly to illustrate. In the system, we can get the actual examples of the classes that exist.The private property (non-final) and private methods in the ca
In one of the previous articles, we introduced a simple camera opening function, as described in. Android Simple call camera function, to realize the open camera function, this time will be taken in front of the photo display into the ImageView, forming a complete effect to see the example Mainactivity.javaPackage Com.example.camera;import Java.io.file;import Android.app.activity;import android.content.intent;import Android.graphics.bitmap;import Andr
a person who has not used Java and Android to develop the Android application use case with C + + so library using the hello-jni of the NDK (for example), for those unfamiliar with Java and Android, it takes time and hopefully this article helps people like me, welcome to reprint: 1. Download install Android SDK and ND
-5svtmwyeaaelvavv6l8304.jpg"/>4.Copy to the Plugins/android folder in the Unity project , such as, and unzip the Zx.jar package in the bin folder650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/54/50/wKioL1R-54_x4MhpAAAqaJpMInA911.jpg "title=" 5.jpg " alt= "Wkiol1r-54_x4mhpaaaqajpmina911.jpg"/>5, set the release package reference Path, note the same as the Android class package650) this.width=650;
Cocos2d-x calls android embedded browser to open the web page, you can input the URL from the entrance, C ++ calls android api can be achieved. The method is also simple.
1. Modify CCApplication. h and CCApplication. cpp under "cocos2dx \ platform \ win32" and add functions
Header file Declaration
Void openURL (const c
1. CreateNative MethodPublic final static native int startservice ();2. Select Project Right click on Android Tools->add native support will generate JNI fileThe 3.CD user/alarmtest/bin/command enters the project's classes execution Javah Com.li.JNI package name. Class name can generate Com_yfz_jni.h file and then copy the com_yfz_jni.h file to the JNI file4 Modify Android.mk FileLocal_path: = $ (call My-dir)Include $ (clear_vars)Local_module: = Test
sort. This would almost guarantee that you'll get exc_bad_access next time you use this variable.So Android gives your JNI error (App bug) error to prevent-getting undebugable exc_bad_access. Now there is the ways to avoid this error.
You can set targetsdkversion in your manifest to version one or less. This would enable JNI bug compatibility mode and prevent any problems altogether. This is the reason so your old examples is working.
Yo
Special Links: Phone calls, SMS, Email;iphone and Android appsThe following article is mainly about how the links in the Web page are written to activate the function of the phone.For example, the page shows a phone number, when the user clicks the phone number in the mobile browser, the opportunity to pop up the dial panel, or the SMS program will start.1. CallIn Andro
Share an Android and Java tool that calls RESTful Web services restingWhen we invoke a Web service, it is often the final goal to take an HTTP response and convert it into a value object that will be rendered in the app. Resting can be used to implement this function.Resting, a lightweight rest framework in Java, can be used to invoke a RESTful Web service and transform it to respond to Java objects customi
Android calls system camera get return data
Because the project needs to call the camera, implement upload photos, such as Weibo, medium functionality. Android can be very easy to call the system camera, and return bitmap data, but a little insufficient, it returns the bitmap size is very small, the clarity is not enough, this problem will be resolved later.
After setting android: parentActivityName, click the return key of the sub-Activity. The parent Activity always calls the OnDestroy () solution,
I 've been checking this for a long time and share it with you,
The principle is very simple. An Activity declares android: parentActivityName in manifet. At this time, click the return button in the upper left corner of
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.