Archive for the ‘Titanium’ Category

 

[titanium] [iOS] rsync failed v3.4.0

10月 27th, 2014

iOS版を更新しようとしたら。。。 archiveをvalidateできませんでした。 https://developer.appcelerator.com/question/177627/app-store-build—340—rsync-failed ということで Validate, Submitすると出る確認画面で “Include app symbols for your application to receive symbolicated crash logs from Apple.” のチェックを外すとOKでした。

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

[titanium] Titanium.App.Properties 設定値を保存しておく。

10月 26th, 2014

http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.App.Properties 初期設定をxmlに。と思ったら xmlに書いた場合は上書き出来なくなります。固定値のみと言う感じのようです。 var propName = “myprop”; if(!Ti.App.Properties.hasProperty(propName)){ Ti.App.Properties.setBool(propName, true); } と初期値を設定。

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

[titanium][android] titanium.jar not found

10月 26th, 2014

ERROR: Asset package include ‘/Titanium/mobilesdk/osx/3.4.0.GA/android/titanium.jar’ not found. [ERROR] Application Installer abnormal process termination. Process exit value was 1 After update to 3.4.0 GA nothing works any more https://developer.appcelerator.com/question/178514/ android build tools が 20じゃないとダメっぽい?感じです。 build-tools/21.0.x などを他の場所へ退避しておくと大丈夫でした。 とりあえずtitaniumだけでの利用であれば一旦削除しても大丈夫そうです。

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

[titanium] alloy config.json

9月 21st, 2014

alloyでコンフィグをつかう [http://docs.appcelerator.com/titanium/3.0/#!/guide/Project_Configuration_File_(config.json)] config.json { “global”: { “defaultTimeout”: 100000 }, “env:development”: {}, “env:test”: {}, “env:production”: {}, “os:android”: {}, “os:blackberry”: {}, “os:ios”: {}, “os:mobileweb”: {}, “dependencies”: {} } Alloy.CFG.defaultTimeout でアクセス。

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

titanium httpclient getResponseHeader ?

4月 16th, 2013

http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Network.HTTPClient   var client = Ti.Network.createHTTPClient({      onload : function(e) {        // Ti.API.info(e.source.getResponseHeaders());        // Ti.API.info(e.source.getAllResponseHeaders());      }, iOSでは getResponseHeaders Androidでは getAllResponseHeaders でheaderを全部読むことが出来るようですが、getResponseHeadersがドキュメントに載っていないのが気になるところです。

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

titanium mobile : delete remote image cache

4月 10th, 2013

http://developer.appcelerator.com/question/144356/urgent-how-to-clearreset-titanium-remote-image-cache-android この辺。 http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Filesystem applicationCacheDirectory : StringREADONLY Path to the application’s internal cache directory. iosのほうはみんな違う書き方をしているけど昔は無かったのかな? Ti.Filesystem.applicationCacheDirectory ios : Applications/00000000-0000-0000-0000-AAAAAAAAAA/Library/Caches/ これなのでiosもあっています。 Libraryの下は Cookies Preferences Caches Private Documents があって、Private Documents/databasename.sql という名前でsqliteが保存されていました。 画像は、普通に ハッシュ値.jpgの拡張子で保存されています。.をみて消している方は、ディレクトリを消しています。 特に問題ないと思いのですが、中に Cache.dbとかあります。手で全消ししても問題ないようです。 (十分テストが必要ですが) androidはexternalのときの処理が必要。 androidの処理はbanzai mobileさんのやり方を利用させていただきます。 http://developer.appcelerator.com/question/144356/urgent-how-to-clearreset-titanium-remote-image-cache-android#answer-251819 ポイントは、/_tmp/remote-cache/ですね。 全消しはなんとなくあれなので、ファイルを消す処理(getFile以外)は、iosと共通で。 iosだけだとこんな感じ dir = Ti.Filesystem.getFile(Ti.Filesystem.applicationCacheDirectory); if( dir.exists() ){  var files = dir.getDirectoryListing();  for( var i in files […]

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

titanium android swipe version 2

4月 9th, 2013

以前 touchstart , touchendで利用していたけど https://github.com/appcelerator/titanium_mobile/pull/1835/files 修正されていた。 けどswipeを入れるとscrollが止まるという欠点が発生。 どうするか ということで, androidのときは、swipeを使わないことにしました。 またtouchstart , touchendのところを少し修正。該当部分は以下になります。 iosのときは、swipeを利用しています。 Ti.API.info(‘android’) self.x_start =0; self.y_start =0; self.addEventListener(‘touchstart’, function (e) {   self.x_start = e.x;   self.y_start = e.y; }); self.addEventListener(‘touchend’, function (e) { if( Math.pow((self.x_start-e.x),2) – Math.pow((self.y_start-e.y),2) > 100 ){     if (e.x > self.x_start) {         swipe({direction: […]

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

titanium mobile : splash screen portrate only

4月 3rd, 2013

http://developer.appcelerator.com/question/143160/portrait-orientation-for-splash-screen-for-android-in-appcelerator AndroidManifest.custom.xmlのactivityを替えると。 <activity android:configChanges=”keyboardHidden|orientation” android:label=”aucru” android:name=”.AucruActivity” android:screenOrientation=”portrait” android:theme=”@style/Theme.Titanium”> こんな感じのところです。 android:screenOrientation=”portrait” を追加しました。 これ、cleanすると消えちゃうから、毎回生成する何かが必要。

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

titanium mobile : tableview hide show error

4月 3rd, 2013

https://jira.appcelerator.org/browse/TIMOB-3306 tableview を hide / showしても 中のtableviewrowに反映されないという話。 残念。setDataで空にしたり出来ますが、なんとなく効率が悪い。 他のやり方としては、hideではなくて、画面の外に追い出すというのをよく使います。

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

titanium mobile : searchbar の高さがandroidでズレる。他

3月 30th, 2013

http://developer.appcelerator.com/question/129136/searchbar-cutoff-in-android iosでは綺麗ですが、androidのsearch bar は不格好。。。 これスタイル調整重要ですね。 とりあえず高さが上にくっついているので top: (isAndroid) ? 2: 0, のように振り分ける形で良さそうです。 === http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.SearchBar androidで起動時にsearchbarにfocusがあるので、キーボードがでる。。。 searchbar.blur(); を起動時に呼び出すとかでは上手く動かない? window生成時に { windowSoftInputMode:Ti.UI.Android.SOFT_INPUT_STATE_HIDDEN } を入れると大丈夫でした。 === search return 時に blurしないとfocusが取れない。 searchbar.addEventListener(‘return’,function(){ searchbar.blur(); } ); みたいな感じで外す。 * しかし、blurが効かない・・・のでdocsにあるようにhide and showをします。 searchBar.blur(); if( Ti.Platform.osname == ‘android’){ searchBar.value = ”; searchBar.hide(); searchBar.show(); } でもなんかイマイチなので諦めます。 テキストエリアの文字を消すというのが・・・

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