I am trying to build Android OS. I've set up my machine and everything is going on fine, but selecting the device configuration is my concern. When I type lunch, I get:
1 arm-eng
2 aosp_shamu-userdebug
3 aosp_fugu-userdebug
4 aosp_flounder-userdebug
5 aosp_hammerhead-userdebug
6 aosp_flo-userdebug
7 aosp_deb-userdebug
8 full_manta-userdebug
9 full_mako-userdebug
10 full_grouper-userdebug
11 full_tilapia-userdebug
12 full_maguro-userdebug
13 aosp_toro-userdebug
14 (toroplus) aosp_toroplus-userdebug
15 aosp_panda-userdebug
16 full_wingray-userdebug
17 full_crespo-userdebug
18 full_crespo4g-userdebug
I have a device called Injoo 1s, that's what I want to use to test. How do I choose which configuration. Or, I've to write some codes to fix that. Your response would be appreciated. Thank You.
The lunch combos are configured via files called vendorsetup.sh. Your device should have such a file under <android>/device/<your-vendor>/<your-device> with the following contents:
add_lunch_combo <your-device>-eng
add_lunch_combo <your-device>-user
Related
I try to change the version while publishing a android project to my local maven repository.
Simple publishing works fine with./gradlew publishToMavenLocal.
While researching I found out that it should be possible to override the version number of my maven package on executing the publishing process. But when executing for example publishToMavenLocal -Pversion="asdf" this does not change the version in anyway. it seems like it is ignored.
I got the idea of the -Pversion flag from the comments of this post
Furthermore also the gradle docs say that it should be possible to override the version in some way when building it:
Overriding the default identity values is easy: simply specify the
groupId, artifactId or version attributes when configuring the
MavenPublication.
i don't know if i got anything wrong but is there a way to override the version of a maven package. Also publishing something like -SNAPSHOT to my local maven repo would help me a lot.
It works for me with Gradle 7.6.
$./gradlew publishToMavenLocal -Pversion=31
...
BUILD SUCCESSFUL in 1s
21 actionable tasks: 18 executed, 3 up-to-date
$ls -al ~/.m2/repository/com/foo/bar/client
total 8
drwxr-xr-x 4 johnkramer staff 128 Jan 26 18:05 .
drwxr-xr-x 5 johnkramer staff 160 Jan 26 18:05 ..
drwxr-xr-x 6 johnkramer staff 192 Jan 26 18:05 31
-rw-r--r-- 1 johnkramer staff 334 Jan 26 18:05 maven-metadata-local.xml
I am confused about the target build and sdk usage
Lets say I have this code
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
//do xyz
}
Let say that I built against API 19 (kitkat) and my target api in manifest is 19 and my minimum supported api is 9
Now if a device with API 9 runs the above code, will it crash? I expect the answer is yes becasuse it will not understand what Build.VERSION_CODES.KITKAT means. However, what's the point of the check above then in first place?
Please help clarify this
Thank you
It won't crash. Simply the code within the if won't be executed. Build.VERSION_CODES.KITKAT is a constant field, and as you can read here, the constant fields are replaced with the numbers themselves by the compiler.
lesser versions of android will use the support library, if the check for kit-kat fails, it will revert to the closest possibkle form that version supports.... via the support library...
you cannot run you app on anything less than the minimum version, but it will find a way to run with less than the target version as long as its aboe the minimum
No, it won't crash, because its Build.VERSION.SDK_INT value is 9. It simply will not enter inside your if clause. Only devices that have API version 19 or above will run your code inside the if. Build.VERSION_CODES.KITKAT is equal to 19.
The code you posted won't crash because the class Build is created and compiled for every build of your app (as the R file) depending of the target API you set in the manifest
As you setup your target API to 19, the Build class will contain the field Build.VERSION_CODES.KITKAT because it exists starting from API level 19.
I am using Apache POI in my android application to read xlsx file stored in SDCARD.
I am using following jar libs from Apache POI
poi-ooxml-schemas-3.9-20121203.jar
poi-ooxml-3.9-20121203.jar
But when I try to Run Android App I am getting below mentioned stacktrace.
trouble writing output: Too many methods: 66024; max is 65536. By package:
13 java.lang
1 java.lang.reflect
5 java.util
1 javax.xml.namespace
66 org.apache.xmlbeans
19 org.apache.xmlbeans.impl.values
1 org.apache.xmlbeans.impl.xb.xmlschema
2500 org.openxmlformats.schemas.drawingml.x2006.chart
1430 org.openxmlformats.schemas.drawingml.x2006.chart.impl
8767 org.openxmlformats.schemas.drawingml.x2006.main
5258 org.openxmlformats.schemas.drawingml.x2006.main.impl
86 org.openxmlformats.schemas.drawingml.x2006.picture
33 org.openxmlformats.schemas.drawingml.x2006.picture.impl
745 org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing
417 org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.impl
230 org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing
164 org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.impl
298 org.openxmlformats.schemas.officeDocument.x2006.customProperties
256 org.openxmlformats.schemas.officeDocument.x2006.customProperties.impl
617 org.openxmlformats.schemas.officeDocument.x2006.docPropsVTypes
596 org.openxmlformats.schemas.officeDocument.x2006.docPropsVTypes.impl
285 org.openxmlformats.schemas.officeDocument.x2006.extendedProperties
196 org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.impl
23 org.openxmlformats.schemas.officeDocument.x2006.math
24 org.openxmlformats.schemas.officeDocument.x2006.relationships
2 org.openxmlformats.schemas.officeDocument.x2006.relationships.impl
2076 org.openxmlformats.schemas.presentationml.x2006.main
1224 org.openxmlformats.schemas.presentationml.x2006.main.impl
1 org.openxmlformats.schemas.schemaLibrary.x2006.main
7271 org.openxmlformats.schemas.spreadsheetml.x2006.main
4556 org.openxmlformats.schemas.spreadsheetml.x2006.main.impl
11448 org.openxmlformats.schemas.wordprocessingml.x2006.main
9217 org.openxmlformats.schemas.wordprocessingml.x2006.main.impl
4 schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707
1170 schemasMicrosoftComOfficeExcel
1223 schemasMicrosoftComOfficeExcel.impl
285 schemasMicrosoftComOfficeOffice
124 schemasMicrosoftComOfficeOffice.impl
2 schemasMicrosoftComOfficePowerpoint
3 schemasMicrosoftComOfficeWord
2858 schemasMicrosoftComVml
2529 schemasMicrosoftComVml.impl
[2013-11-25 21:20:32 - CRD] Conversion to Dalvik format failed with error 2
Can anyone tell where am I missing?
If you use too much code for any android app, the compilation will throw this error. The similar problem is stated and resolved here. You should split the app in parts as a plugin, in the form of a separate APK available for download. That APK would expose some component that the main app would use. There are various app on google play of such kind.
Please note that there are a number of problems when using Apache POI on Android. The one you are hitting can be solved by the so called "multiDex" feature in newer versions of Android.
There are currently two projects which try to solve most of the problems for you:
https://github.com/andruhon/android5xlsx
https://github.com/centic9/poi-on-android/ (mainted by me)
The first one is currently based on POI 3.12, whereas the second can be re-compiled with newer versions of POI more easily.
Some Java library methods like DecimalFormat.setRoundingMode have a #since 1.6 entry in their documentation.
/**
...
* #since 1.6
*/
public void setRoundingMode(RoundingMode roundingMode) {
...
}
When I tried to use this method compiled under Android 4.2.2 and JDK 1.6 with my android:minSdkVersion set to 7 as shown,
myNumberFormat.setRoundingMode(RoundingMode.DOWN);
Android Lint underlined setRoundingMode in red for me and told me that
Call requires API level 9 (current min is 7): java.text.NumberFormat#setRoundingMode
How and why can the Android API restrict which Java library methods I can and cannot use? I cleaned my project and the Lint error disappeared. My project compiled with no errors and ran on a device running Android 2.2.3 (API 8).
My program crashed with:
05-09 11:32:38.436: E/AndroidRuntime(2074): Caused by: java.lang.NoSuchMethodError: java.text.NumberFormat.setRoundingMode
The Android documentation confirms that setRoundingMode, copySign, and others were added in API level 9. Does that mean that devices running Android OS level 8 and below are specifically compiled/built with JDK 1.5?
And I can understand that. But is it impossible for the Android Support Library (or anything else) to allow us to use these methods?
Related to Rounding Half Up with Decimal Format in Android
What does Advanceable Added in API level 16 mean? And how to use those two methods in Advanceable Api?I saw this interface in Launcher source code. I am not clear about the specification in android docs.Thanks.
It means that only devices with api level 16 or above knows/can use that method/class. And will fail to run if you put the code under a device with api level 15 or lower.