понедельник, 6 июля 2015 г.

Library as aar file

CREATING AAR
in build.gradle of the library:

apply plugin: 'com.android.library'

aar can be found in build/outputs/aar/ 

USE
in build.gradle of the project:
repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    compile(name:'cards', ext:'aar')
}

Do-not-forget proguard settings

http://proguard.sourceforge.net/manual/examples.html#stacktrace:
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable

пятница, 22 мая 2015 г.

Android app stress testing. Monkey.

http://developer.android.com/tools/help/monkey.html
You'll need an emulator or an ADB-connected device.
It's a command line utility. To start it:

$ /Users/Username/Library/Android/sdk/platform-tools/adb shell

Start pushing events (an example for 500 events):
monkey -p your.package.name -v 500

Enjoy your phone's life:)

Android SDK location on OS X

Default path is /Users/username/Library/Android/sdk

You can change it via File -> Project structure -> SDK Location in Android Studio

понедельник, 15 сентября 2014 г.

Library projects cannot include raw assets


The tools do not support the use of raw asset files (saved in the assets/ directory) in a library project. Any asset resources used by an application must be stored in the assets/ directory of the application project itself. However, resource files saved in the res/ directory are supported.


И никаких шрифтов в assets библиотек больше!

четверг, 21 августа 2014 г.

XML shapes in Android L

This would work in pre-L android:


    android:shape="rectangle" >

            android:angle="270"
        android:color="@color/orange" />

            android:bottomLeftRadius="5dp"
        android:bottomRightRadius="5dp"
        android:topLeftRadius="5dp"
        android:topRightRadius="5dp" />




But in Android L you would see... nothing. To fix it you should always use selectors. You'd get the result this way:




   
           

           
       

вторник, 29 июля 2014 г.

Decoding AndroidManifest of an apk archive

1. Get apktool + helper script for your OS https://code.google.com/p/android-apktool/downloads/list
2. Put them + apk file together to the directory
3. Print
apktool d MyApp.apk ./MyApp


Thanks http://stackoverflow.com/questions/4191762/how-to-view-androidmanifest-xml-from-apk-file