Posts

Showing posts with the label app

How to do Flip Animation in Android

Image
In the last  post , I list a category of Animations in Android platform, that’s my road map to learn android animation and this post will give a specific live example about the flip transformation which is really common in our apps. In the last post, I list the two kinds of animation strategies in Android, Animation and more powerful Animator. Both of them can implement the flip animation in our case, and my purpose is to compare those two ways. Animation We can’t use the predefined Animation subclass directly, there are scale, rotate, alpha and translate Animations, but we can’t use rotate animation to build the card flip effect. We should subclass Animation class to define the flip effect. package suzp1984.github.io.exapidemo.animation import android.graphics.Camera import android.view.animation.Animation import android.view.animation.Transformation class FlipAnimation(fromDegre: Float, toDegre: Float, centerX : Float, centerY : Float) : ...

Android Animations

Image
This article is intended to collect and summarize the topic of Animations in Android. In order to reach an excellent UX design, it is necessary to employ Android’s animation API to improve the details of the UI. Before the details of the Android Animation, I want to recollect the history of Android’s evolvement in Animation API. Before the Android 3.0, it is a wild time, the uncivilized Animation packages dominate the wild field, it is the android.view.animation package. Then the property animator appears at Android 3.0 release, the property Animator is much advanced than Animation, it can animate not only the visible view properties but also any values by ValueAnimator, it is the android.animation.Animator package, much more details can be read from the following sections. Besides the universal Animator, another ViewGroup animation API appeared at Android 3.0, it is the LayoutTransition which was used to animate the layout change event. Then, at Android 3.2, we can animate F...

Android Account Manager

Image
Android Account Manager Table of Contents the begging of an Internet mobile app Account Management Demos 1 the begging of an Internet mobile app The first component that an Internet startup needs to build is its user system. How to expand his users in an easily, convenient and user-friendly way, and how to develop its account system in a scalable method? The account system is the crucial and the most important part of a company, most of the content and service provider companies always develop its account systems followed the oAuth standard. There are third party authentication plugins, like stormpath and Auth0 targeted into those account management field, you can build your web app above that service. For an Android mobile developer, there are already a middle-ware in API level, AccountManager. Take a glance of Account preference in the Setting App, and experience how Gmail, Youtube, and G+ works with multi-shared google accounts and switch between them i...

JBIG Android library published

Image
JBIG Android library published Table of Contents Design details Where it come from? Include the dependency into your gradle script Start to use it Please jump to jbig-android 's home page . 1 Design details jbig-android is just a JNI level wrapper of jbig-kit , so it inherited its License as GPL v3. If you are a newbie of JNI programming, you can refer my JNI tutorial . Basically, JNI part is the key of porting jbig-kit to android platform. Beside the core implementation of this project, the sample code pleased me the most. I tried to wrote it in an MVC way, which took me the most time, and it succeeds, Maybe I will use another post to describe this MVC paradigm and its apply in Android App. Of course, I learned this way and copy it from Chris Banes's sensational work philm . 2 Where it come from? About years ago, I met this problem, the format of hand write a signature in bank related system, like a POS. The customer sign in the screen(LED) ...

How to extract or backup apk from android system?

As an android developer, I always wanna hack awesome app to learn its design inside. The first step of that is to get the APK file itself, and the obvious way to do that is to extract it from our android phone. There are two ways to make that, both of them need no root privilege. 1. Use android adb backup command adb shell pm list packages adb backup -apk com.google.android.wearable.app dd if=backup.ab bs=1 skip=24 | python -c “import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))” | tar -xvf - 2. Use adb package management cmd  adb shell pm list packages  adb shell pm path com.google.android.wearable.app  adb pull /data/app/com.google.android.wearable.app-1.apk

Android's Package Management System

Image
Android's Package Management System Table of Contents How to resign an android app? How to install an android apk? android package management system. How to get an app's certification? 1 How to resign an android app? Android apk's digital signature strategy just employs the java's jar package method. So We can use java's keystore and jarsigner tools to sign an apk. And the first step is to generate a valid certification: make your own keystore keytool -genkey -v -keystore iboxpay.keystore -alias ibox -keyalg RSA -keysize 2048 -validity 100000 please remember the store password and key password, I always set them the same one. then before to resign an apk, I should remove its original signature first. remove apk's digital signature zip -d whatever.apk "META-INF/*" After that, I can sign that apk by our own certification. sign apk by jarsigner jarsigner -verbose -keystore iboxpay.keystore -storepass 123456 what...

Reverse Engineering Android apk

Image
Reverse Engineering Android apk Table of Contents Background Apktool dex2jar + JD-GUI 1 Background Here is my puzzle at this moment, my superior gave me a task to make Bluetooth Low Energy product which includes Android APP part, but there are no virtual designer and product manager, just myself as a software engineer. So, my first step is to found out a similar product and refer its design. Then, I need to decompile that app, some reverse engineering skills of Android app and java are necessary. I guess following two methods are enough to decompile an Android app. 2 Apktool ApkTool is a tool for reverse engineering Android apps, what it is pretty good at is to decode resources to nearly original form and rebuild them after some modification. But the java code part is decompiled into the smali format, which is not a good format to read and understand. 3 dex2jar + JD-GUI Apktool can not generate readable java source code, actually, there are no re...

Mobile APP development team composition

Image
Android APP development team composition Table of Contents Android APP team Exploration Stage Team Structure Acceleration Stage Team Structure Innovation Stage Team Structure 1 Android APP team Recently I have a job to develop an Android APP, this one is not a toy app anymore, it is a serious product. In the former time, When the superior dispatch an app task to me, most of the time, I did not worry about the user interface or UI design, I just need to finish the job by my way, just ignore the ugly interface, because most of the jobs are just test or research oriented. But this time is different, I need to develop a serious product. How can I make a product by myself? So I try to figure out the quality of the good team to make an awesome app. Then I found the following link to answer my question: http://www.slideshare.net/Mutual_Mobile/maturing-your-mobile-development-team This article provided three stages of Team structure, which can be a reference to ru...

Light_BLE - a practical APP tool to develop Bluetooth LE device

Image
Light BLE APP Table of Contents What is Light BLE APP? The Advantage of this APP Why I make above improvement? Source Code 1 What is Light BLE APP? It is an enhanced android app to communicate with Bluetooth LE peripheral. This app may be useful in Bluetooth Low Energy peripheral equipment development. It is based on an example in Android's SDK source code sample which located in sdk/samples/android-19/connectivity/BluetoothLeGatt/ , but that example sucks(yeah, Light BLE  sucks too, but much better than that sample). 2 The Advantage of this APP Following is what I improved based on that sample. Change the LocalService and Activity communication mechanism from broadcast intent into callback hooks. Add RSSI signal detects. Add write characteristic dialog(still need to improve). 3 Why I make above improvement? Broadcast Intents was not dependable, I guess that's the reason that I missed a lot of messages. So I studied the communicat...

How to write Android Service?

Image
How to write Android Service? Table of Contents Two kinds of Services in Android Local Service Remote Service Broadcast 1 Two kinds of Services in Android When we wanna make an Android app, we should put the time-consuming jobs into a service, actually, there are two kinds of services in Android, Local Service, and Remote Service. The difference between them is that whether they are running in the same process as the app, the local Services are running in the same process as the app, while the remote Services are running in the separate process, and I just need to add the following attribute to the AndroidManifest declaration to announce a remote service, it is a local Service without this attribute. android:process=":remote" After We build the Service, We need to communicate with this object, send a message to Service is obvious, I just need to bind to that Service. But how to receive announcement and messages from the Service, the mechanisms to do ...