开发者

How to write android code in titanium

I had been working on android since a little long. Now I am wondering about titanium. Is it possible to write android (java) code in titanium app since the app is build in titanium? If yes then how? Actually I am having problem dealing with push notification for android in titanium. So I got a solution to build开发者_JAVA技巧 complete app in titanium and then if possible use android code in app to deal with push notification. How? Please do response as quickly as possible. Thanks in advance.


To answer your question directly, you will need to develop a native Android extension to call Java code via JavaScript in a Titanium application.


Rai

You should be checking out the docs Here tells you all you need to know

Hope it helps Frank


yes it is possible but remember that the titanium tools lag behind the official android ones. Documentation is poor and often wrong, code is laggy and the resulting .apk are much bigger.

Why are you thinking of using Titanium? For cross-compatibility?

If you are thinking about that you have multiple possible ways:

1) Build a minimum common denominator, like titanium, but better: Write a core application for both android and iPhone so that it will be fast and light on memory, with a modified broswer to show your content. This way the interfaces will be much easier and you'll have to write the content just once.

Still you will be able to access low level hardware, like GPS, compass, gyroscope.... easily without consuming too much battery (unlike with titanium) as needed.

2) Find an existing minimum common denominator: Javascript work both on iPhone and Android.

3) There are many other options (Adobe air, python, custom scripting, mobile web site, ...) but I think that the cons outweigh greatly the pros.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