精品欧美一区二区三区在线观看 _久久久久国色av免费观看性色_国产精品久久在线观看_亚洲第一综合网站_91精品又粗又猛又爽_小泽玛利亚一区二区免费_91亚洲精品国偷拍自产在线观看 _久久精品视频在线播放_美女精品久久久_欧美日韩国产成人在线

Titanium中Android模塊開發:移植到1.8版本上

移動開發 Android
伴隨著Titanium Mobile 1.8.0.1的發布, 對于Android的支持改變成支持多個Javascript引擎(V8和Rhino). 這個變化也影響了很多的APIs和第三方modules. 盡管平臺的變化, 大多數內部module需要修改的地方也就是簡單的方法標記,類型重命名, import 位置。

官方地址:Android Module Porting Guide for 1.8.0.1

概要

伴隨著Titanium Mobile 1.8.0.1的發布, 對于Android的支持改變成支持多個Javascript引擎(V8和Rhino). 這個變化也影響了很多的APIs和第三方modules. 盡管平臺的變化, 大多數內部module需要修改的地方也就是簡單的方法標記,類型重命名, import 位置。

Manifest變化

開發在Titanium Mobile 1.8.0.1 (或者更高)的第三方modules需要在module manifest中設置一個新的屬性:apiversion,值為2.

引用

apiversion: 2

如果你創建一個新的第三方module的話,Titanium Mobile 1.8.0.1會為你的工程自動生成這個屬性,但是,如果是已經有的工程的話,你需要手動的添加這個屬性,而且確保你重新編譯你的module(參照下邊的Build變化):

引用

$ ant clean && ant

Build變化

為了能使用新的V8引擎,所有的第三方Module都需要Android NDK來編譯V8,可以從Google下載獲取最新的NDK::

http://developer.android.com/sdk/ndk/index.html

編譯Module之前,需要設置環境變量ANDROID_NDK:

引用

$ export ANDROID_NDK=/path/to/android-ndk

$ ant

當然,你也可以在build.properties中設置android.ndk屬性:

引用

android.ndk=/path/to/android-ndk

你還得更新你的build.properties文件(如果使用Eclipse的話也要更新.classpath文件)來引用Titanium Mobile 1.8.0.1 和 API level 8 或者更高::

引用

titanium.sdk=/Library/Application\ Support/Titanium/

titanium.os=osx

titanium.version=1.8.0.1

android.sdk=/usr/android-sdk

titanium.platform=${titanium.sdk}/mobilesdk/${titanium.os}/${titanium.version}/android

android.platform=${android.sdk}/platforms/android-8

google.apis=${android.sdk}/add-ons/addon_google_apis_google_inc_8

基本變化

1. Remove TiContext.

TiContext is being replaced, and any implementation utilizing TiContext will take a performance / stability hit compared to using the desired API's directly.

In most of the places where TiContext is used as an argument, the TiContext argument can be removed entirely or replaced with an Activity reference.

Example:

Js代碼

  1. TiDrawableReference.fromUrl(proxy.getTiContext(), tiImage)

becomes:

Js代碼

  1. TiDrawableReference.fromUrl(proxy.getActivity(), tiImage)

In the specific case of fromUrl, the following form can also be used:

Js代碼

  1. TiDrawableReference.fromUrl(proxy, tiImage)

The specific alternative varies based on which API point is being modified, but generally there is a very simple alternative that can be used.

2. Use KrollFunction instead of KrollCallback

KrollFunction has been added, and KrollCallback has been removed; The dual runtime change required a common interface to be defined to replace KrollCallback.

In most cases, a direct replacement of KrollCallback with KrollFunction should suffice.

主要變化

Known compatibility points that need to be changed:

1. Remove KrollInvocation as a method argment.

Example:

Js代碼

  1. @Kroll.method
  2. public void myMethod(final KrollInvocation invocation, KrollDict args)

becomes:

Js代碼

  1. @Kroll.method
  2. public void myMethod(KrollDict args)

2. Remove TiContext from your module constructor. super(TiContext) will no longer work due to the previously mentioned TiContext change. In most if not all cases, simply removing the argument will address the problem.

Example:

Js代碼

  1. public BoxModule(TiContext context) {
  2. super(context);
  3. }

