tag:blogger.com,1999:blog-89793120446315894972024-03-13T13:07:42.799+09:00itoaぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.comBlogger28125tag:blogger.com,1999:blog-8979312044631589497.post-79608984422689419862017-11-12T05:36:00.001+09:002017-11-12T05:36:29.797+09:00ASP.NET Coreでiisresetでもセッションを維持する件Redisを使えば大丈夫だと思ったけど、ダメだったので調べたことのメモ<br />
<br />
ポイント<br />
<br />
- dotnet.exe単体動作ではRedisのみでOK<br />
- iisのバックエンドの場合はiisresetでセッションが吹っ飛ぶ<br />
- セッションidとredisのキーを紐付ける設定がiisの場合、都度変わるぽい<br />
<br />
Startup.csのConfigureServices関数にて<br />
<br />
var redis = StackExchange.Redis.ConnectionMultiplexer.Connect(Configuration.GetConnectionString("RedisConnection"));<br />
services.AddSingleton(options => redis.GetDatabase());<br />
services.AddDataProtection().PersistKeysToRedis(redis, "DataProtection-Keys");<br />
<div>
<br /></div>
<div>
的な記述を追加する。</div>
<div>
これによって、dotnet core on iis でもiisresetでセッションが飛ばないようになるぽい。</div>
<div>
<br /></div>
<div>
ちなみに、キーとなるAddDataProtection()ミドルウェアだが、</div>
<div>
<br /></div>
<div>
Microsoft.AspNetCore.DataProtection.Redis アセンブリが必要になるため、Nugetで事前にインストールが必要である。</div>
<div>
<br /></div>
<div>
<br /></div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-27974431345416313432017-05-17T11:06:00.003+09:002017-05-17T11:06:50.293+09:00自分用メモ:yeoman-generatorの実体の場所/usr/local/lib/node_modules/generator_***にある模様。<br />
探すのに時間がかかったのでメモ<br />
<br />ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-88428905975740300162017-04-24T21:13:00.001+09:002017-04-24T21:13:38.897+09:00新しいdotnetコマンドで自己展開型(self contained)なバイナリを生成するにはVS.NET 2017系になって、Dotnet coreがproject.jsonからcsprojになりました。<br />
<br />
以前は、project.jsonで自己展開型(.exeにビルドするやつ)にビルドするには、<br />
project.jsonに、以下のようにruntimesセクションを追加して<br />
<br />
"runtimes": {<br />
"win10-x64": {}<br />
"osx.10.10-x64: {}<br />
}<br />
<br />
dotnet build -r win10-x64<br />
<br />
などとコマンドラインで叩くと-r(runtimes)オプションで指定した環境向けに単独で実行できるバイナリが生成されます。<br />
<br />
VS.NET 2017では、project.jsonが廃止されて*.csprojになってしまったので、自己展開型のバイナリ生成が上記のやり方ではできなくなってしまいました。<br />
<br />
VS.NET 2017のプロジェクトのプロパティからも設定できなかったが、csprojを直接編集することでできる模様。<br />
<br />
<PropertyGroup><br />
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers><br />
<RuntimeIdentifiers>osx.10.10-x64</RuntimeIdentifiers><br />
</PropertyGroup><br />
<br />
上記のようにした上で、<br />
<br />
dotnet build -r win10-x64<br />
dotnet build -r osx.10.10-x64<br />
<br />
とコマンドラインで叩くと、指定した環境向けの実行バイナリが生成される。<br />
<br />
参考: https://docs.microsoft.com/ja-jp/dotnet/articles/core/deploying/<br />
<br />
どっちにしてもVS.NET上で指定はできないみたい。<br />
→とわいえ、VS.NET 2017からDotnet Coreサポートは大分良くなったよ!!<br />
<br />ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-28670520925934431222017-01-12T08:59:00.001+09:002017-01-12T08:59:59.458+09:00マルチモニタをやめてみた<p dir="ltr">クラムシェルをやってみたくて一時的にマルチモニタをやめてみたら意外に作業が捗る事がわかった</p>
<p dir="ltr">理由を考えたところ作業スペースが有効に使え、マルチモニタのときは狭くて使って無かった紙とペンを使うようになったことと、何より集中力が上がった気がする。<br>
目の前に余計な物がないのが良いみたいだ。<br>
マルチモニタと作業効率でググると良いことしか書いてないページばかり引っ掛かるが、シングルモニタと集中力でググると真逆のことが書かれていて面白い。<br>
マルチモニタ派の人は作業効率おしだがシングル派はかつてマルチモニタを使っていた人ばかりというのがより説得力がある。</p>
<p dir="ltr">結局は人それぞれなのかもしれないが、試しに片方のモニタの電源オフしてみるのも良いかも知れない</p>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-43192617981423342512017-01-11T09:11:00.002+09:002017-01-11T20:24:21.093+09:00Anguler2@Windows with Webpackでエラーが発生する件についてAngular2をWindows環境で実行しようと、<a href="http://blog.stevensanderson.com/2016/10/04/angular2-template-for-visual-studio/">http://blog.stevensanderson.com/2016/10/04/angular2-template-for-visual-studio/</a>からひっぱてきたテンプレートを使って動かそうとした際、<br />
node_module/to-string-loader/src/to-string.jsの16行目でjavascriptのヒアドキュメントがILLEGALなsyntaxというエラーが発生してえらく難儀したのでメモしておく。<br />
<br />
結論から言うと、node.jsのバージョンが 0.10.xxx で古かったらしく最新バージョンにアップしたら問題なく動作した。<br />
最新版は<a href="http://qiita.com/yokoh9/items/20d6bdc6030a3a861189">ここ</a>を参考に引っ張ってきた。※既にnode.jsにパスが通っている環境の場合、既存のパスの方が優先されたのでパスの調整が必要でした。<br />
<br />
また、TypeScriptのバージョンもアップ(1.5.4→2.14)した。<br />
<br />
普段はVisual Studio.Codeを使っているが、たまにVisual Studio.NETを使うのも良い気がした。<br />
<br />
追記:<br />
<a href="https://github.com/aspnet/JavaScriptServices/issues/330">ここ</a>に既出ですね。→node.js 4.X以上じゃないとダメみたいですね。ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-36119028043253412842016-11-08T20:16:00.003+09:002016-11-08T20:16:31.582+09:00typescript環境構築の自分用メモtypescript環境構築の自分用メモ<br />
<br />
yoは入れておく。<br />
yo aspnetで足場は作れるようにしておく。<br />
<br />
typings install dt~jquery --save --global<br />
<br />
とかやると typings/globals/jquery/** に型定義ファイルができる。<br />
typings/index.d.tsをrefernce指定すれば補完が効く。<br />
<br />
gulpを使うためにgulpfile.jsを作っておく。<br />
<br />
gulpfile.jsのなかみは以下のような感じ。<br />
<br />
var gulp = require('gulp');<br />
//var del = require('del');<br />
<br />
var paths = {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>unify: [<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'app.js',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'app.js.map'<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>],<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>scripts: [<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'TypeScript/**/*.tsx',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'TypeScript/**/*.ts',<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>'TypeScript/**/*.map'<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>]<br />
}<br />
<br />
gulp.task('default', function () {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>//del(['wwwroot/TypeScript/**/*']);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>//del(['wwwroot/js/*']);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>gulp.src(paths.unify)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>.pipe(gulp.dest('wwwroot/js'));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>gulp.src(paths.scripts)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>.pipe(gulp.dest('wwwroot/js/TypeScript'));<br />
});<br />
<div>
<br /></div>
<div>
delはあってもなくてもよい。</div>
<div>
ワークスペースのフォルダ構成は以下の感じ。</div>
<div>
<br /></div>
<div>
/TypeScript</div>
<div>
→ここに*.tsを入れとく</div>
<div>
/Views</div>
<div>
→cshtmlはこの下に置かれる。</div>
<div>
/Controllers</div>
<div>
→コントローラのコードはここに置かれる。</div>
<div>
<div>
/wwwroot</div>
<div>
/js</div>
<div>
ここにコンパイルされたjsが配置される。</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-39781718650274242292016-11-07T22:08:00.001+09:002017-01-11T09:13:31.202+09:00GOLANG@VS.CODE自分用メモGOPATHの設定をどうするか的な話。<br />
プロジェクトごとにルートパスが違うのでシステムに単一のGOPATHだと<br />
いやだなぁと思っていて、かと言って相対パスでローカルパッケージを<br />
指定してもvs.codeでローカルパッケージだとインテリセンスが効かない<br />
のも嫌だなぁというのをなんとか解決する話。<br />
<br />
GOROOTを.bash_profileに設定する。<br />
<br />
export GOROOT=/usr/local/opt/go/libexec<br />
<div>
<br /></div>
<div>
.bash_profileにcode .とうつと起動するように仕込みを入れる。</div>
<br />
code () {<br />
if [[ $# = 0 ]]<br />
then<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>GOPATH=$(pwd)<br />
open -a "Visual Studio Code"<br />
else<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>GOPATH=$(pwd)<br />
[[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}"<br />
open -n -a "Visual Studio Code" --args "$F"<br />
fi<br />
}<br />
<div>
<br /></div>
<div>
exportしないでGOPATHをワークスペースに設定しておく。</div>
<div>
こうすると、vs.codeで自前パッケージのインテリセンスが有効になる。</div>
<div>
<br /></div>
<div>
起動後に.vscode下にtasks.jsonを作る。</div>
<div>
以下のような感じ</div>
<div>
<br /></div>
{<br />
"version": "0.1.0",<br />
"command": "go",<br />
"showOutput": "always",<br />
"options": {<br />
"env": {<br />
"GOPATH": "${workspaceRoot}"<br />
}<br />
},<br />
"tasks" :[<br />
{<br />
"taskName": "build",<br />
"args": ["-v"],<br />
"isBuildCommand": true<br />
},<br />
{<br />
"taskName": "run",<br />
"args": ["-v"]<br />
},<br />
{<br />
"taskName": "test",<br />
"args": ["-v"],<br />
"isTestCommand": true<br />
}<br />
]<br />
}<br />
<br />
options/env下にGOPATHを${workspaceRoot}で設定しておくのがポイント。<br />
ワークスペース以下のフォルダ構造は以下のような感じにする。<br />
<br />
${workspaceRoot}<br />
/pkg/... → ここの下に.aファイルが勝手にできる<br />
/src/[パッケージフォルダ]<br />
mainパッケージのファイルはベタ置き<br />
<br />
デメリットはgo getしたやつは個別のワークスペースに展開されるので<br />
ファイルサイズが大きくなる。<br />
けれど、今時ならOKOKということで。<br />
<br />
2017/01/11 追記<br />
src下にmain.goを置くとデバッグできないのはdleveのバグっぽいが試していない。<br />
<br />ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-23627027490324623572016-05-06T17:55:00.000+09:002016-05-08T07:05:43.404+09:00Xamarin.Formsでカスタムコントロールを作るメモ<h3 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 1.64571rem; line-height: 3rem; margin-bottom: 0.07599rem; margin-top: 0px; padding-top: 0.92401rem;">
Xamarin.Formsでのカスタムコントロール構築</h3>
<ul style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-size: 14px; line-height: 28px; margin-bottom: 0.83999rem; padding-top: 0.16001rem;">
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">共通プロジェクト側で、BoxViewを継承したクラスを作る</li>
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">BoxViewを継承したクラスをメインのXamlページではっつける</li>
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">プラットフォーム毎のプロジェクトでBoxViewの中を描画するためのRendererクラスを作る</li>
</ul>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) 0% 0% / 100% 4rem rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-comment" style="box-sizing: border-box; color: #586e75;">// 例)</span>
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-class" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">class</span> <span class="hljs-title" style="box-sizing: border-box; color: #b58900;">CustomControlClass</span> : <span class="hljs-typename" style="box-sizing: border-box;">BoxView</span></span>
{
}
</code></pre>
<h3 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 1.64571rem; line-height: 3rem; margin-bottom: 0.07599rem; margin-top: 0px; padding-top: 0.92401rem;">
<a href="https://www.blogger.com/null" id="RendereriOSAndroid_13" style="background: 0px 0px; box-sizing: border-box; color: #a0aabf; cursor: pointer; text-decoration: underline;"></a>RendererクラスのiOS/Android共通の要件は以下の通り。</h3>
<ul style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-size: 14px; line-height: 28px; margin-bottom: 0.83999rem; padding-top: 0.16001rem;">
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">assembly:ExportRenderer属性を設定する。</li>
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">例)[assembly:ExportRenderer(typeof(ShapeView), typeof(ShapeRenderer))]</li>
</ul>
<h3 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 1.64571rem; line-height: 3rem; margin-bottom: 0.07599rem; margin-top: 0px; padding-top: 0.92401rem;">
<a href="https://www.blogger.com/null" id="RendereriOS_17" style="background: 0px 0px; box-sizing: border-box; color: #a0aabf; cursor: pointer; text-decoration: underline;"></a>RendererクラスのiOS固有の要件は以下の通り。</h3>
<ul style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-size: 14px; line-height: 28px; margin-bottom: 0.83999rem; padding-top: 0.16001rem;">
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">iOSの場合、VisualElementRenderer<>から継承する。 (Xamarin.Forms.Plarform.iOS名前空間で定義)</li>
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">VisualElementRendererの型引数はターゲットとするViewBoxを継承したクラス。</li>
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">Rendererクラスでは、Drawメソッド内にコントロール固有の描画コードを記述する。</li>
</ul>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) 0% 0% / 100% 4rem rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-comment" style="box-sizing: border-box; color: #586e75;">//例)</span>
[assembly:ExportRenderer(<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">typeof</span>(CustomControlClass), <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">typeof</span>(CustomControlRenderer))]
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">namespace</span> Hoge.iOS
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-class" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">class</span> <span class="hljs-title" style="box-sizing: border-box; color: #b58900;">CustomControlRenderer</span> : <span class="hljs-title" style="box-sizing: border-box; color: #b58900;">VisualElementRenderer</span><<span class="hljs-title" style="box-sizing: border-box; color: #b58900;">CustomControlRenderer</span>>
</span>{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">override</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">void</span> Draw(System.Drawing.RectangleF rect)
{
<span class="hljs-comment" style="box-sizing: border-box; color: #586e75;">// specify draw code here.</span>
}
}
}
</code></pre>
<h3 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 1.64571rem; line-height: 3rem; margin-bottom: 0.07599rem; margin-top: 0px; padding-top: 0.92401rem;">
<a href="https://www.blogger.com/null" id="AndroidRenderer_37" style="background: 0px 0px; box-sizing: border-box; color: #a0aabf; cursor: pointer; text-decoration: underline;"></a>Android固有のRendererクラスの要件</h3>
<ul style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-size: 14px; line-height: 28px; margin-bottom: 0.83999rem; padding-top: 0.16001rem;">
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">Androidの場合、ViewRenderer<>から継承する。(Xamarin.Forms.Plarform.Android名前空間で定義)</li>
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">ViewRenderer<>の型引数は2つで、一つ目は共通プロジェクトで定義したBoxViewを継承したクラス、2つ目は実際にコントロールの中身を描画するViewを継承したクラス(ここでは、CustomControlViewクラス)</li>
</ul>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) 0% 0% / 100% 4rem rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-comment" style="box-sizing: border-box; color: #586e75;">// 例)</span>
[assembly:ExportRenderer(<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">typeof</span>(CustomControlClass), <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">typeof</span>(CustomControlRenderer))]
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">namespace</span> Hoge.Android
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-class" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">class</span> <span class="hljs-title" style="box-sizing: border-box; color: #b58900;">CustomControlRenderer</span> : <span class="hljs-title" style="box-sizing: border-box; color: #b58900;">ViewRenderer</span><<span class="hljs-title" style="box-sizing: border-box; color: #b58900;">CustomControlClass</span>, <span class="hljs-title" style="box-sizing: border-box; color: #b58900;">CustomControlView</span>>
</span>{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">protected</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">override</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">void</span> OnElementChanged(ElementChangedEventArgs<CustomControlClass> e)
{
base.OnElementChanged(e);
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">if</span>(e.OldElement != <span class="hljs-literal" style="box-sizing: border-box;">null</span> || <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">this</span>.Element == <span class="hljs-literal" style="box-sizing: border-box;">null</span>)
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">return</span>;
}
SetNativeControl(<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">new</span> Shape(Resources.DisplayMetrics.Density, Context)
{
ShapeView = Element
});
}
}
}
</code></pre>
<ul style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-size: 14px; line-height: 28px; margin-bottom: 0.83999rem; padding-top: 0.16001rem;">
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">Viewクラスの実装はOnDrawメソッド内でコントロール固有の描画コードを記述する。</li>
</ul>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) 0% 0% / 100% 4rem rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-comment" style="box-sizing: border-box; color: #586e75;">// 例)</span>
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-class" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">class</span> <span class="hljs-title" style="box-sizing: border-box; color: #b58900;">CustomControlView</span> : <span class="hljs-title" style="box-sizing: border-box; color: #b58900;">Android</span>.<span class="hljs-title" style="box-sizing: border-box; color: #b58900;">Views</span>.<span class="hljs-title" style="box-sizing: border-box; color: #b58900;">View</span>
</span>{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">protected</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">override</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">void</span> OnDraw(Canvas canvas)
{
<span class="hljs-comment" style="box-sizing: border-box; color: #586e75;">// ここに固有の描画コードを記述する。</span>
}
}</code></pre>
<h3 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 1.64571rem; line-height: 3rem; margin-bottom: 0.07599rem; margin-top: 0px; padding-top: 0.92401rem;">
カスタムコントロールの貼り付け方</h3>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
共通クラスで書きます。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) 0% 0% / 100% 4rem rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-comment" style="box-sizing: border-box; color: #586e75;">// 例) ここは前述の通り。</span>
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">namespace</span> <span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Hoge</span>
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">class</span> <span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">CustomControlClass</span> : <span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">BoxView</span>
{
}
}
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
次に、これを使うxamlファイルは以下のように書きます。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) 0% 0% / 100% 4rem rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-comment" style="box-sizing: border-box; color: #586e75;"><!--
Hogeというアセンブリにカスタムコントロールが含まれている前提
--></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">....</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns:ctrls</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"clr-namespace:Hoge;assembly=Hoge"</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">StackLayout</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ctrls:CustomControlClass</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">StackLayout</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span>></span>
</code></pre>
<div>
<code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-tag" style="box-sizing: border-box;"><br /></span></code></div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-19548690219982671542016-04-28T11:58:00.000+09:002016-04-28T11:58:06.578+09:00macのdylibのロード方法macでdylibのプロジェクト(ここでは、libXXXX.dylib)とそれを使用するアプリ(ここではXXXXDriver)のプロジェクトがあって、xcodeからは実行できるけど、ターミナルから叩くと<br />
<br />
<div class="p1">
<span class="s1">dyld: Library not loaded: /usr/local/lib/libXXXX.dylib</span></div>
<div class="p1">
<span class="s1"> Referenced from: /Users/username/Library/Developer/Xcode/DerivedData/XXXXi_dylib-cagqvakmzwqigmgxxrwzutupseja/Build/Products/Release/./XXXXDriver</span></div>
<div class="p1">
<span class="s1"> Reason: image not found</span></div>
<br />
<div class="p1">
<span class="s1">Trace/BPT trap: 5</span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">というようなメッセージが出力されて起動できない問題に対処したのでメモ</span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<h4>
<span class="s1">解決方法1:</span>/usr/local/libに ロードしようとする libXXXX.dylibをコピーする</h4>
<div class="p1">
→ 環境が汚れるし、なんか負けた気がするのでNG</div>
<div class="p1">
<span class="s1"><br /></span></div>
<h4>
解決方法2:起動用のshファイルを作ってそれを叩く方法</h4>
<div class="p1">
test.shファイルを作ってそれをターミナルから叩いて実行させるようにする話。</div>
<div class="p1">
<br /></div>
<div class="p1">
#!/bin/sh</div>
<div class="p1">
# dylibのロードするパスを通す</div>
<div class="p1">
export DYLD_LIBRARY_PATH=/Users/username/Library/Developer/Xcode/DerivedData/XXXXi_dylib-cagqvakmzwqigmgxxrwzutupseja/Build/Products/Release:$DYLD_LIBRARY_PATH</div>
<div class="p1">
# 実行</div>
<div class="p1">
./XXXXDriver</div>
<div class="p1">
<br /></div>
<div class="p1">
このファイルをtest.shとして保存して、chmod +x test.sh とやって実行できるようにする。</div>
<div class="p1">
<br /></div>
<div class="p1">
これでターミナル上で./test.shと叩けば、きちんと実行できるようになる!!</div>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-51299948754045729762016-04-27T20:17:00.004+09:002016-04-27T20:17:45.335+09:00Xamarin.FormsでiOSのネイティブコードを使用して苦労した件についてXamarin.FormsでiOSの自作ネイティブライブラリを使用しようとしてハマった話。<br />
普通にiOSでやれば簡単だったけど、Cross-platformにしようとしたら面倒だったという話。<br />
<h3>
環境</h3>
<br />
<ul>
<li>mac book pro/El Capitan</li>
<li>Xamarin 5.10.3</li>
</ul>
<br />
<h3>
手順</h3>
<br />
<ol>
<li>新規ソリューションの作成でCross-platform / Xamarin.Forms Appを作る</li>
<li>ネイティブバインディング用のプロジェクトとして、iOS / Bindings Libraryを作る</li>
<li>Sharpieなどを使ってバインディングコードを書く<br />→ <a href="http://qiita.com/iseebi/items/36c4fe2bd0c996163db5">ここ</a>あたりにやり方が描かれている。</li>
<li>1で作られたiOS用のプロジェクトに2のネイティブバインディングのアセンブリを参照設定で追加しようとする。<br />→ プロジェクト参照では、Xamarin.iOSとmonotouchで互換性がないのでNGと怒られるので、「.Net Assembly」タブの「ブラウズ」で無理くり参照設定する。</li>
<li>ビルド<br />→ エラーになってビルドが通らなくなる。</li>
</ol>
<h3>
対応</h3>
<div>
結局、csprojファイルを直接書き換えることで対応した。</div>
<div>
いじる対象のcsprojファイルはバインディング側のプロジェクトファイルだ</div>
<div>
<br /></div>
<div>
/Project/PropertyGroup/ProjectTypeGuids要素を修正する。</div>
<div>
<br /></div>
<div>
</div>
<br />
<div>
<ProjectTypeGuids>{8FFB629D-F513-41CE-95D2-7ECE97B6EEEC};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids></div>
<div>
<br /></div>
<div>
となっている箇所を</div>
<div>
<br /></div>
<div>
<div>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids></div>
</div>
<div>
<br /></div>
<div>
に変更する。</div>
<div>
この要素は、プロジェクトのタイプを示していて、<ProjectTypeGuids>[作ったプロジェクトの種類(例えばiOSのアプリとかAndroidのアプリとか)を示す。]:[C#ということを示す。]</ProjectTypeGuids> という意味のようだ。</div>
<div>
もともとのプロジェクトの種類が「Xamarin.iOS」だったところを、「Monotouch」へ変更する。なぜならXamarin.FormsのiOS側のプロジェクトのタイプが「Monotouch」で「Xamarin.iOS」と互換性がないからだ。</div>
<div>
<br /></div>
<div>
またこれに伴って、Xamarin.iOSの参照設定が使えなくなったので、参照設定で「Xamarin.iOS」を削除して、代わりに「monotouch」を追加する。</div>
<div>
こうすることで、ネイティブバインディングプロジェクトのビルド自体は通るようになる。</div>
<div>
<br /></div>
<div>
次に、参照設定する側も同様にビルドをすると、エラーが発生しって相変わらずうまくいかない。</div>
<div>
<ul>
<li>ネイティブバインディングから.aファイルが取り出せない。</li>
</ul>
</div>
<div>
というエラーになる。</div>
<div>
実は本来であれば、コンパイルされたネイティブコードの.aファイルはリソースとして丸々入るのだが、今回の修正で、.aファイルはリソースに入らないという問題が発生し、そのため、参照先で.aファイルが取り出せないエラーが発生するようである。</div>
<div>
<br /></div>
<div>
仕方がないので、無理やりリソースに入れることとする。やり方は以下の通りだ。</div>
<div>
<ul>
<li>ソリューションウインドウの、埋め込みする.aファイルで右クリックする。</li>
<li>表示されたコンテキストメニューからビルドアクション > EmbeddedResourceを選択する。</li>
</ul>
<div>
これによって、.aファイルがリソースに含まれるようになる。</div>
</div>
<div>
<br /></div>
<div>
再度、参照設定する側でリビルドを行うが、今度は「MT5210」と言ったエラーが発生する。これは、<a href="https://developer.xamarin.com/guides/ios/troubleshooting/mtouch-errors/">ここ</a>によるとリンクしたライブラリのシンボル解決ができないということのようだ。</div>
<div>
調べた結果、.aファイルのリソースの埋め込み名称と.aファイルをプロジェクトにドロップするときに自動生成される「〜.linkwith.cs」の中の参照先名の記述を変えてやれば良いことがわかった。</div>
<div>
<br /></div>
<div>
例えば、Hoge.aというネイティブライブラリをプロジェクトにドロップすると、linkwith.csでは</div>
<div>
<br /></div>
<div>
<span style="color: #333333; font-family: Menlo;">[</span><span style="color: #333333; font-family: Menlo;">assembly</span><span style="color: #333333; font-family: Menlo;">:</span><span style="color: #333333; font-family: Menlo;"> </span><span style="color: #3364a4; font-family: Menlo;">LinkWith</span><span style="color: #333333; font-family: Menlo;">(</span><span style="color: #f57d00; font-family: Menlo;">"Hoge</span><span style="color: #f57d00; font-family: Menlo;">.</span><span style="color: #f57d00; font-family: Menlo;">a</span><span style="color: #f57d00; font-family: Menlo;">"</span><span style="color: #333333; font-family: Menlo;">,</span><span style="color: #333333; font-family: Menlo;"> SmartLink </span><span style="color: #333333; font-family: Menlo;">=</span><span style="color: #333333; font-family: Menlo;"> </span><span style="color: #009695; font-family: Menlo;">true</span><span style="color: #333333; font-family: Menlo;">,</span><span style="color: #333333; font-family: Menlo;"> ForceLoad </span><span style="color: #333333; font-family: Menlo;">=</span><span style="color: #333333; font-family: Menlo;"> </span><span style="color: #009695; font-family: Menlo;">true</span><span style="color: #333333; font-family: Menlo;">)]</span></div>
<div>
<br /></div>
<div>
という記述が自動生成されるが、上記の「Hoge.a」という記述が生成されるアセンブリのリソース名になっていないと、参照設定する側で前述のリンクエラーが発生してしまう。</div>
<div>
デフォルトだと、プロジェクトの名前空間名が修飾されるので、例えば「namaekuukan」というデフォルトネームスペースだったら、</div>
<div>
<br /></div>
<div>
<div>
<span style="color: #333333; font-family: Menlo;">[</span><span style="color: #333333; font-family: Menlo;">assembly</span><span style="color: #333333; font-family: Menlo;">:</span><span style="color: #333333; font-family: Menlo;"> </span><span style="color: #3364a4; font-family: Menlo;">LinkWith</span><span style="color: #333333; font-family: Menlo;">(</span><span style="color: #f57d00; font-family: Menlo;">"namaekuukan.Hoge</span><span style="color: #f57d00; font-family: Menlo;">.</span><span style="color: #f57d00; font-family: Menlo;">a</span><span style="color: #f57d00; font-family: Menlo;">"</span><span style="color: #333333; font-family: Menlo;">,</span><span style="color: #333333; font-family: Menlo;"> SmartLink </span><span style="color: #333333; font-family: Menlo;">=</span><span style="color: #333333; font-family: Menlo;"> </span><span style="color: #009695; font-family: Menlo;">true</span><span style="color: #333333; font-family: Menlo;">,</span><span style="color: #333333; font-family: Menlo;"> ForceLoad </span><span style="color: #333333; font-family: Menlo;">=</span><span style="color: #333333; font-family: Menlo;"> </span><span style="color: #009695; font-family: Menlo;">true</span><span style="color: #333333; font-family: Menlo;">)]</span></div>
</div>
<div>
<span style="color: #333333; font-family: Menlo;"><br /></span></div>
<div>
に変更する必要がある。</div>
<div>
実際にどのようなリソース名で埋め込まれているかを調べるには<a href="http://ilspy.net/">ILSpy</a>などを使うと捗る。</div>
<div>
この状態でソリューションビルドすることで(念のためクリーンアップしたほうが良い)、ビルドエラーが発生せずに、参照設定する側からネイティブライブラリを呼び出すことができるようになる。</div>
<div>
<br /></div>
<div>
なお、細かいところでは、</div>
<div>
<ul>
<li>「monotouch」に参照設定を変更したらusingしている箇所も「Monotouch.」と変更が必要になる</li>
<li>[assembly: LinkWithにリンカーフラグをつけたりする必要があったり<br />→自分のところでは、「<span style="font-family: Menlo;"><span style="color: #333333;">LinkerFlags </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">"</span><span style="color: #f57d00;">-</span><span style="color: #f57d00;">lstdc</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">"</span></span>」を追記しました。</li>
</ul>
<div>
と言ったことが起きるので注意されたい。</div>
</div>
<div>
<br /></div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-12602058776020498842016-04-26T19:45:00.002+09:002016-04-26T19:45:31.176+09:002つのバイナリを1つに統合するけん
<br />
<div class="p1">
<span class="s1">iOSのシミュレータ用の.aファイルと実機用の.aファイルを一つにまとめて使いやすくする巻</span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">$> xcrun -sdk iphoneos lipo -create ../Release-iphoneos/libPDMani.a ../Release-iphonesimulator/libPDMani.a -output ../libPDMani.a</span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">説明:</span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">../Release-iphoneos 下の libPDMani.a (ARM系バイナリ)</span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
と</div>
<div class="p1">
<br /></div>
<div class="p1">
../Release-iphonesimulator 下の libPDMani.a (i386系バイナリ)</div>
<div class="p1">
<br /></div>
<div class="p1">
を1つにまとめて-outputに指定した ../libPDMani.aに出力する方法。</div>
<div class="p1">
<br /></div>
<div class="p1">
-sdk iphoneos とか lipo とかはよくわからん。何かのおまじない。</div>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-9606248959798837002016-04-18T11:57:00.000+09:002016-05-31T22:42:06.994+09:00Xamarinのxamlのデータバインディングのpart4について訳してみた。<br />
<h1 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 2.05714rem; line-height: 3rem; margin: 0px 0px 0.21999rem; padding-top: 0.78001rem;">
Part4. データバインディングの基礎</h1>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
データバインディングは2つのオブジェクトのプロパティをリンクし、片方の変更を契機に もう片方の変更を発生させることができます。 これは大変価値のあるツールです。そしてデータバインディングはソースコード上で完璧に 定義することができ、XAMLはそのショートカットと利便性を提供します。 その結果として、バインティングがXamarin.Formsのマークアップ拡張は最も重要な機能 の一つとなります。</div>
<h1 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 2.05714rem; line-height: 3rem; margin: 0px 0px 0.21999rem; padding-top: 0.78001rem;">
<a href="https://www.blogger.com/null" id="_9" style="background: 0px 0px; box-sizing: border-box; color: #a0aabf; cursor: pointer; text-decoration: underline;"></a>データバインディング</h1>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
データバインティングは2つのオブジェクトのプロパティを接続し、ソースからターゲットへ 呼び出しを行います。コードの中では、2つのステップが要求されます。 一つ目は、ターゲットオブジェクトのBindingContextプロパティを必ずソースオブジェクト にセットする必要があります。 二つ目は、SetBindingメソッド(しばしばBindingクラスと組み合わせて使用される)で、 ソースオブジェクトのプロパティに、そのオブジェクトのプロパティをバインドするために、 ターゲットオブジェクトから呼び出されなければなりません。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
ターゲットプロパティは、バインディング可能なプロパティである必要があります。 つまり、ターゲットオブジェクトは必ずBindingObjectから継承されている必要があります。 オンラインのXamain.Formsのドキュメントでは、プロパティはバインド可能なプロパティで あることを示しています。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
マークアップ中では、これらは同じ2つのステップが要求され、バインディングマークアップ の拡張機能は、SetBindingの呼び出しと、Bindingクラスの代わりに使用されます。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
しかしながら、これらはターゲットオブジェクトのBindingContextへセットする単一の テクニックではありません。 しばしば、StaticResourceもしくはx:Staticマークアップ拡張機能を使用して、コード ビハインドのファイルからこれらは設定されます。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
バインディングが最も頻繁に使用されるのは、画面表示系のプログラムとベースのデータモデル を接続する時で、しばしばMVVM(Model-View-ViewModel)アプリケーションアーキテクチャ で実現されます。MVVMについてはPart5で議論しますが、他のシナリオでは可能です。</div>
<h1 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 2.05714rem; line-height: 3rem; margin: 0px 0px 0.21999rem; padding-top: 0.78001rem;">
<a href="https://www.blogger.com/null" id="ViewView_36" style="background: 0px 0px; box-sizing: border-box; color: #a0aabf; cursor: pointer; text-decoration: underline;"></a>ViewからViewへのバインディング</h1>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
データバインディングは同一ページの二つのビューのプロパティを結合の定義をすることができます。 このケースでは、ターゲットオブジェクトのx:Refrenceマークアップ拡張を使用して、Binding - Contextを設定します。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
ここにSliderと二つのラベルが含まれたのXAMLファイルがあります。ラベルの片方はスライダー の値によって回転し、もう片方は、スライダーの値を表示します。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-pi" style="box-sizing: border-box; color: #586e75;"><?xml version="1.0" encoding="utf-8" ?></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"http://xamarin.com/schemas/2014/forms"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns:x</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"http://schemas.microsoft.com/winfx/2009/xaml"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">x:Class</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"XmalSamples.SliderBindingsPage"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Title</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Slider Bindings Page"</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">StackLayout</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"ROTATION"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Reference Name=slider}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Rotation</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Path=Value}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">FontAttributes</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Bold"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">FontSize</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Large"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">HorizontalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">VerticalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"CenterAndExpand"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Slider</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">x:Name</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"slider"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Maximum</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"360"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">VerticalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"CenterAndExpand"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Reference slider}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Value,
StringFormat='The angle is {0:F0} degrees'}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">FontAttributes</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Bold"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">HorizontalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">VerticalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"CenterAndExpand"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">StackLayout</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span>></span>
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
Sliderに含まれるx:Name属性の値を使用して、二つのラベルはx:Referenceマークアップ拡張を 使用してSliderを参照します。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
x:Reference拡張は、参照される要素の名前に設定するNameというプロパティを定義します。 この場合は、「slider」です。 しかしながら、ReferenceExtensionクラスはx:Referenceマークアップ拡張はまた、 明示的に要求されていないことを意味し、NameのためにContentProperty属性を定義します。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
幾つかのバラエティとして、最初のラベルのx:Referenceは”Name=”が含まれていますが、 二番目のラベルには"Name="が含まれていません。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-constant" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"{x:Reference Name=slider}"</span>
....
<span class="hljs-constant" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"{x:Reference slider}"</span>
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
Bindingマークアップ拡張自体はちょうどBindingBaseとBindingクラスのように、幾つかの プロパティを持つことができます。 バインディングのためのContentPropertyはPathですが、バインディングマークアップ拡張の 最初の項目に限り、"Path="の部分を省略することができます。 最初の例では"Path="を設定してますが、次の例ではそれを省略しています。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-constant" style="box-sizing: border-box; color: #b58900;">Rotation</span>=<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"{Binding Path=Value}"</span>
...
<span class="hljs-constant" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"{Binding Value, StringFormat='The angle is {0:F0} degrees'}"</span>
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
プロパティはすべて、単一行でも複数行に分割された行でも設定可能です。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
二番目のバインディングマークアップ拡張のStingFormatに注目してください。 Xamarin.Formsでは、バインディングは暗黙の型変換を行うことができません、そして、もし 非文字列オブジェクトを文字列として表示する場合、型のコンバータ(Type Converter)か StringFormatを使用する必要があります。 バックグラウンドの動きは、StringFormatはstaticなString.Formatメソッドを使用します。 .NETの書式化の仕様も、マークアップ拡張を区切るために、XAMLパーサーを混乱させる危険性を 持っている中括弧を伴うため、潜在的な問題を持っています。 それを無効化するために、書式化文字列はシングルクォート内に設定を行います。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;">Text=<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"{Binding Value,
</span> StringFormat=<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">'The angle is {0:F0} degrees'</span>}<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"
</span></code></pre>
<h1 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 2.05714rem; line-height: 3rem; margin: 0px 0px 0.21999rem; padding-top: 0.78001rem;">
<a href="https://www.blogger.com/null" id="Backwards_Bindings_119" style="background: 0px 0px; box-sizing: border-box; color: #a0aabf; cursor: pointer; text-decoration: underline;"></a>Backwards Bindings(後方バインディング)</h1>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
単一のビューは様々なプロパティのデータバインディングを行うことができます。しかしながら 各々のビューは一つのバインディングコンテキストを使用することしかできず、複数のデータを 表示用にバインディングするには、全てのオブジェクトのプロパティを参照する必要があります。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
この制約を避けるには、view−to-viewバインディングを用いて、OneWayToSourceもしくは TwoWayモードをする必要があります。以下に例を挙げます。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
次のプログラムは4つのスライダーがあり、スケール・回転・X軸の回転・Y軸の回転の各プロパティ の表示を意図しています。 まず、ラベルの4つのプロパティはデータバインティングのターゲットにならなければならない ことがわかります。 しかしながら、ラベルのバインディングコンテキストはただ一つのオブジェクトしか設定でき ませんが、4つの異なるスライダーが存在しています。</div>
<ul style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-size: 14px; line-height: 28px; margin-bottom: 0.83999rem; padding-top: 0.16001rem;">
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">注)データバインディングターゲット(ラベル) = 1:データソース = Nの1:Nのバインディング の話をしていると思われ。</li>
</ul>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
このような理由により、バインディングは周りと一見、後方に反転しています:4つのスライダーの 各バインディングコンテキストはラベルへ設定し、バインディングはスライダーのValueプロパティ へ設定を行います。 OneWayToSourceとTwoWayモードを使用することで、これらのValueプロパティはソース プロパティで、ラベルの各プロパティ(スケール、回転、X回転、Y回転)の設定に使用します。</div>
<ul style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-size: 14px; line-height: 28px; margin-bottom: 0.83999rem; padding-top: 0.16001rem;">
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">注)ラベルへのデータバインディングをするために、スライダーへのバインディング設定 となっているということを言っている。TwoWayモードでお互いのプロパティ値の変更を 互いに変更しあうので1:Nのバインディングができるということになる。</li>
</ul>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-pi" style="box-sizing: border-box; color: #586e75;"><?xml veresion="1.0" encoding="utf-8" ?></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"http://xamarin.com//schemas/2014/forms"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns:x</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"http://schemas.microsoft.com/winfx/2009/xaml"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">x:Class</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"XamlSamples.SliderTransformsPage"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Title</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Slider Transforms Page"</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Grid</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Grid.RowDifinitions</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">RowDefinition</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Height</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"*"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">RowDefinition</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Height</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Auto"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">RowDefinition</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Height</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Auto"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">RowDefinition</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Height</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Auto"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">RowDefinition</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Height</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Auto"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Grid.RowDifinitions</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Grid.ColumnDefinitions</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ColumnDefinition</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Width</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Auto"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ColumnDefinition</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">WIdth</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"*"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Grid.ColumnDefinitions</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">StackLayout</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Row</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"0"</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Column</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"0"</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.ColumnSpan</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"2"</span>></span>
<span class="hljs-comment" style="box-sizing: border-box; color: #586e75;"><!-- Scaled and rotated Lebel --></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">x:Name</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"label"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"TEXT"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">HorizontalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">VerticalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"CenterAndExpand"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">StackLayout</span>></span>
<span class="hljs-comment" style="box-sizing: border-box; color: #586e75;"><!-- Slider and identifying Label for Scale --></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Slider</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">x:Name</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"scaleSlider"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Reference label}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Row</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"1"</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Column</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"1"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Maximum</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"10"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Value</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Scale, Mode=TwoWay}"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Reference scaleSlider}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Value, StringFormat='Scale = {0:F1}'}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Row</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"1"</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Column</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"0"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">VerticalTextAlignment</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span> /></span>
<span class="hljs-comment" style="box-sizing: border-box; color: #586e75;"><!-- Slider and identifying Label for Rotation --></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Slider</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">x:Name</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"rotationSlider"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Reference label}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Row</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"2"</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Column</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"1"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Maximum</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"360"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Value</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Rotation, Mode=OneWayToSource}"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Reference rotationSlider}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Value, StringFormat='Rotation = {0:F0}'}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Row</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"2"</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Column</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"0"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">VerticalTextAlignment</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span> /></span>
<span class="hljs-comment" style="box-sizing: border-box; color: #586e75;"><!-- Slider and identifying Label for RotationX --></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Slider</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">x:Name</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"rotationXSlider"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Reference label}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Row</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"3"</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Column</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"1"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Maximum</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"360"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Value</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding RotationX, Mode=OneWayToSource}"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Reference rotationXSlider}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Value, StringFormat='RotationX = {0:F0}'}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Row</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"3"</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Column</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"0"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">VerticalTextAlignment</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span> /></span>
<span class="hljs-comment" style="box-sizing: border-box; color: #586e75;"><!-- Slider and identifying Label for RotationY --></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Slider</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">x:Name</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"rotationYSlider"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Reference label}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Row</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"4"</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Column</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"1"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Maximum</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"360"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Value</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding RotationY, Mode=OneWayToSource}"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Reference rotationYSlider}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Value, StringFormat='RotationY = {0:F0}'}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Row</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"4"</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Grid.Column</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"0"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">VerticalTextAlignment</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Grid</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span>></span>
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
3つのスライダーのバインディングはOneWayToSourceである意味は、プロパティの値の 変更が、それ自体のバインディングコンテキストによって引き起こされるためです。 これら3つのスライダーはラベルのRotate、RotateX、RotateYプロパティの変更を発生 させます。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
それに対し、スケースのバインディングはTwoWayです。 これは、Scaleプロパティのデフォルトの値が1となっており、TwoWayバインディングに よってスライダーの初期値を使用することは1ではなく、0が設定されてしまうためです。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
もし、バインディングがOneWayToSourceだった場合、Scaleプロパティの初期値は スライダーのデフォルト値の0となってしまいます。そうなると、ラベルは非表示となり ユーザーは混乱すると想定できるからです。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
スライダーの左にあるラベルは、スライダーのカレント値を指し示しています。 これらは各ラベルが通常のOneWayでバインディングされますが、ラベルのバインティング コンテキストはスライダーを参照する必要があります。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
この意味は、各スライダーは、XAMLファイルの文法的に、ラベルが表示される前に対応する ラベルが表示されている必要があることを意味しています。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
このプログラムでは、Gridを使用してスライダーがカラム番号1で最初に表示され、続いて ラベルをカラム番号0として表示するように制御しています。</div>
<ul style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-size: 14px; line-height: 28px; margin-bottom: 0.83999rem; padding-top: 0.16001rem;">
<li style="box-sizing: border-box; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; margin-left: 1rem;">注)ラベルの方が先に定義されると、スライダーを参照しているので、まだ出現していない オブジェクトを参照することとなり不都合があるので、XAMLの記述では、Gridの小技を 使って、スライダーの次にラベルが出現するようにしている。</li>
</ul>
<h1 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 2.05714rem; line-height: 3rem; margin: 0px 0px 0.21999rem; padding-top: 0.78001rem;">
<a href="https://www.blogger.com/null" id="_252" style="background: 0px 0px; box-sizing: border-box; color: #a0aabf; cursor: pointer; text-decoration: underline;"></a>バインディングとコレクション</h1>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
データバインディングのパワーを示すのに、テンプレート化されたListViewに比較できる ものはありません。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
ListViewはItemSourceプロパティによって列挙子の型を定義し、コレクションのアイテム を表示します。 これらのアイテムはあらゆる型のオブジェクトを扱うことができます。 既定では、ListViewはアイテムを表示するのにToStringメソッドを使用します。 大抵はこれは望む結果を生みますが、幾つかのケースではToStringメソッドはオブジェクトの 完全修飾クラス名を返します。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
ListViewコレクションのアイテムは、Cellクラスから継承したクラスを含むテンプレートを 使用することによって、表示方法をコントロールすることができます。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
テンプレートは、リストビュー内のすべてのアイテムのために複製され、テンプレートに設定 されているデータバインディングは、それぞれの複製されたテンプレートへ転送されます。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
頻繁に、ViewCellクラスを使用してこれらのアイテムのカスタムセルを作ることを求めます。 この作業ではコードで書くと、煩雑であるが、XAMLを使うことでとても直感的に書くことが できます。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
XamlSamplesプロジェクトにはNamedColorと呼ばれるクラスが含まれています。 各NamedColorオブジェクトはNameとFriendlyNameというString型のプロパティと Color型のColorプロパティを持ちます。 さらに、NamedColorは147種類のCSS3の使用に定義されたstaticなColor型のフィールド を持っています。 staticなコンストラクタで、これらstaticフィールドに対応するNamedColorオブジェクト を含むIEnumrable<NamedColor>コレクションを作成し、そのpublic-staticなすべての プロパティに割り当てます。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
x;Staticマークアップ拡張を使用することでListViewのItemSourceへstaticな NamedColor.Allプロパティの設定が簡単にできます。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-pi" style="box-sizing: border-box; color: #586e75;"><?xml veresion="1.0" encoding="utf-8" ?></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"http://xamarin.com/schemas/2014/forms"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns:x</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"http://schemas.microsoft.com/winfx/2009/xaml"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns:local</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"clr-namespace:XmalSamples;assembly=XmalSamples"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">x:Class</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"XmalSamples.ListViewDemoPage"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Title</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"ListView Demo Page"</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ListView</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">ItemSource</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Static local:NamedColor.All}"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span>></span>
</code></pre>
<h1 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 2.05714rem; line-height: 3rem; margin: 0px 0px 0.21999rem; padding-top: 0.78001rem;">
<a href="https://www.blogger.com/null" id="MVVM_299" style="background: 0px 0px; box-sizing: border-box; color: #a0aabf; cursor: pointer; text-decoration: underline;"></a>データバインドからMVVMへ</h1>
<h2 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 1.95312rem; line-height: 3rem; margin-bottom: 0.183584rem; margin-top: 0px; padding-top: 0.816416rem;">
<a href="https://www.blogger.com/null" id="MVVMModelViewViewModel_301" style="background: 0px 0px; box-sizing: border-box; color: #a0aabf; cursor: pointer; text-decoration: underline;"></a>MVVM(Model-View-ViewModel)アーキテクチャに関する紹介</h2>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
Model-View-ViewModel(MVVM)の構築パターンはXAMLを念頭に開発されました。 このパターンは ユーザーインンターフェース(View)からデータモデル(Model)を、 ビューとモデルをサービスクラスを媒介するクラス(ViewModel)を通して、両者の 分離を強制させます。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
ViewとViewModelはしばしばXAMLファイルで定義されたデータバインドによって 接続されます。 Viewのバインディングコンテキストは大抵の場合、ViewModelのインスタンスと なります。</div>
<h1 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 2.05714rem; line-height: 3rem; margin: 0px 0px 0.21999rem; padding-top: 0.78001rem;">
<a href="https://www.blogger.com/null" id="ViewModel_313" style="background: 0px 0px; box-sizing: border-box; color: #a0aabf; cursor: pointer; text-decoration: underline;"></a>単純なViewModel</h1>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
ViewModelの紹介をします。 最初にXMLの名前空間にXAMLファイルが他のアセンブリ参照の設定をどうやって行っている かを見つけることができます。 このプログラムは、アセンブリ:Systemの名前空間を修飾するXML名前空間の定義を行う プログラムがあります。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-label" style="box-sizing: border-box;">xmlns:</span>sys=<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"clr-namespace:System;assembly=mscorlib"</span>
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
プログラムはx:Staticを使用して現在日付と時刻をstaticなDateTime.Nowプロパティ から取得して、DateTimeの値をバインディングコンテキストでStackLayoutに設定します。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">StackLayout</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Static sys:DateTime.Now}"</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">....</span>></span>
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
バインディングコンテキストはとても特別なプロパティで、すべてのその子供の要素に 継承されます。 この意味はStatckLayoutのすべての子供要素は同じバインディングコンテキストを持ち、 それらにオブジェクトのプロパティへの単純なバインドを含めることができます。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
このプログラムでは、二つの子供要素がDateTimeのプロパティが含まれている値にバインド しており、二つの別の子供要素はバインディングパスが誤っているように見えるバインドが 行われています。 これは実際にDateTimeの値を、StringFormatのために使用されることを意味しています。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-pi" style="box-sizing: border-box; color: #586e75;"><?xml version="1.0" encoding="utf-8"?></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"http://xamarin.com/schemas/2014/forms"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns:x</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"http://schemas.micosoft.com/winfx/2009/xaml"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns:sys</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"clr-namespace:System;assembly=mscorlib"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">x:Class</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"XamlSamples.OneShotDateTimePage"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Title</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"One-Shot DateTime Page"</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">StackLayout</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">BindingContext</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{x:Static sys:DateTime.Now}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">HorizontalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">VerticalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Year, StringFormat='The year is {0}'}"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding StringFormat='The month is {0:MMMM}'}"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Day, StringFormat='The day is {0}'}"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding StringFormat='The time is {0:T}'}"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">StatckLayout</span>></span>
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
もちろん、大きな問題として、日付と時間はページの初期表示に一回だけ設定されるので、 表示は更新されません。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;">表示結果 -> (今は<span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">2014</span>/<span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">6</span>/<span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">11</span> <span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">17</span>:<span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">4</span>:<span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">54</span>)
The year is <span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">2014</span>
The month is June
The day is <span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">11</span>
The time is <span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">5</span>:<span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">04</span>:<span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">54</span> PM
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
XAMLファイルは現在時刻を常に表示する時計を表示することができますが、そのためには 幾つかのヘルプコードが外部に必要となります。 MVVMの観点で考えると、モデルとモデルビューはコードで書かれたクラスになります。 ビューは大抵XAMLファイルで記述され、データバインドを通じて定義されたビューモデルの プロパティを参照します。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
本来、モデルはビューモデルに依存せず、ビューモデルはビューに依存していません。 しかしながら、大抵のプログラマーは部分的なユーザーインターフェースに関連付けられた データ型をビューモデルを通じて外部に公開するような構造として作ります。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
例えば、もし、モデルがデータベースの8bitキャラクターのASCII文字列にアクセスする場合、 ビューモデルはユーザーインターフェースが使用するユニコード文字列にそれらを変換する 必要があるでしょう。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
この単純なMVVMの例では、モデルがなく、ビューとビューモデルが直接データバインドで接続 しています。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
ビューモデルはDateTimeと名付けられた一つのプロパティを持ち、毎秒毎にDateTimeの プロパティが更新されます。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">namespace</span> <span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">XamlSamples</span> {
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">class</span> <span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ClockViewModel</span> : <span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">INotifyPropertyChanged</span>
{
DateTime dateTime;
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">event</span> PropertyChangedEventHandler PropertyChanged = <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">delegate</span> {};
<span class="hljs-function" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ClockViewModel</span>(<span class="hljs-params" style="box-sizing: border-box;"></span>)
</span>{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">this</span>.DateTime = DateTime.Now;
Device.StartTimer(TimeSpan.FromSeconds(<span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">1</span>), () =>
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">this</span>.DateTime = DateTime.Now;
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">return</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">true</span>;
});
}
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> DateTime DateTime
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">set</span>
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">if</span> (dateTime != <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>)
{
dateTime = <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>;
PropertyChanged(<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">this</span>,
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">new</span> PropertyChangedEventArgs(<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"DateTime"</span>));
}
}
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">get</span>
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">return</span> dateTime;
}
}
}
} <span class="hljs-comment" style="box-sizing: border-box; color: #586e75;">// end of XamlSamples namespace;</span>
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
ビューモデルは通常INotifyPropertyChangedインターフェースを実装します。これは プロパティの変更に伴い、PropertyChangedイベントを発火させます。 このXamarin.Formsにおけるデータバインドのメカニズムは、ProperyChangedイベントに ハンドラーを接続することで、プロパティの変更を通知することができ、ターゲットを更新して 新しい値に保つことができるようになります。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
時計におけるビューモデルは以下のように単純な形で実装することができます。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-pi" style="box-sizing: border-box; color: #586e75;"><?xml version="1.0" encoding="utf-8"?></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"http://xamarin.com/schemas/2014/forms"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns:x</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"http://schemas.microsoft.com/winfx/2009/xaml"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns:local</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"clr-namespace:XamlSamples;assembly=XamlSamples"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">x:Class</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"XamlSamples.ClockPage"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Title</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Clock Page"</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding DateTime, StringFormat='{0:T}'}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">FontSize</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Large"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">HorizontalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">VerticalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label.BindingContext</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">local:ClockViewModel</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label.BindingContext</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span>></span>
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
ClockViewModelがプロパティ要素のタグを使用したバインディングコンテキストへ設定を 行う方法に注目してください。 もしくは、ResourcesのコレクションでClockViewModelをインスタンス化して、StaticResource マークアップ拡張を通じたBindingContextによる設定をすることもできます。 もしくはコードビハインドファイルでViewModelをインスタンス化することもできます。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
ラベルのTextプロパティにバインディングしたマークアップ拡張はDateTimeを書式化して 表示します。 以下のように表示されるでしょう。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;">
<span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">5</span>:<span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">05</span>:<span class="hljs-number" style="box-sizing: border-box; color: #2aa198;">16</span> PM
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
これもまた、期間が分離されたViewModelのDateTimeプロパティの個別のプロパティに アクセスすることができます。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><Label Text=<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"{Binding DateTime.Second
</span> StringFormat=<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">'{0}'</span>}<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">" .... >
</span></code></pre>
<h1 style="background-color: white; box-sizing: border-box; color: #373d49; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1; font-size: 2.05714rem; line-height: 3rem; margin: 0px 0px 0.21999rem; padding-top: 0.78001rem;">
<a href="https://www.blogger.com/null" id="MVVM_483" style="background: 0px 0px; box-sizing: border-box; color: #a0aabf; cursor: pointer; text-decoration: underline;"></a>インタラクティブなMVVM</h1>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
MVVMはデータモデルをベースとしたインタラクティブな表示のためにtwo-wayなデータバインド しばしば使用します。 これは、HslViewModelと名づけられた色相、彩度、明度の値とColorを相互変換するクラスが あります。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;">
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">class</span> <span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">HslViewModel</span> : <span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">INotifyPropertyChanged</span>
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">double</span> hue, saturation, luminosity;
Color color;
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">event</span> PropertyChangedEventHandler ProperyChanged;
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">double</span> Hue
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">set</span>
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">if</span> (hue != <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>)
{
hue = <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>;
OnPropertyChanged(<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"Hue"</span>);
SetNewColor();
}
}
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">get</span> { <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">return</span> hue; }
}
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">double</span> Saturation
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">set</span>
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">if</span> (saturation != <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>)
{
hue = <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>;
OnPropertyChanged(<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"Saturation"</span>);
SetNewColor();
}
}
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">get</span> { <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">return</span> Saturation; }
}
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">double</span> Luminosity
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">set</span>
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">if</span> (luminosity != <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>)
{
hue = <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>;
OnPropertyChanged(<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"Luminosity"</span>);
SetNewColor();
}
}
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">get</span> { <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">return</span> Luminosity; }
}
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">public</span> Color Color
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">set</span>
{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">if</span> (color != <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>)
{
color = <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>;
OnPropertyChanged(<span class="hljs-string" style="box-sizing: border-box; color: #2aa198;">"Color"</span>);
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">this</span>.Hue = <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>.Hue;
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">this</span>.Saturation = <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>.Saturation;
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">this</span>.Luminosity = <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">value</span>.Luminosity;
}
}
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">get</span> { <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">return</span> color; }
}
<span class="hljs-function" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">void</span> <span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">SetNewColor</span>(<span class="hljs-params" style="box-sizing: border-box;"></span>)
</span>{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">this</span>.Color = Color.FromHsla(<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">this</span>.Hue, <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">this</span>.Saturation, <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">this</span>.Luminosity);
}
<span class="hljs-function" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">protected</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">virtual</span> <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">void</span> <span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">OnPropertyChanged</span>(<span class="hljs-params" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">string</span> propertyName</span>)
</span>{
<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">if</span> (ProperyChanged != <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">null</span>)
{
ProperyChanged(<span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">this</span>, <span class="hljs-keyword" style="box-sizing: border-box; color: #859900;">new</span> PropertyChangedEventArgs(propertyName));
}
}
}
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
色相、彩度、明度の各プロパティに変更が発生した場合、Colorプロパティが変更されColorの 変更は他の3つのプロパティへの変更を発生させます。 これはプロパティが実際に変更されていない限り、PropertyChangedイベントが発火されない ことを除いて、無限ループのように見えるかもしれません。 さもなければ制御不能なフィードバックのループに終止符を打ちます。</div>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
XAMLファイルに含まれたBoxViewは、ColorプロパティをViewModelのColorプロパティと 接着させて、3つのスライダーと3つのラベルに色相・彩度・明度プロパティを接着させます。</div>
<pre style="background: linear-gradient(rgb(255, 255, 255) 0px, rgb(255, 255, 255) 0.75rem, rgb(245, 247, 250) 0.75rem, rgb(245, 247, 250) 2.75rem, rgb(255, 255, 255) 2.75rem, rgb(255, 255, 255) 4rem) rgb(255, 255, 255); border-radius: 4px; border: 1px solid rgb(211, 218, 234); box-sizing: border-box; color: #333333; font-family: monospace, monospace; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; overflow: auto; padding: 0.66001rem 9.5px 9.5px; word-break: break-all; word-wrap: break-word;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: monospace, monospace; font-size: inherit; padding: 0px; white-space: pre-wrap;"><span class="hljs-pi" style="box-sizing: border-box; color: #586e75;"><?xml version="1.0" encoding="utf-8"?></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"http://xamarin.com/schemas/2014/forms"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns:x</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"http://schemas.microsoft.com/winfx/2009/xaml"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">xmlns:local</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"clr-namespace:XamlSamples;assembly=XamlSamples"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">x:Class</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"XamlSamples.HslColorScrollPage"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Title</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"HSL Color Scroll Page"</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage.BindingContext</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">local:HslViewModel</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Color</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Aqua"</span>/></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage.BindingContext</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">StackLayout</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Padding</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"10, 0"</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">BoxView</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Color</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Color}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">VerticalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"FillAndExpand"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Hue, StringFormat='Hue = {0:F2}'}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">HorizontalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span> ></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Slider</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Value</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Hue, Mode=TwoWay}"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Saturation, StringFormat='Saturation = {0:F2}'}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">HorizontalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span> ></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Slider</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Value</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Saturation, Mode=TwoWay}"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Label</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Text</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Luminosity, StringFormat='Luminosity = {0:F2}'}"</span>
<span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">HorizontalOptions</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"Center"</span> ></span>
<span class="hljs-tag" style="box-sizing: border-box;"><<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">Slider</span> <span class="hljs-attribute" style="box-sizing: border-box; color: #b58900;">Value</span>=<span class="hljs-value" style="box-sizing: border-box; color: #2aa198;">"{Binding Luminosity, Mode=TwoWay}"</span> /></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">StackLayout</span>></span>
<span class="hljs-tag" style="box-sizing: border-box;"></<span class="hljs-title" style="box-sizing: border-box; color: #268bd2;">ContentPage</span>></span>
</code></pre>
<div style="background-color: white; box-sizing: border-box; color: #373d49; font-family: Georgia, Cambria, serif; font-feature-settings: 'kern' 1, 'onum' 1, 'liga' 1; font-size: 14px; line-height: 28px; margin-bottom: 1.33999rem; padding-top: 0.66001rem;">
各ラベルへのデフォルトのバインド方法はOneWayです。これは値を表示するのみが必要な時に 限られます。しかし、各スライダーはTwoWayでバインドされます。 この方法はViewModelによってスライダーが初期化される良い方法です。 ColorプロパティはViewModelがインスタンス化されるタイミングで青に設定される一方で、 スライダーの変化も、ViewModelで新しい色の値を算出し、プロパティに設定する必要が あることに注目してください。</div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com2tag:blogger.com,1999:blog-8979312044631589497.post-63252507659619907332016-02-16T10:32:00.001+09:002016-02-16T10:32:21.916+09:00flashbuilderのニッチな話flashbuilder(4.6) + flex SDK 4.14で iOSとAndroidアプリを作っている。<br />
もともとflex SDK 4.6からの引継ぎのアプリだったため、SDKのバージョンアップで見た目が変わってしまっていた。<br />
iOS6以前の見た目にしたい場合の設定の話。<br />
<br />
コンパイラのオプションに「<span style="color: #333333; font-family: monospace; font-size: 14px; line-height: 1.42857;">-</span><span class="il" style="color: #333333; font-family: monospace; font-size: 14px; line-height: 1.42857;">includes</span><span style="color: #333333; font-family: monospace; font-size: 14px; line-height: 1.42857;">=</span><span class="il" style="color: #333333; font-family: monospace; font-size: 14px; line-height: 1.42857;">mx</span><span style="color: #333333; font-family: monospace; font-size: 14px; line-height: 1.42857;">.</span><span class="il" style="color: #333333; font-family: monospace; font-size: 14px; line-height: 1.42857;">utils</span><span style="color: #333333; font-family: monospace; font-size: 14px; line-height: 1.42857;">.</span><span style="color: #333333; font-family: monospace; font-size: 14px; line-height: 1.42857;">LegacyMobileThemeOverride</span>」を設定すると、レガシーなモバイルテーマが適用される。<br />
<br />
詳細は、以下のページに記載されている。<br />
<br />
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=50856172<br />
<br />ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-26274096199096372212016-01-27T14:26:00.000+09:002016-02-08T15:20:14.502+09:00gradle experimentalを日本語訳してみた<span style="font-family: MS ゴシック;">http://tools.android.com/tech-docs/new-build-system/gradle-experimental</span><br />
<span style="font-family: MS ゴシック;">のサイトを勝手に翻訳(意訳?</span><span style="font-family: "ms ゴシック";">)しました。</span><br />
<span style="font-family: MS ゴシック;">内容が誤っているかもしれないので自己責任でお願いします。</span><br />
<h2>
<span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">はじめに</span><span lang="EN-US"><o:p></o:p></span></h2>
<div class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">この新しい試験的なプラグインは</span><span lang="EN-US">Grale</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">の新しいコンポーネントモデルの仕組みをベースとしており、設定時間の短縮を約束します。これは</span><span lang="EN-US">JNI</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">アプリケーションのための</span><span lang="EN-US">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">の統合を行います。このガイドはこれらの詳細とオリジナルのプラグインと新しいプラグインとの差異について詳細内容を提供します。</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="color: red; font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">警告:</span></b><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">このプラグインは試験的なステージにあることに留意ください。この新しい</span><span lang="EN-US">Gradle API</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">のコンポーネントは最終版ではありません。そのため、このガイドで説明する内容は最終版まで変更される可能性があります。</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">また、</span><span lang="EN-US">DSL</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">は</span><span lang="EN-US">DSL</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">を作成する</span><span lang="EN-US">API</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">が変更されると大幅に変更される可能性があります。</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">これは、パフォーマンスと</span><span lang="EN-US">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">統合に関するフィードバックのごく初期版に当たります。</span><span lang="EN-US"><o:p></o:p></span></div>
<h2>
<span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">要求事項</span><span lang="EN-US"><o:p></o:p></span></h2>
<div class="MsoListParagraph" style="margin-left: 21.0pt; mso-list: l0 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -21.0pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US">Gradle(</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">必要なバージョンを以下に記載します</span><span lang="EN-US">)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 21.0pt; mso-list: l0 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -21.0pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US">Android NDK r10e(</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">もし</span><span lang="EN-US">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">を使用する場合</span><span lang="EN-US">)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 21.0pt; mso-list: l0 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -21.0pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US">SDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">のビルドツールのバージョンは</span><span lang="EN-US">19.0.0</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">以上で、この機能を使用するため、最小限の変更作業が必要となります。幾つかの機能は、より新しいバージョンが必要となります。</span><span lang="EN-US"><o:p></o:p></span></div>
<h2>
<span lang="EN-US">Gradle</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">の要求事項</span><span lang="EN-US"><o:p></o:p></span></h2>
<div class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">それぞれの試験的プラグインのバージョンは特定の</span><span lang="EN-US">Gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">のバージョンが必要です。以下に必要な</span><span lang="EN-US">Gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">のバージョンのリストを記載します。</span><span lang="EN-US"><o:p></o:p></span></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0mm 5.4pt 0mm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="background: #D9D9D9; border: solid windowtext 1.0pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 127.35pt;" valign="top" width="170"><div class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">プラグインバージョン</span><span lang="EN-US"><o:p></o:p></span></div>
</td>
<td style="background: #D9D9D9; border-left: none; border: solid windowtext 1.0pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 148.85pt;" valign="top" width="198"><div class="MsoNormal">
<span lang="EN-US">Gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">バージョン</span><span lang="EN-US"><o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 127.35pt;" valign="top" width="170"><div class="MsoNormal">
<span lang="EN-US">0.1.0<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 148.85pt;" valign="top" width="198"><div class="MsoNormal">
<span lang="EN-US">2.5<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 127.35pt;" valign="top" width="170"><div class="MsoNormal">
<span lang="EN-US">0.2.0<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 148.85pt;" valign="top" width="198"><div class="MsoNormal">
<span lang="EN-US">2.5<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 127.35pt;" valign="top" width="170"><div class="MsoNormal">
<span lang="EN-US">0.3.0-alpha3<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 148.85pt;" valign="top" width="198"><div class="MsoNormal">
<span lang="EN-US">2.6<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 127.35pt;" valign="top" width="170"><div class="MsoNormal">
<span lang="EN-US">0.4.0<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 148.85pt;" valign="top" width="198"><div class="MsoNormal">
<span lang="EN-US">2.8<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 127.35pt;" valign="top" width="170"><div class="MsoNormal">
<span lang="EN-US">0.6.0-alpha1<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 148.85pt;" valign="top" width="198"><div class="MsoNormal">
<span lang="EN-US">2.8<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 127.35pt;" valign="top" width="170"><div class="MsoNormal">
<span lang="EN-US">0.6.0-alpha5<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0mm 5.4pt 0mm 5.4pt; width: 148.85pt;" valign="top" width="198"><div class="MsoNormal">
<span lang="EN-US">2.10<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<h2>
<span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">従来のアンドロイド向け</span><span lang="EN-US">Gradle</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">プラグインの変更</span><span lang="EN-US"><o:p></o:p></span></h2>
<div class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">典型的な</span><span lang="EN-US">AndroidStudio</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">プロジェクトのディレクトリ構造は以下の通り。変更が必要となるファイルについては<span style="color: red;">赤字</span>で表現します。</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">新しいプラグインと従来のプラグインの</span><span lang="EN-US">DSL</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: Century; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Century; mso-hansi-theme-font: minor-latin;">の間でいくつか重要な変更点があります。</span><span lang="EN-US"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "ms ゴシック";">├── app/<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "ms ゴシック";">│ ├── app.iml<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "ms ゴシック";">│ ├── </span><span lang="EN-US" style="color: red; font-family: "ms ゴシック"; mso-ascii-theme-font: major-fareast; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-theme-font: major-fareast; mso-font-kerning: 0pt; mso-hansi-theme-font: major-fareast;">build.gradle<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "ms ゴシック";">│ └── src/<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "ms ゴシック";">├── </span><span lang="EN-US" style="color: red; font-family: "ms ゴシック"; mso-ascii-theme-font: major-fareast; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-theme-font: major-fareast; mso-font-kerning: 0pt; mso-hansi-theme-font: major-fareast;">build.gradle<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "ms ゴシック";">├── gradle/<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "ms ゴシック";">│ └── wrapper/<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "ms ゴシック";">│ ├── gradlewrapper.jar<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "ms ゴシック";">│ └── </span><span lang="EN-US" style="color: red; font-family: "ms ゴシック"; mso-ascii-theme-font: major-fareast; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-theme-font: major-fareast; mso-font-kerning: 0pt; mso-hansi-theme-font: major-fareast;">gradlewrapper.properties<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms ゴシック"; mso-ascii-theme-font: major-fareast; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-theme-font: major-fareast; mso-font-kerning: 0pt; mso-hansi-theme-font: major-fareast;">├──<span lang="EN-US"> gradle.properties<o:p></o:p></span></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms ゴシック"; mso-ascii-theme-font: major-fareast; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-theme-font: major-fareast; mso-font-kerning: 0pt; mso-hansi-theme-font: major-fareast;">├──<span lang="EN-US"> gradlew*<o:p></o:p></span></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms ゴシック"; mso-ascii-theme-font: major-fareast; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-theme-font: major-fareast; mso-font-kerning: 0pt; mso-hansi-theme-font: major-fareast;">├──<span lang="EN-US"> gradlew.bat<o:p></o:p></span></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms ゴシック"; mso-ascii-theme-font: major-fareast; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-theme-font: major-fareast; mso-font-kerning: 0pt; mso-hansi-theme-font: major-fareast;">├── <span lang="EN-US">local.properties<o:p></o:p></span></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms ゴシック"; mso-ascii-theme-font: major-fareast; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-theme-font: major-fareast; mso-font-kerning: 0pt; mso-hansi-theme-font: major-fareast;">├──<span lang="EN-US"> MyApplication.iml<o:p></o:p></span></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms ゴシック"; mso-ascii-theme-font: major-fareast; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-theme-font: major-fareast; mso-font-kerning: 0pt; mso-hansi-theme-font: major-fareast;">└──<span lang="EN-US"> settings.gradle<o:p></o:p></span></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<div align="left" class="MsoNormal">
<b><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">./gradle/wrapper/gradle-wrapper.properties<o:p></o:p></span></b></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">新しいプラグインの各バージョンは、特定の</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">Gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">のバージョンをサポートしています。最新のプラグイン</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">(0.6.0-alpha5)</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">は</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">Gradle-2.10</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">のみをサポートします。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; font-size: 9.0pt;">#Wed Apr 10 15:27:10 PDT 2013<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; font-size: 9.0pt;">distributionBase=GRADLE_USER_HOME<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; font-size: 9.0pt;">distributionPath=wrapper/dists<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; font-size: 9.0pt;">zipStoreBase=GRADLE_USER_HOME<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; font-size: 9.0pt;">zipStorePath=wrapper/dists<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; font-size: 9.0pt;">distributionUrl=https\://services.gradle.org/distributions/gradle2.10all.zip<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<b><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">./build.gradle<o:p></o:p></span></b></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">プラグインの</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">Class</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">パスの設定を従来の「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">com.android.tools:gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」から「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">com.android.tools.build:gradle-expermental</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」に変更します。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">最新バージョンは</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">0.6.0-alpha5</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">です。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">// </span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">最上位のビルドファイルでは、すべてのサブプロジェクト</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">/</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">モジュールに共通する設定が可能です。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">buildscript {<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-indent: 10.5pt;">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">repositories {<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-indent: 21pt;">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">jcenter()<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-indent: 10.5pt;">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-indent: 10.5pt;">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">dependencies {<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-indent: 21pt;">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">classpath "com.android.tools.build:gradle-experimental:<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-indent: 42pt;">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">0.6.0alpha5"<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-indent: 21pt;">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">// </span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">メモ:あなたのアプリケーションに依存関係を記述してはいけません。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-indent: 21pt;">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">// </span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">これらは個別のモジュールの</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">build.gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ファイルで記述します。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-indent: 10.5pt;">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">allprojects {<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-indent: 10.5pt;">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">repositories {<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-indent: 21pt;">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">jcenter()<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="text-indent: 10.5pt;">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<div align="left" class="MsoNormal">
<b><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">./app/build.gradle<o:p></o:p></span></b></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">これらは重要な</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">DSL</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">の変更になります。不必要と思われる多くの変更はイライラさせることを理解しています。従って、私たちの目標は、将来的に従来のプラグインからの変更を最小限に抑えるために、これらの変更の一部を除去することです。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">メモ:</span><span style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> <span lang="EN-US">0.6.0-alpha5</span></span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">以降で、以前のバージョンから重要な</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">DSL</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">の改善</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">(</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">変更</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">?)</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">がありました。そのため、例えば以前のバージョンのコードでは動作しなくなったりします。もし、古いバージョンのプラグインを使用する場合、ユーザーガイド「</span><a href="https://sites.google.com/a/android.com/tools/techdocs/newbuildsystem/gradleexperimental/0-4-0"><span lang="EN-US"><span style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">https://sites.google.com</span></span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">/a/android.com/tools/techdocs/newbuildsystem/gradleexperimental/0-4-0</span></a><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」を参照してください。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<h2>
<span lang="EN-US">DSL</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">の変更点</span><span lang="EN-US"><o:p></o:p></span></h2>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">プラグインの名前を「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">com.android.application</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」から「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">com.android.mo-del.application</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」に変更します。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ブロックで設定を囲います。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">コレクションに追加する要素は</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">add</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">メソッドを使用して行うようにします。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<h2>
<span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">現状の</span><span lang="EN-US">DSL</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">の願わくはなくなってほしい制限事項について</span><span lang="EN-US"><o:p></o:p></span></h2>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">リスト</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">(List)</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">プロパティは直接的なタイプのみの設定となっており、これらを接続するのに他のタイプでの方法がありません。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 42pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">Ø<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">例)あなたが文字列を使用して</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">File</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">タイプのプロパティを設定できますが、</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">List<File></span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">のプロパティについては</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">File</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">オブジェクトのみしか受け付けません。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">プロダクトフレーバーもしくはビルドタイプを生成するとき、</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">Create</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">メソッドを呼び出します。ビルドタイプのリリースとデバッグは名前だけを使用すればよいように変更します。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">DSL</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">の変更範囲は、現状は非常に限られた範囲でしかできません。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<div align="left" class="MsoNormal">
<br /></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">apply plugin:
"com.android.<span style="color: red;">model.</span>application"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="color: red; font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> compileSdkVersion 23<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> buildToolsVersion "23.0.2"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> defaultConfig {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> applicationId
"com.example.user.myapplication"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> minSdkVersion<span style="color: red;">.apiLevel
</span>15<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> targetSdkVersion<span style="color: red;">.apiLevel</span>
22<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> versionCode 1<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> versionName "1.0"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> buildConfigFields <span style="color: red;">{<o:p></o:p></span></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="color: red; font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> create() {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="color: red; font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> type "int"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="color: red; font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> name "VALUE"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="color: red; font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> value "1"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="color: red; font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="color: red; font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> buildTypes {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> release {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> minifyEnabled false<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> proguardFiles<span style="color: red;">.add(file(</span>"proguard-rules.pro"<span style="color: red;">))</span><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> productFlavors {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> <span style="color: red;">create("</span>flavor1<span style="color: red;">")</span> {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> applicationId "com.app"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> // Configures source set directory.<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> <span style="color: red;">sources</span> {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> main {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> java {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> source {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> srcDir "src"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">dependencies {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> compile fileTree(dir: "libs",
include: ["*.jar"])<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> compile
"com.android.support:appcompat-v7:22.2.0"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<h2>
<span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">コードへの署名</span><span lang="EN-US"><o:p></o:p></span></h2>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">$()</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">構文を使用して、異なるモデルの要素を参照することができます。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">2.10</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">以下のバージョンで使用するには</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">”-Dorg.gradle.model.dsl=true”</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">を</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">Gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">のコマンドラインの引数に追加する必要があります。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ノート:「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">android.signingConfigs</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」は</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">android{}</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ブロックの外側に記述しなければなりません。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> compileSdkVersion 23<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> buildToolsVersion "23.0.2"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> buildTypes {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> release {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> signingConfig =
$("android.signingConfigs.myConfig")<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android.signingConfigs {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> create("myConfig") {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> storeFile
"/path/to/debug.keystore"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> storePassword "android"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> keyAlias "androiddebugkey"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> keyPassword "android"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> storeType "jks"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<h2>
<span lang="EN-US">NDK</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">との統合</span><span lang="EN-US"><o:p></o:p></span></h2>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">試験的プラグインでは、ネイティブアプリケーションを作成するために</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">と統合しています。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">と統合するために以下をおこなう必要があります。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">AndroidStudio</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">の</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">SDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">マネージャを使用して</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">をダウンロードします。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">が配置されたディレクトリパスを「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">ndk.dir</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」の「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">local.properties</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」もしくは、</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">ANDROID_NDK_HOME</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">環境変数に設定します。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">build.gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">のモデルに「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">android.ndk</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」を追加します。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">単純な</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">アプリケーションの</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">build.gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ファイルは以下のような感じです。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">apply plugin: 'com.android.model.application'<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> compileSdkVersion 23<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> buildToolsVersion "23.0.2"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> <span style="color: red;">ndk {<o:p></o:p></span></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="color: red; font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> moduleName "native"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="color: red; font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ノート:生成されるネイティブライブラリの名前を決定するために</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">moduleName</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">の設定は必須です。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<h2>
<span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">ソースセット</span><span lang="EN-US"><o:p></o:p></span></h2>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">既定では</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">C/C++</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ファイルは</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">src/main/jni</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">を検索します。ソースディレクトリを変更するには「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">android.sources</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」を設定します。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> compileSdkVersion 23<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> buildToolsVersion "23.0.2"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> ndk {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> moduleName "native"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> sources {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> main {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> jni {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> source {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> srcDir "src"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">JNI</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">のソースセットは</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">C</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">と</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">C++</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ファイルが含まれるでしょう。サブディレクトリのすべてのファイルはインクルードされます。拡張子が「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">.c</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」のファイルは</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">C</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ファイルとして扱われる一方、</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">C++</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">のファイルは「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">.CPP</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">.c++</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">.cc</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">.cp</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">.cpp</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">.cxx</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」の拡張子を持つでしょう。ファイルを除外したい場合、</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">exclude</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">メソッドを使用する一方、</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">include</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">メソッドは無視されます。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android.sources {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> main {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> jni {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> source {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> include "someFile.txt" // </span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">これは無視されます</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">.<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> exclude
"**/excludeThisFile.c"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">様々なビルドオプションを</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">android.ndk{}</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ブロックに設定することができます。以下に例を挙げます。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> compileSdkVersion 23<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> buildToolsVersion "23.0.2"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> ndk {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> // </span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">すべての設定は</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">android.ndk</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">を変更することで可能です。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> moduleName "native"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> toolchain "clang"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> toolchainVersion "3.5"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> // Note that CFlags has a capital C,
which is inconsistent with<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> // the naming convention of other
properties. This is a<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> // technical limitation that will be
resolved<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> CFlags.add("-DCUSTOM_DEFINE")<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> cppFlags.add("-DCUSTOM_DEFINE")<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">
ldFlags.add("-L/custom/lib/path")<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> ldLibs.add("log")<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> stl
"stlport_static"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> buildTypes {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> release {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> ndk {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> debuggable true<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> productFlavors {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> create("arm") {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> ndk {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> // </span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">プロダクトフレーバーやビルドタイプごとの</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> // NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">設定をカスタマイズできます。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">
abiFilters.add("armeabiv7a")<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> create("fat") {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> // ndk.abiDilters</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">が設定されていない場合、アプリケーションは</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> // </span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">すべてのサポートしている</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">API</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">のパッケージをコンパイルします。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> // </span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">各種</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">設定を変更することができます。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> components.android {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> binaries.afterEach { binary -><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> binary.mergedNdkConfig.cppFlags.add(<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> "-DVARIANT=\"" +
binary.name + "\"")<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<h2>
<span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">既知の制限について</span><span lang="EN-US"><o:p></o:p></span></h2>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">cpu_features </span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">等を使用した</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">モジュールをサポートしません。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">他のビルドシステムとの統合をサポートしません。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">他のサンプルは「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">https://github.com/googlesamples/androidndk</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」にあります。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<h2>
<span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">複数の</span><span lang="EN-US">NDK</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">プロジェクト</span><span lang="EN-US"><o:p></o:p></span></h2>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">バージョン</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">0.4.0</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">のプラグインでは</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">の依存関係のための予備的なサポートとして、ネイティブライブラリを作成する機能を追加しました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<h2>
<span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">スタンドアロン</span><span lang="EN-US">NDK</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">プラグイン</span><span lang="EN-US"><o:p></o:p></span></h2>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">gradle-experimental:0.4.0</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">では、アンドロイドアプリケーションやライブラリを生成することなくネイティブライブラリを生成することができるようになりました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">DSL</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">は</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">application/library</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">プラグインと似通っています。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">’src/main/jni’</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">のソースから</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">libhello.so</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">を生成する</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">build.gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">の例は以下の通り。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">apply plugin:
"com.android.model.native"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> compileSdkVersion 23<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> ndk {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> moduleName "hello"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<h2>
<span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">既知の問題点について</span><span lang="EN-US"><o:p></o:p></span></h2>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">スタンドアロンプラグインでは</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">Android Studio</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">上での編集をまだサポートしていません。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">変更したライブラリ中のソースファイルを、アプリケーションのビルド時に新しいライブラリに自動的にアプリケーションへ再リンクしません。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<h2>
<span lang="EN-US">NDK</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">依存関係</span><span lang="EN-US"><o:p></o:p></span></h2>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">特定の依存関係を指定するための構文は、将来の</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">Gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">の依存関係システムのスタイルに従っています。アンドロイドプロジェクトや特定のファイルの依存関係を設定することができます。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">例えば、スタンドアロン</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">プラグインを使用した</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">’lib’</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">というサブプロジェクトがあった場合について以下に示します。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<b><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">lib/build.gradle<o:p></o:p></span></b></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">apply plugin: "com.android.model.native"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> compileSdkVersion 23<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> ndk {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> moduleName "hello"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> sources {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> main {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> jni {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> exportedHeaders {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> srcDir "src/main/headers"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">JNI</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">に依存関係があるすべてのプロジェクトが</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">‘exportedHeaders’</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">で指定されたディレクトリが含まれます。以下のように記述することで、アプリケーションの</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">JNI</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">コードに</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">lib</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">プロジェクトの依存関係を追加することができます。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<b><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">app/build.gradle<o:p></o:p></span></b></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">apply plugin:
"com.android.model.application"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> compileSdkVersion 23<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> buildToolsVersion "23.0.2"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> sources {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> main {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> jni {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> dependencies {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> project ":lib1"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">あなたはターゲットとするプロジェクトのプロダクトフレーバー及び</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">/</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">もしくはビルドターゲットを指定することができます。言い換えると、プラグインはアプリケーションのビルドタイプとプロダクトフレーバーから同じものを見つけようとします。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">例えば、希望する静的リンクするネイティブライブラリのリンケージタイプを指定する場合は以下の通り。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android.sources {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> main {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> jni {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> dependencies {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> project ":lib1"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> buildType "debug"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> productFlavor "flavor1"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> linkage "static"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">依存関係となるファイルを宣言するには、事前ビルドするライブラリや依存関係ライブラリを追加します。以下に例を示します。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> repositories {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> prebuilt(PrebuiltLibraries) {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> binaries.withType(SharedLibraryBinary) {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> sharedLibraryFile =<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> file("lib/${targetPlatform.getName()}/prebuilt.so")<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android.sources {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> main {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> jniLibs {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> dependencies {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> library "prebuilt"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">‘jni’</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">もしくは</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">’jniLibs’</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">配下のソースセットをネイティブな依存関係として追加することができます。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">’jniLibs’</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">をネイティブライブラリの依存関係として追加する場合、</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">application/library</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">にパッケージされますが、</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">JNI</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">コードのコンパイルするためには使用されません。以下に例を示します。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android.sources {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> main {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> jniLibs {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> dependencies {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> library "prebuilt"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<h2>
<span lang="EN-US">DSL</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">の変更箇所</span><span lang="EN-US"><o:p></o:p></span></h2>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">このプラグインは試験的なステージにあるため、</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">DSL</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">はプラグインの開発を通じて変更されることがあります。このセクションではマイグレーションの助けとなるように各プラグインのバージョン間で発生した際について記載します。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<h3 style="margin-left: 42.0pt;">
<span lang="EN-US">0.6.0-alpha1</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">→</span><span lang="EN-US">0.6.0-alpha5<o:p></o:p></span></h3>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">プラグインは</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">Gradle2.10</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">が必要となります。これは</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">DSL</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">に大幅な改善をもたらします。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ネストされた設定を以下のように記述することができます。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">android {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> buildType { … }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">を</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">android.buildType { … }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">と記述できます。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ファイルタイプが文字列を受け入れるようになりました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">List<File></span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">の対応についてはもうしばらくお待ちください。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">-Dorg.gradle.model=true</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">がデフォルトになりました。これで別のモデルを参照することができるようになりますが、参照する場合、分離されたブロックとする必要があります。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<h3 style="margin-left: 42.0pt;">
<span lang="EN-US">0.4.x</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">→</span><span lang="EN-US">0.6.0-alpha1<o:p></o:p></span></h3>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">特定のライブラリファイルの依存関係を指定するための</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">DSL</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">が</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">Gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">のネイティブに従うように変更されました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">(</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">「</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">https://github.com/gradle/gradle/blob/master/subprojects/docs/src/samples/native-binaries/prebuilt/build.gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">」を参照してください。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">)<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android.sources {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> main {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> jniLibs {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> dependencies {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> library
file("lib/x86/prebuilt.so") abi "x86"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> library
file("lib/armeabi-v7a/prebuilt.so") abi "armeabiv7a"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> library
file("lib/mips/prebuilt.so") abi "mips"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">が次のように変更されました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">model {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> repositories {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> prebuilt(PrebuiltLibraries) {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> binaries.withType(SharedLibraryBinary) {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> sharedLibraryFile =<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">
file("lib/${targetPlatform.getName()}/prebuilt.so")<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> android.sources {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> main {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> jniLibs {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> dependencies {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> library "prebuilt"<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<h3 style="margin-left: 42.0pt;">
<span lang="EN-US">0.2.x</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">→</span><span lang="EN-US">0.4.0<o:p></o:p></span></h3>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">+=</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">はコレクションのためにもはや動作しません。アイテムのリストに追加する場合、</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">’add’</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">もしくは</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">’addAll’</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">メソッドを使用します。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><br />
</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">例)</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">CFlags += “-DCUSTOM_DEFINE”</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">は</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">CFlags.add(“-DCUSTOM_DEFINE”)</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">に置き換えることができます。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<h3 style="margin-left: 42.0pt;">
<span lang="EN-US">0.1.x</span><span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">→</span><span lang="EN-US">0.2.x<o:p></o:p></span></h3>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">jniDebuggable</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">はビルドタイプの設定から除去され</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">ndk</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ブロックに移動しました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">release {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> jniDebuggable = true<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">は以下のようになります。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">release {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> ndk.with {<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> debuggable = true<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"> }<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">}<o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<br /></div>
<h2>
<span style="font-family: "ms ゴシック"; mso-ascii-font-family: Arial; mso-ascii-theme-font: major-latin; mso-fareast-font-family: "MS ゴシック"; mso-fareast-theme-font: major-fareast; mso-hansi-font-family: Arial; mso-hansi-theme-font: major-latin;">変更履歴</span><span lang="EN-US"><o:p></o:p></span></h2>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">0.6.0-alpha3<o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">依存関係のある事前ビルドライブラリの</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">DSL</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">を変更しました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">Gradle2.8</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">にアップデートしました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ネイティブライブラリの依存関係解決の様々な問題点を解決しました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoNormal">
<span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">0.4.0<o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">試験的なライブラリのプラグインで</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">jni</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">コード使用して問題を解決しました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">compileSdkVersion</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">からプラットフォームのバージョン設定を分離できるようになりました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">複数の</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">ABI</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">が含まれているバリアントで特定の</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">ABI</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">の設定ができるようになりました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">NDK</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">プラグインと動的オブジェクト</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">(shared object)/</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">静的ライブラリファイルの依存関係のサポートを追加しました。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<div align="left" class="MsoListParagraph" style="margin-left: 21pt; text-indent: -21pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: "wingdings"; mso-bidi-font-family: Wingdings; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt;">l<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">ネイティブコードのコンパイルのためのスタンドアロンプラグインのプレビューバージョンを追加しました。これを利用することで</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">Gradle</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">でアプリケーションをビルドできますが、</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;">Android Studio</span><span style="font-family: "ms 明朝" , serif; mso-ascii-font-family: "Courier New"; mso-bidi-font-family: "Courier New"; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: "MS 明朝"; mso-fareast-theme-font: minor-fareast; mso-font-kerning: 0pt; mso-hansi-font-family: "Courier New";">のサポートはまだ実装されていません。</span><span lang="EN-US" style="font-family: "courier new"; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt;"><o:p></o:p></span></div>
<br />
<div align="left" class="MsoNormal">
<br /></div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-4854978186354271672016-01-21T21:41:00.000+09:002016-01-21T21:41:57.227+09:00VisualStudio2015でandroid(java + jni)<h2>
結論から言うと、Androidの開発はこれでいいのかもしれない。</h2>
Visual Studio.NET 2015でクロスプラットフォーム開発ができるようになった。<br />
iOSについては、macがある前提だが、AndroidについてはXamarinを買わなくてもJava+Jniで開発ができるようなので色々調べてみた。<br />
<br />
<b>できること。</b><br />
<br />
<ul>
<li>javaとc++混在で開発ができる。</li>
<li>普通にデバッグ(ブレイクポイント/ウォッチ程度)ができる。</li>
<li>デバッグはjavaとC++両方でできる。</li>
<li>javaはintellisenceが使える。</li>
</ul>
<div>
という感じでコードメインのプロジェクトであれば普通に使えるような感じ。</div>
<div>
javaは「拡張機能と更新プログラム」で「Java Language Service for Android and Eclipse Android Project Import」を追加でインストールした。→これでIntellisenceとシンタックスハイライトが使えるようになるようだ。</div>
<div>
<br /></div>
<div>
<b>できないこと。</b></div>
<div>
<ul>
<li>layoutのGUIを使った定義</li>
</ul>
<div>
<br /></div>
</div>
<h4>
追加ライブラリの設定</h4>
<div>
プロジェクトフォルダ下に「libs」フォルダを切ってその下にjarファイルをおけばよい。</div>
<div>
勝手に参照されるかわからないので、一応、プロジェクトに追加しておく。</div>
<div>
ちなみに、プロジェクト下のフォルダルールは以下の通りぽい。</div>
<div>
<ul>
<li>libs\</li>
</ul>
</div>
<div>
<br /></div>
<h4>
勝手にキャッシュされる</h4>
<div>
ARM\Debug\Package下にキャッシュが作られる。リソース参照のためのRクラスもここで作られる。</div>
<div>
<br /></div>
<h4>
Rクラスの参照</h4>
<div>
キャッシュに勝手に作られる。参照できるかどうか?</div>
<div>
<br /></div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-14192071523524205532015-09-15T17:19:00.002+09:002015-09-15T17:19:57.922+09:00<h2>
Illustrator PDFにおける特色設定の入り方について覚書</h2>
<div>
ページエントリのReources/ColorSpace/[リソース名]下のカラースペースエントリとして設定される。</div>
<div>
<br /></div>
<div>
カラースペースの種類:Separation</div>
<div>
<br /></div>
<div>
PDF上は以下のように設定される。</div>
<div>
<br /></div>
<div>
[/Separation /[<span style="color: red;">特色名</span>] /[<span style="color: red;">代替え色の種類(AIはデバイスカラー)</span>] <<<span style="color: red;">代替え色の変換関数</span>>>]</div>
<div>
<br /></div>
<div>
特色名:AI CS3ではSJISエンコーディングされた文字が設定されました。</div>
<div>
代替え色の種類は以下の通りです。<br />
<br /></div>
<table>
<tbody>
<tr>
<td><b>AIの設定</b></td>
<td><b>PDF上のカラースペース</b></td>
</tr>
<tr>
</tr>
<tr>
<td>CMYK</td>
<td>-> DeviceCMYK</td>
</tr>
<tr>
</tr>
<tr>
<td>RGB</td>
<td>-> DeviceRGB</td>
</tr>
<tr>
</tr>
<tr>
<td>GrayScale</td>
<td>-> DeviceCMYK</td>
</tr>
<tr>
</tr>
<tr>
<td>HSB</td>
<td>-> DeviceRGB</td>
</tr>
<tr>
<td>Lab</td>
<td>-> Lab</td>
</tr>
</tbody></table>
<div>
<br /></div>
<div>
代替え色の変換関数は以下の通りです。<br />
<br />
FuntionType : 2(指数補間)関数<br />
N : 1<br />
C0 : GrayScale/CMYKは全て0.0, RGB/HSBは全て1.0<br />
C1 : 各成分の設定値<br />
Domain : [0 1]<br />
Range : [0 1 ...]<br />
<br />
つまり、0~1の範囲の値について1の時に設定した代替えカラーになるように調整されているという感じです。<br />
なので、初期設定時のコンテンツストリーム側を見ると<br />
<br />
/CS1 cs 1 scn<br />
<br />
というようになっています。<br />
これを、特色「カラー」のスライダーを変更すると0~1の範囲で値が切り替わります。<br />
<br />
代替えカラーは指数補間ですが、N=1なので<br />
<br />
代替え色[j] = C0[j] + 設定値^N * (C1[j] - C0[j])<br />
=> 0 + 設定値 * (C1[j] - 0)<br />
=> 設定値 * C1[j]<br />
<br />
となります。<br />
<br /></div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-76086907546239713362015-09-11T18:51:00.000+09:002015-09-11T18:51:42.971+09:00Jenkinsでc:\windows\system32下にアクセスできない件自動ビルドされたバイナリにバージョン番号を設定するため<br />
<br />
「<a href="http://www.codeproject.com/Articles/37133/Simple-Version-Resource-Tool-for-Windows">verpatch.exe</a>」<br />
<br />
を使ってファイルのプロパティにバージョン番号やらを設定していた。<br />
便利だと思って、c:\windows\system32下に放り込んでいたのですが、<br />
出来上がったバイナリにバージョン番号が全く埋め込まれておらず<br />
確認したところ、<br />
<br />
'c:\Windows\system32\verpatch.exe' は、内部コマンドまたは外部コマンド、<br />
操作可能なプログラムまたはバッチ ファイルとして認識されていません。<br />
<div>
<br /></div>
<div>
<br /></div>
というようなメッセージがログに出力されていた。<br />
バッチファイルでは普通に実行できたのにファイルの権限にUsersに<br />
フルコントロールを設定しても症状改善せず。<br />
<br />
結局、Dドライブの適当なフォルダに突っ込んでやったらうまく動作した。<br />
<br />
というわけで、<br />
<br />
<br />
<ul>
<li>jenkinsで動かす可能性のあるexeファイルはsystem32に入れないようにしましょう。</li>
</ul>
<div>
というお話です。</div>
<div>
<br /></div>
<br />
<br />ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-26994151327594525662015-09-04T10:08:00.001+09:002015-09-04T10:08:48.421+09:00jenkinsのバッチ実行エラーの対処<h2>
jenkinsを使ってwixでインストーラを作成しているケースで嵌ったのでメモ</h2>
<div>
wixのlight.exeでインストーラを作っているのですが、インストーラ自体はできていて、それを使って問題なくインストールもできているのですが、light.exeの戻り値が204を返してきてjenkinsのバッチ実行がエラーになってしまう問題の対処。</div>
<div>
<br /></div>
<div>
→ 実行するバッチファイルの最後に「cd ..」を追記する。</div>
<div>
<br /></div>
<div>
cdコマンドが0を返すのでエラーにならずにすむ。</div>
<div>
これでいいのかわからないけど、、、、</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
IF %ERRORLEVEL%=244 SET ERRORLEVEL=0</div>
<div>
<br /></div>
<div>
とかにしてもいいのかな?</div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-86136824970295189772015-07-27T09:20:00.003+09:002015-07-27T09:20:36.071+09:00VS.NET 2015でopensslをビルドするときのメモ__iob_funcが未定義と怒られたので調べてみた自分用メモ<br />
これはstdin/stdout/stderrのdefineが変わっているのが原因のようだ。<br />
<br />
以下の修正をすることで解消。<br />
<br />
修正ファイル:e_os.h<br />
<br />
300行目付近で<br />
<br />
# define stdin (&__iob_func()[0])<br />
# define stdout (&__iob_func()[1])<br />
# define stderr (&__iob_func()[2])<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
となっている箇所を</div>
<div>
<br /></div>
<div>
# define stdin (__acrt_iob_func(0))</div>
# define stdout (__acrt_iob_func(1))<br />
# define stderr (__acrt_iob_func(2))<br />
<div>
<br /></div>
<div>
と変更してやる。</div>
<div>
<br /></div>
<div>
もしくは、</div>
<div>
<br /></div>
<div>
#ifマクロで「_MSC_VER>=1900」の場合だけ「__acrt_iob_func」に</div>
<div>
変更するように修正を入れる。</div>
<div>
<br /></div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-20673749729262198862015-02-05T22:19:00.000+09:002015-02-05T22:19:15.377+09:00<h2>
PDFにおけるCMYKのDCTDecode(JPEG)の色反転について</h2>
反転するケースと反転しないケースがあり、反転しない場合と反転する場合の条件とIllustratorにおけるCMYKJpegの扱いについてまとめます。<br />
<br />
<br />
<ul>
<li>反転するケースと反転しないケースの別について</li>
</ul>
<div>
基本的には/Type = Image, /Filter = DCTDecodeで色空間がCMYKの場合、各値が「0」を100%の塗り、「255」を0%の塗りとして扱います。</div>
<div>
→なのでPDFから該当イメージのデータを引っこ抜くとポジネガ反転したようなJPEGになります。</div>
<div>
<br /></div>
<div>
次に、反転してないCMYKJPEGが貼りこんであるにもかかわらず、Acrobat表示が反転してないケースのコントロールは、イメージオブジェクトの/Decodeエントリでコントロールされます。</div>
<div>
Decodeエントリは各色要素の[最小値0, 最大値0, 最小値1, 最大値1, ...... 最小値N, 最大値N]という設定となっています。</div>
<div>
CMYKデータの場合、Nは4なのでDecodeエントリの配列には8つの値が設定されている事になります。</div>
<div>
<br /></div>
<div>
もし、Decodeエントリがない場合は、最小値 => 255, 最大値 => 0という扱いになりますが、反転してないCMYKJPEGの場合、Decodeエントリは大抵以下のように設定されています。</div>
<div>
<br /></div>
<div>
/Decode [1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0]</div>
<div>
<br /></div>
<div>
上記の通り、最小値 > 最大値なので各要素の値を反転するという意味になります。</div>
<div>
そのため、ポジネガ反転してないCMYKのJPEGでも正しく表示されるということになります。</div>
<div>
<br /></div>
<div>
※FlateDecodeの場合は、0が素直なのですが、CMYKのJPEGだけそんな扱いになります。</div>
<div>
<ul>
<li>Illustratorでの扱いについて</li>
</ul>
<div>
Illustratorでは、PDFファイルをオープンする際、Decodeエントリなんて気にせずに、CMYKのJPEGは必ずポジネガ反転しているという前提でオープンします。</div>
</div>
<div>
なので、Decodeエントリで反転しているようなCMYKJPEGデータが含まれている場合、Illustrator上では正しく表示されません。</div>
<div>
<br /></div>
<h3>
まとめ</h3>
<div>
PDFの出力するツールを実装している人は、生成したPDFファイルをIllustratorで編集するかどうかに留意しましょう。</div>
<div>
外部で生成されたCMYKのJPEGファイルを貼りこむ場合、後々Illustratorで編集する必要がある場合、事前にポジネガ反転したCMYKのJPEGを裏で生成し、それを使ってPDFに貼りこみましょう。</div>
<div>
<br /></div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-32194683549017821522014-12-11T21:51:00.001+09:002014-12-11T21:51:20.771+09:00<h2>
seleniumを使う①</h2>
Webの自動テストをやろうと思う。要件としては以下のとおりだ。<br />
<br />
<ul>
<li>ターゲットはWebのUI系のテストの自動化</li>
<li>テスト内容は同一だが各種ブラウザでのテストがある。</li>
<li>開発者の個別環境で実施するのではなく、サーバー上でテストを自動実施したい</li>
<li>jenkinsと連携させてリポジトリが更新されたらテスト実行を行う</li>
</ul>
<div>
途中はすっとばすがseleniumというWebのUI系の自動テストツールが使えるかもしれないということで調査することにした。</div>
<div>
こいつはFireFoxのプラグインとして動作してSelenium IDEというツールでユーザー操作を記録し、それをテストコードとして自動実行させることができるらしい。</div>
<div>
<br /></div>
<div>
というわけでまずはダウンロードしてみた。</div>
<div>
ダウンロード先:<a href="http://release.seleniumhq.org/selenium-ide/2.8.0/selenium-ide-2.8.0.xpi">http://release.seleniumhq.org/selenium-ide/2.8.0/selenium-ide-2.8.0.xpi</a></div>
<div>
<br /></div>
<div>
FireFoxで上記リンクを叩くと、自動的にselenium IDEがインストールされる。</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5MrpjqlvN0adi8IHhRNPifEJ4XUQKWzMT8l5gVaMLwLrkKAPWjXJjnQ7i9G7tGiY7j8GC-gUy4vbh3gm1pOsY4Lpwo8TbHulCxygmPKJNYq5BL16Wt4En6v66MpgFB45s-UGi4zAOZ-Hz/s1600/selenium_icon.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5MrpjqlvN0adi8IHhRNPifEJ4XUQKWzMT8l5gVaMLwLrkKAPWjXJjnQ7i9G7tGiY7j8GC-gUy4vbh3gm1pOsY4Lpwo8TbHulCxygmPKJNYq5BL16Wt4En6v66MpgFB45s-UGi4zAOZ-Hz/s1600/selenium_icon.png" /></a></div>
<br />
←インストールされると、このようなアイコンがFireFoxのアドレスバーあたりに追加される。<br />
<br />
<h3>
テストスクリプトの作成</h3>
FireFoxのツールバー上にselenium ideのアイコンが表示されるのでそれをクリック。<br />
表示された画面の赤丸ボタン(記録ボタン?)をクリックした後、ブラウザを操作<br />
→テストスクリプトが自動生成される。<br />
<br />
必要に応じてファイルに保存する。<br />
<i>※ここで一旦テストが通るかどうかの確認を行う。</i><br />
<h3>
VisualStudio.Netのテストプロジェクトで実行する</h3>
<div>
作ったテストスクリプトを今度はVisualStudio.Netのテストプロジェクトから実行させるという話。</div>
<h4>
テストケースのエクスポート</h4>
作成したテストケースをselenium IDEでオープンした状態でselenium IDEの以下のメニューを選択<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ファイル > テストケースをエクスポート > C# / NUnit WebDriver<br />
<br />
保存先を指定してテストケースを保存する。<br />
<h4>
VS.NETで単体テストプログラムの作成</h4>
VS.NETの新規プロジェクトを作成する。<br />
→ Visual C# > 単体テスト プロジェクト<br />
<br />
Nugetのパッケージマネージャコンソールを起動<br />
→VS.NETのツール > NuGetパッケージマネージャ > パッケージマネージャコンソール<br />
<br />
<i>※ VS.NETのバージョンによっては拡張パッケージマネージャというタイトルかも知れないです。</i><br />
<br />
でコンソールウインドウが表示。そこに<br />
<br />
<b>Install-Package Selenium.WebDriverBackedSelenium -Version 2.43.1</b><br />
<br />
を入力する。<br />
<h4>
VS.NETのテスト用に書き換えする。</h4>
selenium IDEで吐き出したテストコードはNUnit用なのでVS.NETで使うには幾つか書き換えが必要。<br />
基本的にはテストクラス/メソッドの属性を以下のように書き換えを行う。<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TestFixture → TestClass<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SetUp → TestInitialize<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TearDown → TestCleanup<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Test → TestMethod<br />
<h4>
参照設定を追加しておく。</h4>
https://code.google.com/p/selenium/downloads/detail?name=selenium-dotnet-2.39.0.zip&can=1&q=<br />
<br />
上記の「selenium-dotnet-2.39.0.zip」をダウンロードして展開しておく。<br />
↑で作ったプロジェクトに展開して生成されたアセンブリを参照設定に加えておく<br />
<br />
<i>※ for_dotnet\selenium-dotnet-2.4.1 を使っても良いです。</i><br />
<h3>
jenkinsで実行させる</h3>
次はjenkinsで動かすための設定だ。<br />
jenkinsから直接ブラウザを起動するのは難しいので、NodeとなるクライアントPC(仮想でも可)を用意して、実際のテストはそっちでやらせるようにする。<br />
WebDriver RCが必要になると思う。続きはまた今度<br />
<br />
<br />
<br />
<br />
<br />ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-27421653206487930982014-12-04T13:49:00.002+09:002014-12-04T13:49:41.553+09:00<h2>
SQLサーバーでアカウントロックされてしまったケースの対応</h2>
マネージメントスタジオがインストールされておらず、saアカウントしかなかったため復旧に手こずったのでメモ<br />
コマンドプロンプトでの対応方法<br />
<br />
<br />
<ol>
<li>サービスを終了させる<br />net stop mssqlserver<br /></li>
<li>サービスをシングルユーザーモードで起動させる<br />net start mssqlserver /f /m<br /></li>
<li>osqlを起動<br />osql -E<br /></li>
<li>saアカウントを有効にする<br />ALTER LOGIN sa ENABLE<br /></li>
<li>sqlサーバーを再起動<br />net stop mssqlserver<br />net start mssqlserver</li>
</ol>
<br />
これで、外部のPCからマネージメントスタジオでログインすることができるようになった!!<br />
ちなみに、Windows2003だったので2008以降は管理者権限でコマンドプロンプトを起動させる必要があると思います。ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-11841566127514470352014-11-22T10:52:00.000+09:002014-11-22T10:52:02.571+09:00Windowsサーバーのタスクスケジューラーで嵌った件あるシステムで嵌った話。<br />
(Windows)サーバー上で常駐起動するプログラムがあって、その起動をタスクスケジューラーで<br />
ログオン時に起動する設定にしていた。<br />
→普通のウインドウを持つプログラム。EUDC外字を使う関係上セッション0では正しく動作しない。<br />
→詳しくは<a href="http://techinfoofmicrosofttech.osscons.jp/index.php?Windows%E3%81%AE%E5%A4%96%E5%AD%97">こちら</a>が詳しい。<br />
<br />
システム更新作業があって、再起動を実施。実施後正しく起動していることを確認した。<br />
<br />
その3日後、客先から急に連絡が入ってきて、プログラムが動作していないとのこと。<br />
よくよく調べてみると誰かが勝手にプログラムを終了していた。<br />
→しかも異常終了ではなく普通にウインドウを閉じたような終了だった。<br />
<br />
原因を調査してみるとどうやらタスクスケジューラーの仕様で、デフォルトの設定では<br />
3日以上連続稼働しているプログラムは強制終了させる設定になっていることが原因だった。<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzDGv1i_DBk6yZioR4pDjQUfgE4rbeE46a6Kys5pf2xK2Ei8WlnPr9uqXAgVz7QwQEwu8lPpMATPLU73MEMBhSbmYGRgyRTYEPmajKb8gZaeaFFgfzsZcOlnRofMFtnxSYXgd6X7qjth9k/s1600/three_days_abandon.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzDGv1i_DBk6yZioR4pDjQUfgE4rbeE46a6Kys5pf2xK2Ei8WlnPr9uqXAgVz7QwQEwu8lPpMATPLU73MEMBhSbmYGRgyRTYEPmajKb8gZaeaFFgfzsZcOlnRofMFtnxSYXgd6X7qjth9k/s1600/three_days_abandon.png" height="227" width="320" /></a></div>
<br />
<br />
<ul>
<li>「タスクを停止するまでの時間」の設定があると勝手に終了する。</li>
</ul>
<br />
<br />
これからは気をつけよう。というかデフォルトの設定がおかしい気がする。<br />
<br />
<br />ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-37004521903109945092014-10-23T20:51:00.000+09:002014-10-23T20:51:57.189+09:00ubuntuの自分環境を作るための覚書<h2>
<span style="font-size: large;">ubuntuの環境を作るための覚書</span></h2>
ubuntu 14.04で自分用環境を作る覚書<br />
一応、ソース管理兼、実験用兼、メールサーバーを兼ねているようなサーバーです。<br />
<h3>
開発ツールの設定</h3>
<br />
<div>
sudo apt-get install build-essensial</div>
<div>
ubuntu14.04の場合、gcc 4.8.2がインストールされる。</div>
<h3>
apacheの導入</h3>
<div>
sudo apt-get install apache2</div>
<div>
でひと通りインストールされる。</div>
<h4>
ssl(オレオレ証明書)の設定</h4>
<div>
開発テストでとりあえず、httpsが必要なのでオレオレ証明書を作っておく。</div>
<div>
以下の手順でインストールする。</div>
<div>
<ol>
<li>OpenSSLを入れる<br />sudo apt-get install openssl<br />でインストールする。</li>
<li>apacheを設定する<br />sudo a2ensite default-ssl<br />sudo a2enmod ssl<br />sudo service apache2 restart<br />を行なう。<br />a2ensiteで443のバーチャルホストの設定ファイルのシンボリックファイルが/etc/apache2/sites-enabled/ssl-defaultに生成される。<br />a2enmodで、sslモジュールが使用できるようになる。</li>
<li>証明書の作成<br /></li>
<li>Virtual Hostの設定</li>
</ol>
</div>
<h3>
メールサーバーの設定</h3>
<h4>
postfixを入れる</h4>
<div>
sudo apt-get install postfix</div>
<div>
でメールサーバーがインストールされる。</div>
<div>
main.cfを編集し、</div>
<h4>
dovecotを入れる</h4>
<div>
メールをクライアントから受診するためにdovecotを使う。</div>
<div>
これも</div>
<div>
<br /></div>
<div>
sudo apt-get install dovecot-core dovecot-pop3d</div>
<div>
<br /></div>
<div>
でインストールする。</div>
<div>
今回はpop3を使うので上記の通り。imapを使う場合は「dovecot-imapd」も一緒にインストールすること。</div>
<div>
色々いじったような気がするけど忘れてしまった。。。。</div>
<h3>
monoの導入</h3>
<div>
sudo apt-get install mono-complete</div>
<div>
<br /></div>
<div>
でインストール。→無駄に全部はいるけど無視</div>
<div>
asp.netを使うためにmod_monoも入れる。</div>
<div>
<br /></div>
<div>
sudo apt-get install libapache2-mod-mono</div>
<div>
<br /></div>
<div>
でインストールされる。</div>
<div>
自分でソースを落としてきてmake installしてもいいけど、apache2の設定が面倒なのでapt-getしちゃった方が楽。</div>
<div>
但し、monoのバージョンは3.2.8(2014/10/23現在)になる。</div>
<h3>
gitの導入</h3>
<h4>
リポジトリの作成</h4>
<div>
sudo mkdir /srv/git</div>
<div>
<div>
sudo cd /srv/git</div>
</div>
<div>
sudo git init --init --bare [リポジトリ名]</div>
<div>
<br /></div>
<div>
で新規にリポジトリを作成する。</div>
<div>
<br /></div>
<div>
apacheから公開するために</div>
<div>
<br /></div>
<div>
chmod -R 0777 [リポジトリ名]</div>
<div>
<br /></div>
<div>
でapacheからアクセス出来るようにしておく。</div>
<div>
作成したgitリポジトリのディレクトリ直下に「git-daemon-export-ok」というファイルを置いておかないとリモートからpushできなくなるので注意!!</div>
<h4>
リポジトリの公開</h4>
<div>
作成したリポジトリをapacheで公開する。</div>
<div>
<br /></div>
<div>
sudo vim /etc/apache2/sites-enabled/git.conf</div>
<div>
<br /></div>
<div>
<div>
SetEnv GIT_PROJECT_ROOT "/srv/git"</div>
<div>
SetEnv GIT_HTTP_EXPORT_ALL</div>
<div>
<br /></div>
<div>
ScriptAlias /git/ "/usr/lib/git-core/git-http-backend/"</div>
<div>
SetEnv REMOTE_USER $REDIRECT_REMOTE_USER</div>
<div>
<Directory "/usr/lib/git-core"></div>
<div>
Options +ExecCGI</div>
<div>
Require all granted</div>
<div>
</Directory></div>
<div>
<LocationMatch "^/git/.*/git-receive-pack$"></div>
<div>
Options +ExecCGI</div>
<div>
Require all granted</div>
<div>
</LocationMatch></div>
<div>
<LocationMatch "^/git/.*/git-upload-pack$"></div>
<div>
Options +ExecCGI</div>
<div>
Require all granted</div>
<div>
</LocationMatch></div>
</div>
<div>
<br /></div>
<div>
を作っておくと、/git/以下はgitのリポジトリとして処理してくれる。</div>
<h3>
postgresの導入</h3>
<div>
sudo apt-get install postgresql</div>
<div>
でインストールされる。</div>
<h4>
pg_hba.confの編集</h4>
<div>
ローカルのアプリケーションから使うために、pg_hba.confの設定を行なう。</div>
<div>
<br /></div>
<div>
sudo vim /etc/postgresql/9.3/main/pg_hba.conf</div>
<div>
<br /></div>
<div>
でpg_hba.confファイルをオープンする。</div>
<div>
<br /></div>
<div>
local all all 127.0.0.1/32 trust</div>
<div>
<br /></div>
<div>
に変更する。変更元はtrustの部分がmd5になっているところ。</div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0tag:blogger.com,1999:blog-8979312044631589497.post-88911128612625850682013-04-26T10:33:00.002+09:002013-04-26T10:33:58.764+09:00Photoshop.Application.DoJavaScriptをjscript(jsxではない)から呼び出す時に嵌ったのでメモPhotoshopを外部スクリプトから操作するとき<br />
<br />
var app = new ActiveXObject('Photoshop.Application');<br />
<br />
とPhotoshopオブジェクトを作っておいて<br />
<br />
app.DoJavaScriptを呼び出すのですが、外部のスクリプトから引数を渡さなければ<br />
問題ないのですが、引数を渡したいときに嵌った。<br />
引数は第二パラメータに配列で渡す必要があるので以下のようなコードを書いた。<br />
<br />
app.DoJavaScript("alert('Hello World!:' + arguments[0]);", ['引数1'], 1);<br />
<br />
これを実行すると、「無効な引数 - 引数2 - 配列が必要」というエラーが発生してしまう。<br />
JavaScriptの配列はCOMでは配列扱いにしてくれない臭い。<br />
<br />
同じようなことをVBScriptで書いた場合、すんなりと動いてしまう。。。。<br />
<br />
<br />
Dim app<br />
Set app = CreateObject("Photoshop.Application")<br />
Dim arg<br />
arg = Array("引数1", "2")<br />
app.DoJavaScript "alert('Hello World!' + arguments[0]);", arg, 1<br />
<div>
<br /></div>
<div>
実行するとPhotoshop上で「Hello World! 引数1」とメッセージが表示される。</div>
<div>
VBScriptの配列はCOMの配列として扱ってくれるようだ。</div>
<div>
<br /></div>
<div>
これを解決するために以下の様な関数を作ってみた。</div>
<div>
<br /></div>
<div>
<div>
function toVBArray(arry)</div>
<div>
{</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>var dic = new ActiveXObject("Scripting.Dictionary");</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>for(var i = 0; i < arry.length; ++i) {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>dic.add(i, arry[i]);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>return dic.Items();</div>
<div>
}</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<div>
JScriptの配列をVBScript互換の配列に変換したい場合、一旦Dictionaryを経由すれば良いらしい。</div>
</div>
<div>
先ほどのDoJavaScriptの呼び出しコードを以下のように変更する。</div>
<div>
<br /></div>
<div>
app.DoJavaScript("alert('Hello World!:' + arguments[0]);", toVBArray(['引数1']), 1);</div>
<div>
<br /></div>
<div>
これで無事に引数を渡すことができた!!</div>
<div>
<br /></div>
ぷろたんhttp://www.blogger.com/profile/11202472503617207185noreply@blogger.com0