LoginSignup
96
96

More than 5 years have passed since last update.

オープンソースライセンス表記のテンプレート

Last updated at Posted at 2015-02-23

Googleアプリの表記に習う

オープンソースソフトウェアをアプリで利用した際に、
どのようにライセンス表記するか、Androidとしてルールはないです。
ただ、Googleが開発したAndroidアプリには(マチマチではあるが)一定のルールがあるように見受けられます。

例えば、以下のようなもの(例:PlayStoreアプリ)
タイトルを除いたこの表記のテンプレートを書き残します。

スクリーンショット 2015-02-20 0.22.03.png

テンプレとその使い方

ファイル名とそのライセンス文だけ入れ替えれるだけのテンプレのHTMLです。
タイトルは含んでません。

  1. 作ったファイルをプロジェクトのassets配下に配置し、
  2. ライセンス表記するActivityかDialogかにWebViewを貼り付けておき
  3. licenses.htmlを食わせるだけです。
    ex) webview.loadUrl("file:///android_asset/lisences.html");

※2つ以上ある場合は、<h3> から </pre>タグまでをコピペして増やしていってください。

<html>
<head><style> body { font-family: sans-serif; } pre { background-color: #eeeeee; padding: 1em; white-space: pre-wrap; } </style></head><body>
<h3>Notices for files:</h3><ul>
<li>オープンソースのファイル名(基本的にjarファイル名になるかと思う)</li>
</ul>
<pre>
ここにライセンス文を貼り付ける
</pre>
</body></html>

サンプル

有名なguavaとvolleyのライセンスを表示するサンプルのHTMLです。

licenses.html
<html>
<head><style> body { font-family: sans-serif; } pre { background-color: #eeeeee; padding: 1em; white-space: pre-wrap; } </style></head><body>
<h3>Notices for files:</h3><ul>
<li>guava-11.0.1.jar</li>
</ul>
<pre>Copyright (C) 2010 The Guava Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</pre>
<h3>Notices for files:</h3><ul>
<li>volley.jar</li>
</ul>
<pre>Copyright (C) 2011 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</pre>
</body></html>

サンプルをWebviewに貼り付けたイメージ

スクリーンショット 2015-02-20 0.55.33.png

96
96
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
96
96