signatures supported in the Cocos2d-js are as follows:
Java type
Signature
Int
I
Float
F
Boolean
Z
String
Ljava/lang/String;
ParametersThe parameters can be 0 or any number. You can directly use number, bool, and string in js.ExampleWe will call the static method in the Test class above:// Call
this object. This object can also call the method in JS.
webView.addJavascriptInterface(new Contact(), "contact");
The complete sample code is as follows:
:
MainActivity:
Import android. app. activity; import android. content. intent; import android.net. uri; import android
Customize a pretty practical lock screen app, if you can win the user's approval, replace the system with the lock screen, is definitely a small day live entrance. This time is just a summary of the difficulties in the recent research on the Android platform's lock-screen app development.
First, the preface
The general principle of the lock screen is very simpl
server, and then the server has registered the AIDL on the system used by the client (that is, once installed and run ), then the client can remotely bind and call the service on the server. The specific steps are as follows: 1. first, it is Server 1) Create an android Application Project 2) create an AIDL file in the bag where the main Aitivity is located, this is an ADT that will automatically generate a
Method 1:
Many applications have a startup interface. You are welcome to gradually hide the image. There are two methods to achieve this effect (only two methods are found at the moment)1. When two activities are used, load the first Activity when the program starts, and then call tick to trigger another Activity after N seconds.2. You can use the View. gone () method to use an Activity. Removes some elements of Acitivity.
1. Two activities:First, And
finish all the activities in the stack when the program exits. This method is described in my previous articles.The essence of the first two methods is that you need to design a stack to manage the interface or Activity, so that the program is more complicated. The method in 3rd is to first let the program go to the Home interface and then kill process: the code is as follows:Java codeIntent intent = new Intent (Intent. ACTION_MAIN );Intent. addCategory (Intent. CATEGORY_HOME );Intent. setFlags
has to prevent the restart ....Luck is really good, just have this attribute:android:configchanges=["MCC", "MNC", "locale", "touchscreen", "keyboard", "Keyboardhidden", "Navigation", " Screenlayout "," Fontscale "," Uimode "," orientation "," screensize "," Smallestscreensize "]The official explanation is this:Lists configuration changes that the activity would handle itself. When a-configuration change occurs at runtime, the activity was shut down and restarted by default, but declaring a Conf
An Android application is typically comprised of the following 4 components:
Activities (activity)
Intentions (Intent)
Services (Service)
Content provider (contents Provider)
These 4 components are the basis for Android app changes, but not every Android application must contain this 4 compone
Android app architecture design 02, androidapp
Ii. Try to place the tool class and BaseActivity in the specified position during the opening process,
DateFormatBitmapNotificationShared PreferenceEnvironmentDevice
III:2.2 Task Management
The thread is just a mechanism to ensure that the tasks we want to complete do not run in the UI thread (that is, do not block the UI). The completed tasks are the core of
In this paper, we introduce the content of Android to Judge app state by the way of illustration, as follows:
To understand this piece, first of all need to understand some concepts, app,process,task
1.process is the process, the concept of Linux.
2. A generic app has a UID, runs in a process, and if the
verify the legitimacy of these data.
Zip unzip the directory to cover the risk. Allow in Zip: /.. /file such a path. If you unzip to the current directory, it is possible to overwrite the files in the parent directory.
Android components improper exposure, do not need to export the need exported = False.
Local port open issue, Socket server. Try not to open this interface. If you want to, also just bind to 127.0.0.1, do not expose to the
starting mainactivity.The result of the ADB shell am start-w packagename/mainactivity return is the standard application startup time (note that the phone before Android 5.0 is not WaitTime this value):
? adb shell am start -W com. Media. Painter/com. Media. Painter. Paintermainactivity
Starting:intent{ act=android.. Action. Maincat=[android
to set the page to set the language type effect. After discovering that a new locale has been set for the current system, not only has its own application language changed, but all of the system's applications have changed. This must be unreasonable. Perhaps you will say, when exiting the app, the big deal again to change the language back. But in Android, the reasons for killing the
Project requirements: 1. Create a system application TestAPP. The application starts a service after it is started. The service provides data interfaces for other applications.
2. Add a method to the acitivity source code and call the TestAPP method in the system application for data interaction.
1. Add the aidl file under the frameworks/base/core/java/android/app
In normal android application Development, most of them only call the APIs in framwork for application layer coding. in system development, you may add system services by yourself;If any system service is added, how does the service call the native code, and how the service is called by the manager? Here is a demo of result verification.1. Compile native code, fr
Android 4.4 power-saving technology details: How to Develop a power-saving app, android4.4
With the launch of Android 4.4, Google said it had improved its power-saving technology! Let's take a look at the changes in the power-saving technology of Android 4.4!
Test conclusion:
1) screen-off standby power-saving:
A) Any
The context plays a very important role in the development of Android apps, Like starting an activity. You need to use the Context.startactivity method to convert an XML file to a view object, and you need to use the context object, so to speak, if you leave this class, Android is nowhere to go, how much do we know about such a class? 。 I will tell you how I feel, in the beginning to learn the development o
Compiling base-class BaseActivity for Android App Framework Design
Compiling base-class BaseActivity for Android App Framework Design
Write base-class BaseActivity-Sub-classes in OOP can share parent classes to improve code reusability.-You need to compile the base class based on the actual project. Some may be very si
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.