becomes:

Js代碼

  1. public BoxModule() {
  2. super();
  3. }

3. When replacing KrollCallback with KrollFunction, you need to to pass a KrollObject argument to the call and callAsync methods.

Example:

Js代碼

  1. KrollCallback success = (KrollCallback)args.get("success");
  2. ...
  3. success.callAsync(event);

becomes:

Js代碼

  1. KrollFunction success = (KrollFunction)args.get("success");
  2. ...
  3. success.callAsync(proxy.getKrollObject(), event);

4. Change getView() on a TiViewProxy to getOrCreateView()/

Example:

Js代碼

  1. View view = myViewProxy.getView();

becomes:

S代碼

  1. View view = myViewProxy.getOrCreateView();

5. Change TiDrawableReference.fromUrl(proxy.getTiContext(), tiImage) to TiDrawableReference.fromUrl(proxy.getActivity(), tiImage) due to the TiContext change. Same applies to all the "from<source>" methods in TiDrawableReference.

Example:

Js代碼

  1. TiDrawableReference ref = TiDrawableReference.fromBlob(context, blob);

becomes:

Js代碼

  1. TiDrawableReference ref = TiDrawableReference.fromBlob(getActivity(), blob);

6. <KrollInvocation>.getActivity() no longer exists. getActivity can be called on each proxy to get the activity for that proxy or TiApplication.getAppCurrentActivity() and TiApplication.getAppRootActivity() can be used for getting activity instances to work with. In general, system services, etc., can and should use the root activity if it exists. TiApplication.getRootOrCurrentActivity() will serve this purpose in the vast majority of situations.

Example:

Js代碼

  1. Activity activity = invocation.getActivity();

becomes:

Js代碼

  1. Activity activity = TiApplication.getAppRootOrCurrentActivity();

7. Calling addOnLifeCycleEvent on a module is no longer necessary. Modules are now automatically registered to receive the lifecycle events (onPause, onResume, onStart, onStop, and onDestroy).

8. <KrollEventManager>.addOnEventChangeListener() is no longer supported. The new mechanism for this is to override KrollProxy.eventListenerAdded, and move the code from the listenerAdded method into the overridden eventListenerAdded method after the call to super.eventListenerAdded.

Example:

Js代碼

  1. @Override
  2. public void eventListenerAdded(String type, int count, KrollProxy proxy)
  3. {
  4. super.eventListenerAdded(type, count, proxy);
  5.  
  6. // this is the logic that used to live inside the listenerAdded() method
  7. if (MY_CUSTOM_EVENT.equals(type)) {
  8. invokeMyCustomMethod();
  9. }
  10. }

9. resolveUrl has been moved to the proxy object.

Example:

Js代碼

  1. _proxy.getTiContext().resolveUrl(url);

becomes:

Js代碼

  1. _proxy.resolveUrl(url);

10. Change getModuleById to getModuleByName and specify the module name in the module constructor. By default the module cannot be found by calling getModuleByName. You must use the form of super() in the module constructor that allows you to specify the module name.

Example:

Js代碼

  1. public myModule(TiContext tiContext) {
  2. super(tiContext);
  3. }
  4. ...
  5. TiApplication appContext = TiApplication.getInstance();
  6. MyModule myModule =(MyModule)appContext.getModuleById("ti.mymodule");

becomes:

Js代碼

  1. public myModule() {
  2. super("mymodule");
  3. }
  4. ...
  5. TiApplication appContext = TiApplication.getInstance();
  6. MyModule myModule = (MyModule)appContext.getModuleByName("mymodule");

11. <TiContext>.getAndroidContext() no longer exists. If the ContextWrapper returned originally is being used to access system or app level resources, use TiApplication.getInstance() or TiApplication.getInstance().getApplicationContext() instead. To get the ContextWrapper for the top most Activity, use TiApplication.getAppCurrentActivity() instead.

Example:

Js代碼

  1. myFunction(context.getAndroidContext());

becomes:

Js代碼 <

  1. myFunction(TiApplication.getInstance().getApplicationContext());

12. getContext() on a TiProxy no longer exists because its purpose was to return a TiContext instance. This call should no longer be needed in module implementation once TiContext is no longer being passed in as an argument (the normal use case for this method).

