Skip to content

Commit

Permalink
[DEV] Fill external license : Cling and NanoHTTPD
Browse files Browse the repository at this point in the history
  • Loading branch information
trishika committed Jun 30, 2013
1 parent 09de8bf commit a63ef48
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 82 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@ Description
===========

DroidUPnP is an upnp control point application for android.
It is licensed under the GPLv3.

It is licensed under the **GPLv3**.

Dependancies

Dependencies
============

The main dependance of DroidUPnP is cling whitch is the an
The main dependence of DroidUPnP is **Cling** which is the an
upnp stack made in java and with an android support layer.
Cling in licensed under the LGPLv2.
Cling in licensed under the **LGPLv2**.
Source code is available at [4thline.org](http://4thline.org/projects/cling/)

DroidUPnP use also **NanoHttpd**. NanoHttpd is under a modify **BSD license**.
Source code is available on [GitHub](https://github.com/NanoHttpd/nanohttpd).

Copying
=======

Copyright (C) 2012, Aurélien Chabot <[email protected]>
Copyright (C) 2013, Aurélien Chabot <[email protected]>

Licensed under GPLv3

48 changes: 5 additions & 43 deletions res/layout/about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,55 +23,17 @@
android:layout_height="fill_parent"
android:padding="20dp" >

<LinearLayout
android:id="@+id/version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginBottom="10dp">

<TextView
android:id="@+id/version_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/version"
android:paddingRight="10dp"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/version_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceMedium" />

</LinearLayout>

<TextView
android:id="@+id/copyright"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_copyright"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_contact"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/about_app"
android:id="@+id/about_cling"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/about_app"
android:layout_marginTop="30dp" />
android:text="@string/about_cling" />

<TextView
android:id="@+id/about_cling"
android:id="@+id/about_nanohttpd"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/about_cling" />
android:text="@string/about_nanohttpd"
android:layout_marginTop="30dp" />

</LinearLayout>
6 changes: 0 additions & 6 deletions res/menu/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
android:showAsAction="never"
android:title="@string/menu_settings"/>

<!--<item
android:id="@+id/menu_about"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/menu_about"/>-->

<item
android:id="@+id/menu_quit"
android:orderInCategory="100"
Expand Down
3 changes: 3 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
<string name="about_contact">Contact : [email protected]</string>
<string name="license">License</string>
<string name="about_license">GPLv3</string>
<string name="link_license">http://www.gnu.org/licenses/gpl-3.0.html</string>
<string name="license_other">Library license</string>
<string name="about_license_other"></string>
<string name="source">Source Code</string>
<string name="source_url">http://github.com/trishika/droidupnp</string>
<string name="more">More information</string>
Expand Down
12 changes: 11 additions & 1 deletion res/xml/about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ along with DroidUPNP. If not, see <http://www.gnu.org/licenses/>.
<Preference
android:key="license"
android:title="@string/license"
android:summary="@string/about_license" />
android:summary="@string/about_license" >
<intent
android:action="android.intent.action.VIEW"
android:data="@string/link_license" />
</Preference>

<Preference
android:key="source"
Expand All @@ -43,4 +47,10 @@ along with DroidUPNP. If not, see <http://www.gnu.org/licenses/>.
android:data="@string/source_url" />
</Preference>

<Preference
android:key="license_other"
android:title="@string/license_other"
android:summary="@string/about_license_other" >
</Preference>

</PreferenceScreen>
3 changes: 0 additions & 3 deletions src/org/droidupnp/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,6 @@ public boolean onOptionsItemSelected(MenuItem item)
case R.id.menu_settings:
startActivity(new Intent(this, SettingsActivity.class).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP));
break;
//case R.id.menu_about:
// AboutDialog.showDialog(this);
// break;
case R.id.menu_quit:
finish();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.text.Html;
Expand All @@ -34,14 +33,14 @@
import android.view.LayoutInflater;
import android.widget.TextView;

public class AboutDialog extends DialogFragment {
public class LicenseDialog extends DialogFragment {

private static final String TAG = "AboutDialog";
private static final String TAG = "LicenseDialog";

public static void showDialog(Activity ctx)
{
AboutDialog newFragment = new AboutDialog();
newFragment.show(ctx.getFragmentManager(), ctx.getString(R.string.about_app));
LicenseDialog newFragment = new LicenseDialog();
newFragment.show(ctx.getFragmentManager(), ctx.getString(R.string.about_license_other));
}

@Override
Expand All @@ -57,32 +56,19 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
d.show();

TextView textView;
textView = (TextView) d.findViewById(R.id.version_number);
if (textView != null)
{
textView.setMovementMethod(LinkMovementMethod.getInstance());
try
{
textView.setText(getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName);
}
catch (NameNotFoundException e)
{
Log.e(TAG, "Application version name not found");
}
}

textView = (TextView) d.findViewById(R.id.about_app);
textView = (TextView) d.findViewById(R.id.about_cling);
if (textView != null)
{
textView.setMovementMethod(LinkMovementMethod.getInstance());
textView.setText(Html.fromHtml(getString(R.string.about_app)));
textView.setText(Html.fromHtml(getString(R.string.about_cling)));
}

textView = (TextView) d.findViewById(R.id.about_cling);
textView = (TextView) d.findViewById(R.id.about_nanohttpd);
if (textView != null)
{
textView.setMovementMethod(LinkMovementMethod.getInstance());
textView.setText(Html.fromHtml(getString(R.string.about_cling)));
textView.setText(Html.fromHtml(getString(R.string.about_nanohttpd)));
}

return d;
Expand Down
12 changes: 10 additions & 2 deletions src/org/droidupnp/view/SettingsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import android.app.ActionBar;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Bundle;
Expand All @@ -32,7 +31,6 @@
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.support.v4.app.NavUtils;
import android.support.v4.app.TaskStackBuilder;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -217,6 +215,16 @@ public void onCreate(Bundle savedInstanceState)
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "exception", e);
}

// Dialog for external license
Preference customPref = (Preference) findPreference("license_other");
customPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
LicenseDialog.showDialog(getActivity());
return false;
}
});

}
}

Expand Down

0 comments on commit a63ef48

Please sign in to comment.