Features development for Android in Titanium
The other day I released my first application for Android written in Titanium Appcelerator and I want to share some of the nuances associated with development under Android.
The overall process is quite well described in the official documentation, so it is omitted.
Special, if not set default options in tiapp.xml:
1. If your program when run shows the network activity is under the emulator it will crash immediately after displaying the splash screen. Is treated by adding the following line to common block
the
<property name="ti.android.fastdev" type="bool">false</property>
2. Manifest:
the
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest android:versionCode="4" android:versionName="1.2" android:installLocation="preferExternal" package="com.company.appname">
....
</manifest>
</android>
I totally understand the logic of the introduction of the two versions, but the fact remains — for the Play Store, you need to specify two versions — one i.e. the version of the binary versionCode (clients can't see it, must be an integer, ideally incremental), the second official version of your app versionName (what customers see).
In addition, there is need to specify the package which is the project id.
And you have the option installLocation. For the emulator it is necessary to put only internalOnly — otherwise when you try to install on the emulator will generate an error. For release on PlayStore I recommend to put preferExternal, so as not to clog the internal memory in the device.
Code:
1. Width of objects on the screen — it's best not to try to bind to a fixed width and in General to forget about the attribute width. Instead, use left & right.
2. Colors need to specify only in the form #rrggbb. Type options #fff does not work! And estate if you accidentally append extra character — also will not work (on iOS with the same code such problems are not present).
3. If you are using a standard module facebook should consider that
the
fb.addEventListener('login', function(e) {
// Some code...
});
when you download the app on Android is NOT called automatically! (On iOS will be called automatically if the application was previously authorised).
Miscellaneous:
1. Android SDK — everything is just collected under 4.2 or 4.3 and everyone is happy. Under 2.2 in my case everything works fine.
2. Podpalennye modules for Titanium — if you do not have the basic functionality there is a decent base modules extend the capabilities. They are all available in the titanium marketplace. You can also write your own.
3. Android supports a "rubber" images called 9-patch. More about them can be read here:
developer.android.com/tools/help/draw9patch.html
radleymarx.com/blog/simple-guide-to-9-patch
a Little bit of PR ;)
I beg to love and favor (and completely free):
play.google.com/store/apps/details?id=com.sukharenko.bfriends
The point is simple — log into facebook/vk/4sq/instagram, click on Bump, and "knock" the phone to each other (Used module Bump — bu.mp). After authorization and transfer ID-schnick, the app adds an automatic new contact as a friend on vk/4sq/instagram and allows you to open facebook app on the received profile. Alas for FB only in this way — limits API :(
The original idea was this — you meet new people, but often when trying to find a person in a social network get too many results (try to find e.g. John Smith at the same vk), which is usually very uncomfortable. In my application the exact contacts will be transferred and added automatically.
PS the Program requires revision, in particular in the region of the interface — I'm working on it. Constructive criticism is welcome!
Комментарии
Отправить комментарий