Archive for the ‘Titanium’ Category

 

titanium mobile : Titanium.Platform.DisplayCaps

3月 29th, 2013

width アンドロイドはpixels, ios は dipが返されるようです。 (dip : Device independent pixel (also: density-independent pixel) Absolute width of the display in relation to UI orientation. Measured in platform-specific units; pixels on Android and density-independent pixels (dip) on iOS. http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Platform.DisplayCaps iPhone 320 x480 iPad 768 x 1024 : 720 に併せて。 なので。 android は small 320 – iphone共通 medium […]

Read full article | コメントは受け付けていません。

titanium mobile : eventlistenerの削除とか

3月 29th, 2013

tableviewでスクロールされたら画像を読込むのを作ったら tableviewrowがかなり重くなりました。ページ遷移で、rowのlistは入れ替わるのですが 古いrowを明示的に消してないからその辺が貯まっていたようで。 主な原因はrowの中でti.app.eventlistenerを使っていたことのようでした、それが全て残っていて、反応している感じ。 せっかくなので、残っているだろう古いrowをすべて削除してみる ついでに出来るだけ、eventlistenerを使わず、親オブジェクトから操作するように変更。 とても良い感じになりました。 中のオブジェクトを全て綺麗にした方が良いようです。 http://www.masaplabs.com/titanium-memory-leak/ https://wiki.appcelerator.org/display/guides/Managing+Memory+and+Finding+Leaks

Read full article | コメントは受け付けていません。

titanium sdk – android sdk min version

3月 28th, 2013

titanium 2.1.2以降は android 2.2以上で使えるようです。 http://docs.appcelerator.com/titanium/3.0/#!/guide/Titanium_Compatibility_Matrix 2.1.2 – latest 2.2 (API 8) 4.1.x (API 16) android 2.1 の IS03が本格的に文鎮化 契約が無いので 2.2へアップデート出来ない。。。誰かアップデートしてください。 別の話ですが、画面サイズ対応のため、全て数値で設定してあるデザインは、ファイルに分けた方が良いようです。 (jss使っている方は全部jssに。 androidの対応ちょっと後回しです。動作は問題無さそうだから凄くもったいない。 とは言っても大きなアプリじゃなければ一日あれば完了するとは思います。2種類くらいに対応しようと思いますが。さて。

Read full article | コメントは受け付けていません。

titanium mobile | 2,3日目

3月 27th, 2013

ロジックは、javascriptなので、特に問題ないのですが、UI作成が、肝になりそうです。 iOS用のものをそのまま使うのが、ユーザー的にも良いのですが、いろいろ試しながらヘッダーやフッターを入れてみたり 簡単な部品はだいぶ慣れてきたかなと。 メニューや枠の動きなどもいろいろ出来てきたので、もう少し整理したら公開前バージョンが出来そうです。 今更言うことでもないのでしょうが、デザイナーの方であれば、javascriptを頑張ったらかなりかっこいいアプリが作れそうです。 と思ったのですが、javascriptもobjective-cも初見であれば、学習コストに差はあまりでないのかもしれません。 javaとか慣れてる人はobjective-cのほうが楽な可能性もありますね

Read full article | コメントは受け付けていません。

titanium mobile | jssを使わずstyleを共通化

3月 23rd, 2013

titanium復帰1日目 jss入れても反映されないし、jsとキーが違うし・・・とりあえず使うの止めようと なんか無いかなと思ったら、普通にjsデータとして持たせるというのを見て、参照ではなくコピーして使いたかったので、こんな感じにしました。 node.jsもtitaniumもほぼ1日目なので、実際のところわかりませんが、ぱっと見は良い感じになりました。 スタイル用js var base_style = { label: function( _params ){ var style = { fontFamily: ‘”Hiragino Kaku Gothic ProN”, Verdana’, backgroundColor:’transparent’, color: ‘#fff’, width:Ti.UI.FILL, height:30, left:10, fontSize:14 }; for( key in _params){ style[key] = _params[key]; } return style; } }; module.exports = base_style; メインウインドウ js function ApplicationWindow() { var style; if( Ti.Platform.osname […]

Read full article | コメントは受け付けていません。

PhoneGapハジメテミル。

2月 3rd, 2012

11:06 開始。 本サイトを見てみる。 http://phonegap.com なかなかかわいいサイトです。 http://phonegap.com/about/features/ こんな機能に対応してるそうです。 下のリリースを読む。 http://www.adobe.com/aboutadobe/pressroom/pressreleases/201110/AdobeAcquiresNitobi.html adobe acquires nitobi : アドビがニトビを買います。 adobe製品と連携しているのでそっちになれている人は良さそうです。 + google groups http://groups.google.com/group/phonegap ちょうど 1.4 が 1/31にリリースされたようですね。 11:20 start いちおxcodeを更新しておく。 http://phonegap.com/start ダウンロードした、callback-phonegap-xxxx の中の lib/PhoneGap-1.4.1.dmg を開く。 PhoneGap-1.4.1.pkgを開いてインストール開始 xcode からPhoneGap-based Applicationを作成 名前を付けて Run するとbuild は成功して www/index.htmlがないよとエラーが表示される。 プロジェクトを作成したディレクトリの中には、wwwティレクトリーがある( index.html phonegap-1.4.1.js が入ってる。) Next step is IMPORTANT! Drag the www folder into Xcode 4. […]

Read full article | コメントは受け付けていません。

スワイプで戻る。swipe gesture android | titanium

11月 17th, 2011

2013/03 1年ほど前にandroid swipe実装されていました。 新記事修正版を更新。http://blog.bbtune.com/archives/2515/titanium-android-swipe スワイプで戻る。を設定してみた。 android タッチの始点と終点で・・・ resultListWin.addEventListener(‘touchstart’, function (e) { resultListWin.x_start = e.x; resultListWin.y_start = e.y; }); resultListWin.addEventListener(‘touchend’, function (e) { if( resultListWin.x_start !== ‘undefined’){ if(e.x > resultListWin.x_start) { // right backView(); // **** like swiping } else { // left } } }); http://code.google.com/p/titanium-mobile-doc-ja/wiki/Views 2013/03 1年ほど前にandroid swipe実装されていました。 新記事修正版を更新。http://blog.bbtune.com/archives/2515/titanium-android-swipe

Read full article | コメントは受け付けていません。

画面の向きを固定する orientationModes | titanium android iphone

11月 15th, 2011

orientationModesを固定してみる。 var searchWin = Titanium.UI.createWindow({ url:’search.js’, title:’Search’, backgroundColor:’#fff’, tabBarHidden:true, orientationModes : [Titanium.UI.PORTRAIT] }); Titanium.UI.orientation = Titanium.UI.PORTRAIT; http://code.google.com/p/titanium-mobile-doc-ja/wiki/guides_device_accelerometer 状態の種類は次のとおり ・Titanium.UI.PORTRAIT ・Titanium.UI.UPSIDE_PORTRAIT ・Titanium.UI.LANDSCAPE_LEFT ・Titanium.UI.LANDSCAPE_RIGHT ・Titanium.UI.FACE_UP ・Titanium.UI.FACE_DOWN ・Titanium.UI.UNKNOWN

Read full article | コメントは受け付けていません。

sleep mode setting | titanium

9月 25th, 2011

Titanium.App.idleTimerDisabled = true; これでスリープしてもアプリ自体は動き続けます。

Read full article | コメントは受け付けていません。

catch window focus for android | titanium mobile

9月 24th, 2011

http://developer.appcelerator.com/question/21191/android-window-events-not-working-with-tabgroup-titanium-12 iPhoneでは focus 等イベントを取得できますが、 Androidでは動きません・・・ タブグループからイベントを渡す方法で回避です。 tabGroup.addEventListener(‘focus’, function(event) { tabGroup.activeTab.window.fireEvent(‘focus’); }); 別に良いのですが、修正された後にいろいろ直すのもまた面倒ですね。

Read full article | コメントは受け付けていません。