operation items.
Figure 1. The operation column in the honeycomb gallery application, starting from the left, is the logo, navigation option label, and Operation item (an overflow menu button inserted on the right ).
Note: If you are looking for information about the context operation bar, see the "menu" guide.
Add operation bar
From android3.0 (API level 11), the Operation bar is included in all theme usage. when the targetsdkversion or minsdkversion
. Click OK to add the frameworks path.
If there is a code jump error, follow the steps above to add the corresponding code path or jar file to its Dependencies tab.
V. DEBUG source code
We can add the 'android framework' to the 'modules' of the newly imported project so that the AS can use it AS an Android project to facilitate code debugging.
You can follow '1' and '2' to add Android Framework support.
Add a breakpoint in the code, select 'run'-> 'Attach debugger to Android process', or direct
(1) Android. App. Fragment: the minimum compatible version is Android: minsdkversion = "11"
Therefore, your application is not compatible with applications under 3.0.
You can use the
(2) Android. Support. v4.app. Fragment: compatible with version 1.6. The ProgramIn the Add or replace method, you also need
Android-support-v4.jar
For details about how to use fragment, refer to the demo on the official website. The example is Android. App. Fra
-wrapper.properties file distributionUrl :distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-bin.zipGo to the Settings page ( Windows system in File, Settings or Mac OS X in Android Studio, Preferences ), and make sure that you choose to use the default configuration of Gradle wrapper.Then modify the module's build.gradle file from this:Apply plugin:' Com.android.application 'Android {Compilesdkversion ABuildtoolsversion"23.0.0 rc3"Defaultconfig {ApplicationID"Com.inthecheesef
Problems encountered during Android Development -- WARNING: Application does not specify an API level requirement in Android! Solution, requirement
During the trial run of the Andorid project on the mobile phone, we found that the Console printed"WARNING: Application does not specify an API level requirement! "Such warning information is shown in:
Although the normal operation of the project is not affected, you still need to find out the cause and check the cause of the warning on the Intern
this link: http://stackoverflow.com/questio... k-file-using-gradle
... signingConfigs { release { storeFile file(System.getenv("KEYSTORE")) storePassword System.getenv("KEYSTORE_PASSWORD") keyAlias System.getenv("KEY_ALIAS") keyPassword System.getenv("KEY_PASSWORD") }}
Product flavors
If a project wants to generate different APK packages with different package names or resources, it is time to use Product flavors.
android { .... productFlavors {
set the attribute value to "auto" or "preferExternal ".2. Keep the attributes of android: minSdkVersion unchanged (less than a value of 8) to ensure that the application code is compatible with this level.3. In order to compile the program, set the generation target to API level 8. This step is necessary because the old android library does not recognize the android: installLocation attribute. When this attribute exists, the application cannot be com
should be thisinclude‘:myModule‘‘:lib:abs‘With "Enclosed is the module name under Project, you can see that the module ABS is a relative path."In the third step, the following In lib/abs/build.gradle may be true:Buildscript{repositories {mavencentral ()}Dependencies{classpath ' com.android.tools.build:gradle:0.7.+ ' }}apply plugin:' Android-library 'Android{compilesdkversion buildtoolsversion "19.0. 0" Defaultconfig {minsdkversion XX targetsdkversio
facilitate code debugging.
You can follow '1' and '2' to add Android Framework support.
Add a breakpoint in the code, select 'run'-> 'Attach debugger to Android process', or directly click the icon shown in
In the displayed Choose Process dialog box, select all processes, select the Process where the code to DEBUG resides, and click OK.
Vi. Others
In the code, Call requires API Level x... is prompted because AS regards our project AS an Android Application project, and
your program is targeting a system of Version 4.1 or later (that is, minSdkVersion 16), you do not need this permission.
3. Add the permission to receive GCM messages:
4. Add the following broadcast receivers:
This Broadcast receiver is responsible for processing two Intent (com. google. android. c2dm. intent. RECEIVE and com. google. android. c2dm. intent. REGISTRATION), and must be defined in the manifest file (not implemented by encoding
displayed as a solid line.
Cause:By default, the hardware acceleration of the Activity is enabled for more than 4.0, so we can turn it off in Manifest. xml.
Solution:Add the following attributes to the activity to be displayed: android: hardwareAccelerated = "false". You can also disable View. setLayerType (view. LAYER_TYPE_SOFTWARE, null) at the View level ). Application does not specify an API level requirement
Description:Compilation times warn: Application does not specify an API level r
library, many errors will occur in this process (as shown in the bottom red box ). In this case, we need to modify the OpenCVLibrary310 \ build. gradle file, and then re-Synchronize the Gradle Configuration:
Modify the OpenCVLibrary310 \ build. gradle file as follows:
apply plugin: 'com.android.library'android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { minSdkVersion 16 targetSdkVersion 23 } buildTy
partition containing this path. * Returns 0 if this path does not exist. * * @param path * @return -1 means path is null, 0 means path is not exist. */public static long getTotalSpace(File path) { if (path == null) { return -1; } return path.getTotalSpace();}Processing cannot be compiled byIf minSdkVersion set to 8, then the build will report the following error:Call requires API level 9 (current min is 8)In order to compile can pass
In Android development, you will need to configure the minimum and target versions of the Android SDK using the app, which is the Bulidl.gradle Android module setting. The following settings are available by default:
ApplicationID, which is the app's package name, must be unique in the Google App Store and cannot be modified throughout the app's lifecycle, and will be considered a new app.
Minsdkversion, set the minimum version of the SDK tha
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.