3 * This file is part of shape_android.
5 * shape_android is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * shape_android is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with shape_android. If not, see <http://www.gnu.org/licenses/>.
19 package org.ocera.orte.shape_android;
21 import android.content.Context;
22 import android.net.wifi.WifiManager;
23 import android.os.Bundle;
24 import android.preference.PreferenceActivity;
25 import android.preference.EditTextPreference;
26 import android.text.format.Formatter;
29 * This activity show settings.
31 * @author jiri hubacek <jiri.hubacek@gmail.com>
35 public class SettingsActivity extends PreferenceActivity
38 * Setting up workspace.
43 protected void onCreate(Bundle savedInstanceState)
45 super.onCreate(savedInstanceState);
46 addPreferencesFromResource(R.layout.activity_settings);
48 WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
49 EditTextPreference pref = (EditTextPreference) findPreference("prefManagers");
51 //TODO should be done in respect to @strings
52 pref.setSummary("Comma separated manager\'s IP addresses" + " (actual IP: "+Formatter.formatIpAddress(wifiManager.getConnectionInfo().getIpAddress())+")");