Example:

Js代碼

  1. Context context = proxy.getContext();

becomes:

Js代碼

  1. Context context = TiApplication.getInstance().getApplicationContext();

13. Remove context from TiFileFactory.createTitaniumFile.

Example:

Js代碼

  1. TiBaseFile file = TiFileFactory.createTitaniumFile(context, fileURL, false);

becomes:

Js代碼

  1. TiBaseFile file = TiFileFactory.createTitaniumFile(fileURL, false);

14. getChangeDir is now called on the TiApplication instance.

Example:

Js代碼

  1. _proxy.getContext().getCacheDir()

becomes:

Js代碼

  1. TiApplication.getInstance().getCacheDir()

15. Overriding the fireEvent method requires a change to the method signature. The argument has changed from a KrollDict class to an Object.

Example:

Js代碼

  1. @Override
  2. public boolean fireEvent(String eventName, KrollDict data) {
  3. ...
  4. }

becomes:

Js代碼

  1. @Override
  2. public boolean fireEvent(String eventName, Object data) {
  3. ...
  4. }

16. <KrollInvocation>.getTiContext() no longer exists. TiContext is no longer needed. Some examples show this being used to get the TiApplication instance. TiApplication.getInstance() can be used instead.

17. Change usage of KrollDict in method signatures to HashMap. Dictionary values are now passed to methods as HashMap objects. If you need to access any of the KrollDict methods on the HashMap object you can create a KrollDict object from the HashMap object.

Example:

Js代碼

  1. public void myMethod(KrollInvocation invocation, KrollDict args)
  2. {
  3. TiBlob blob = (TiBlob) args.get("image");
  4. int myId = args.getInt("id);

becomes:

Js代碼

  1. public void myMethod(HashMap args) {
  2. KrollDict argsDict = new KrollDict(args);
  3. TiBlob blob = (TiBlob) args.get("image");
  4. int myID = argsDict.getInt("id");

18. runOnUiThread is no longer supported. You must explicitly manage and call your methods on the UI thread where necessary. Specifically, you can use the TiMessenger class to run code on the UI thread.

Example:

Js代碼

  1. @Kroll.method(runOnUiThread = true)
  2. public void refresh() {
  3. if (_view != null)
  4. _view.refresh();
  5. }

becomes:

Js代碼

  1. private static final int MSG_REFRESH = 50000;
  2. private final Handler handler = new Handler(TiMessenger.getMainMessenger().getLooper(), new Handler.Callback ()
  3. {
  4. public boolean handleMessage(Message msg)
  5. {
  6. switch (msg.what) {
  7. case MSG_REFRESH: {
  8. AsyncResult result = (AsyncResult) msg.obj;
  9. handleRefresh();
  10. result.setResult(null);
  11. return true;
  12. }
  13. }
  14. return false;
  15. }
  16. });
  17.  
  18. private void handleRefresh()
  19. {
  20. _view.refresh();
  21. }
  22.  
  23. @Kroll.method
  24. public void refresh() {
  25. if (_view != null) {
  26. if (!TiApplication.isUIThread()) {
  27. TiMessenger.sendBlockingMainMessage(handler.obtainMessage(MSG_REFRESH));
  28. } else {
  29. handleRefresh();
  30. }
  31. }
  32. }
責任編輯:佚名 來源: rensanning的博客
相關推薦

2012-05-18 11:12:09

TitaniumMetro UIiOS

2012-05-18 10:08:56

TitaniumAndroid

2012-05-18 11:16:42

@Kroll注解詳解TitaniumAndroid模塊

2012-05-18 10:52:20

TitaniumAndroid模塊自定義View模塊

2011-01-13 14:19:41

solarisLinux

2009-04-25 08:52:54

AndroidGoogle移動OS

2011-10-19 20:54:18

Linux MintGNOME 3

2010-03-03 16:31:42

Android SDK

2012-11-16 09:50:32

Windbg

2009-12-30 13:57:04

Ubuntu Moon

2012-04-20 11:07:12

Titanium

2019-09-18 18:26:05

2012-02-14 09:33:14

Titanium MoTitaniumUbuntu 10.0

2012-03-06 13:45:43

JavaJActor

2010-06-08 09:45:27

openSUSE 11

2012-05-07 23:45:54

FantomJavaJVM

2012-05-18 20:30:19

微軟 Android ap

2011-03-22 16:23:31

Firefox 4.0升級

2012-10-18 09:19:29

AppCan 2.0AppCan

2012-02-14 09:59:39

Titanium MoTitaniumMac
點贊
收藏

51CTO技術棧公眾號

欧美猛男做受videos| 在线免费三级电影网站| 国产精品一区免费在线观看| 久久久久久久久久国产| 三级电影在线看| www成人在线视频| 亚洲欧美一区二区三区久本道91 | 亚洲国产欧美一区二区三区同亚洲 | 天堂av在线7| 水蜜桃久久夜色精品一区的特点| 不卡av在线网站| 瑟瑟视频在线观看| 亚洲精品一区国产| 欧美中文字幕一区二区三区亚洲| 91xxx视频| 女人偷人在线视频| 国产高清在线观看免费不卡| 国产成人精品在线视频| 天天看片中文字幕| 成人激情视频| 亚洲国产精品久久| 日本一二三区在线| 国产成人免费| 色老综合老女人久久久| 成人免费视频91| 超碰在线免费公开| 日本一区二区三区在线不卡| 韩日午夜在线资源一区二区 | 精品乱码亚洲一区二区不卡| 国产野外作爱视频播放| 深夜av在线| 亚洲午夜电影在线观看| 一道本在线观看视频| 国产三级在线| 久久理论电影网| 国产精品加勒比| 99久久精品国产成人一区二区| 日韩黄色免费电影| 欧美资源在线观看| 91午夜视频在线观看| 韩日精品视频| 久久91精品国产91久久久| 蜜桃av免费在线观看| 蜜臀av免费一区二区三区| 日韩精品欧美国产精品忘忧草| 无码国产精品一区二区高潮| 国产不卡精品| 91精品国产综合久久福利软件 | 亚洲视频三区| 日韩午夜电影在线观看| 三级一区二区三区| 电影一区二区三区久久免费观看| 欧美色爱综合网| 成人亚洲精品777777大片| 天然素人一区二区视频| 欧美亚洲综合色| 天堂一区在线观看| 欧美综合影院| 欧美一区二区三区在线| 日韩欧美中文在线视频| 日本久久伊人| 亚洲国产成人久久综合一区| 亚洲国产综合视频| 亚洲国产精品嫩草影院久久av| 亚洲精品视频播放| 精品人妻无码一区二区三区| 视频一区中文| 中文字幕av一区二区| 国产在线免费av| 91精品在线观看国产| 欧美精品做受xxx性少妇| 久久国产精品波多野结衣av| 日韩一级精品| 国产成人精品久久二区二区| 真实的国产乱xxxx在线91| 久久99精品久久久久久国产越南 | 亚洲色图在线看| 久久久久久久香蕉| 三级在线看中文字幕完整版| 在线观看一区二区视频| 涩涩网站在线看| 成人高潮视频| 一本色道久久综合亚洲精品小说| 天天做夜夜爱爱爱| 亚洲精品男同| 国产精品久久久久aaaa九色| 99视频免费看| av成人动漫在线观看| 日韩欧美亚洲在线| 手机在线免费av| 日韩欧美在线视频免费观看| 狠狠干狠狠操视频| 欧美一区二区三区红桃小说| 中文日韩在线视频| 日韩av在线天堂| 奇米精品一区二区三区四区| 成人av中文| 北条麻妃在线| 亚洲福利视频导航| 在线观看国产中文字幕| 97青娱国产盛宴精品视频| 亚洲视频自拍偷拍| 精品在线视频观看| 美女一区二区三区| 国产乱子伦精品| 日本视频在线播放| 欧美日韩中文字幕在线视频| 久国产精品视频| 亚洲欧洲免费| 色与欲影视天天看综合网| 国产又粗又猛又爽又| 成人小视频在线观看| 一区国产精品| 人人鲁人人莫人人爱精品| 精品蜜桃在线看| 成年人网站在线观看视频| 久久国产一二区| 成人午夜电影在线播放| 国产原创在线观看| 欧美亚洲综合一区| 国精产品一区一区三区免费视频 | 国产精品欧美经典| 黄色免费观看视频网站| 一区二区三区自拍视频| 中文字幕欧美日韩在线| 精品人妻一区二区三区免费看 | 亚洲国产精品视频一区| 中文在线аv在线| 精品久久久网站| av激情在线观看| 麻豆极品一区二区三区| 欧洲高清一区二区| av资源亚洲| 亚洲精品理论电影| 国产一级在线免费观看| 国产精品一区二区无线| 男插女免费视频| 日本精品久久| 日韩在线视频线视频免费网站| 无码人妻精品一区二区三区不卡| 99久久er热在这里只有精品15 | 国产免费不卡| 精品亚洲一区二区三区在线播放| 国产精品成人aaaa在线| 成人禁用看黄a在线| 97超碰国产精品| 操欧美女人视频| 欧美激情视频免费观看| 亚洲欧美黄色片| 亚洲第一在线综合网站| 欧美久久久久久久久久久| 国产尤物精品| 国产在线欧美日韩| 9999在线视频| 国产午夜精品久久久| 免费污污视频在线观看| 久久久久久久综合日本| 亚洲人成无码www久久久| 蜜桃国内精品久久久久软件9| 国产成人精品久久二区二区91| 高清美女视频一区| 欧美无人高清视频在线观看| 成人黄色短视频| 国产另类ts人妖一区二区| a级片一区二区| 精品国产影院| 国产成人精品网站| 国产在线观看a| 亚洲第一视频网站| 免费黄色av片| 中文字幕五月欧美| 国产精品一区二区在线免费观看| 在线视频观看日韩| 日本高清视频一区二区三区| 国产第一精品| 久久99亚洲热视| 青青操在线视频| 欧美日韩的一区二区| 欧美成人手机视频| wwwwxxxxx欧美| 亚洲欧美日韩综合网| 综合天天久久| 老牛影视免费一区二区| 国产亚洲精彩久久| 国内成人精品一区| 大乳在线免费观看| 日韩限制级电影在线观看| 国产无遮挡呻吟娇喘视频| 国产精品久久久久精k8| 午夜性福利视频| 天堂资源在线中文精品| 成人在线免费观看网址| 日韩高清影视在线观看| 91久久在线观看| gay欧美网站| 久久亚洲国产精品| 免费国产在线观看| 日韩视频不卡中文| 久久国产香蕉视频| 婷婷国产在线综合| 三级全黄做爰视频| 久久久久久久国产精品影院| 日本特黄在线观看| 日本不卡一区二区| 99视频在线免费播放| 仙踪林久久久久久久999| 精品亚洲欧美日韩| 午夜精品在线| 国产精品综合网站| 天堂在线中文网官网| 欧美伦理91i| 日本在线天堂| 亚洲情综合五月天| 日本高清视频免费看| 制服丝袜成人动漫| 啪啪小视频网站| 精品久久久久久| 久久av高潮av无码av喷吹| 国产精品精品国产色婷婷| 中文字幕在线观看的网站| 国产白丝精品91爽爽久久| 午夜剧场在线免费观看| 日本成人在线电影网| 成人黄色片视频| 99视频在线精品国自产拍免费观看| 欧美少妇一级片| 波多野结衣一区| 欧美日韩中文国产一区发布| 欧美调教网站| 国产免费一区| 福利片在线一区二区| 91色中文字幕| 伊人久久大香| 91精品国产综合久久久久久蜜臀| 久久精品女人天堂av免费观看 | 丝袜老师办公室里做好紧好爽 | 亚洲人成人一区二区在线观看 | 国产极品一区二区| 高清日韩电视剧大全免费| 少妇高潮一69aⅹ| 国产福利一区二区| 可以看的av网址| 国产91丝袜在线播放| 亚洲综合中文网| 高清国产一区二区| 久久久久无码国产精品一区李宗瑞| 国产一区二区三区黄视频| 中文字幕一区二区在线观看视频 | 51精品在线| 久久久亚洲成人| 国内激情视频在线观看| 91av国产在线| 欧美极品影院| 国产精品入口免费视| 婷婷久久免费视频| 91精品久久久久久蜜桃| 综合成人在线| 久久riav| 精品久久久久久久久久久aⅴ| 亚洲电影一二三区| 天天综合一区| youjizz.com在线观看| 国产欧美日韩综合一区在线播放| 国产美女三级视频| 秋霞国产午夜精品免费视频| 国产一级免费大片| 国产iv一区二区三区| 欧洲一级黄色片| 国产日韩欧美高清在线| 91香蕉视频在线播放| 亚洲午夜在线视频| 中文字幕69页| 欧美情侣在线播放| 国模私拍视频在线| 亚洲人午夜色婷婷| 麻豆tv免费在线观看| 欧美激情xxxx性bbbb| 电影网一区二区| 成人a免费视频| 六月丁香久久丫| 先锋在线资源一区二区三区| 在线成人超碰| 国产二区视频在线播放| 蜜桃久久精品一区二区| 最新版天堂资源在线| 国产三级欧美三级| 久久久久99精品成人片毛片| 欧美日韩中文字幕在线| 国产精品久久久久久久一区二区| 亚洲精品一区二区三区福利| 黄网在线观看| 久国内精品在线| av在线日韩| 国产免费高清一区| 欧美gvvideo网站| 国产无限制自拍| 久久国产乱子精品免费女| 四虎精品一区二区| 国产精品第一页第二页第三页 | 欧美曰成人黄网| 性一交一乱一精一晶| 国产亚洲精品久久久久动| 欧洲中文在线| 国产精品国语对白| 极品一区美女高清| 日本特级黄色大片| 久久久亚洲人| 精品人妻伦一二三区久| 日韩理论在线观看| 一级黄色在线视频| 亚洲国产精品久久久久久| 欧美jizz18hd性欧美| 欧美综合在线观看| 18国产精品| 亚洲成年人专区| 久久精品99久久久| xxx在线播放| 午夜激情一区二区三区| 亚洲黄色a级片| 久热国产精品视频| 国外成人福利视频| 日本精品一区| 噜噜噜91成人网| 亚洲综合自拍网| 亚洲一区二区三区四区中文字幕| 国产美女明星三级做爰| 伊人久久男人天堂| 神马电影网我不卡| 欧美精品七区| 国产亚洲亚洲| 一级特级黄色片| 欧美日韩另类在线| 手机看片一区二区| 欧美激情精品久久久久久变态| 91成人app| 国产成人精品免费看在线播放| 久久er99精品| 婷婷社区五月天| 日韩无一区二区| 伊人精品影院| 999国产在线| 精品福利av| 香蕉视频污视频| 亚洲成a人片在线观看中文| 亚洲国产精彩视频| 国内免费久久久久久久久久久| 成人噜噜噜噜| av动漫在线播放| 粉嫩av一区二区三区| 日本在线视频免费| 亚洲精品国产suv| 成人免费看视频网站| 裸模一区二区三区免费| 久久九九电影| 一级黄色片网址| 欧美精品九九99久久| 菠萝菠萝蜜在线观看| 999视频在线观看| 精品成人在线| 干b视频在线观看| 欧美三日本三级三级在线播放| 免费网站成人| 999国产在线| 美女黄色成人网| 精品在线观看一区| 日韩欧美激情在线| av电影院在线看| 日韩资源av在线| 国产一区二区视频在线播放| 久久综合成人网| 亚洲人成伊人成综合网久久久 | 97在线观看视频免费| 日韩欧美在线123| 女人高潮被爽到呻吟在线观看| 日本一区二区三区免费看| 激情综合色综合久久综合| 久久精品99国产精| 亚洲欧美日韩综合| 91精品视频一区二区| 秋霞无码一区二区| 国产精品视频你懂的| 亚洲国产成人在线观看| 国产精品成人播放| 欧美在线资源| 性欧美精品中出| 欧美一区二区高清| 粉嫩一区二区| 国产日韩欧美大片| 91美女视频网站| 国产精品欧美激情在线| 97国产精品免费视频| 99久久影视| 人妻无码一区二区三区| 91精品国产色综合久久| 国产免费不卡| 男女日批视频在线观看| 国产精品嫩草影院com| 亚洲 美腿 欧美 偷拍| 91在线精品播放| 日韩**一区毛片|