├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── MuklukMudClient ├── libs │ ├── jackson-core-asl-1.9.0.jar │ ├── GoogleAdMobAdsSdk-4.1.1.jar │ └── jackson-mapper-asl-1.9.0.jar ├── src │ └── main │ │ ├── ic_launcher_boot-web.png │ │ ├── ic_notification_boot-web.png │ │ ├── res │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher_boot.png │ │ │ └── ic_notification_boot.png │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher_boot.png │ │ │ └── ic_notification_boot.png │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher_boot.png │ │ │ └── ic_notification_boot.png │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher_boot.png │ │ │ └── ic_notification_boot.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher_boot.png │ │ │ └── ic_notification_boot.png │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── attrs.xml │ │ │ └── strings.xml │ │ ├── values-en-rAU │ │ │ └── strings.xml │ │ ├── values-en-rCA │ │ │ └── strings.xml │ │ ├── values-en-rGB │ │ │ └── strings.xml │ │ ├── drawable │ │ │ └── entrystyle.xml │ │ ├── menu │ │ │ ├── world_list_context_menu.xml │ │ │ ├── world_list_menu.xml │ │ │ └── world_connection_menu.xml │ │ ├── layout │ │ │ ├── checkbox_dialog.xml │ │ │ ├── text_dialog.xml │ │ │ ├── world_list_row.xml │ │ │ ├── world_list.xml │ │ │ ├── text_size_preference.xml │ │ │ ├── world_connection.xml │ │ │ ├── color_preference.xml │ │ │ ├── about.xml │ │ │ └── add_edit_world.xml │ │ └── xml │ │ │ └── global_settings.xml │ │ ├── java │ │ └── com │ │ │ └── crap │ │ │ └── mukluk │ │ │ ├── StyleInfo.java │ │ │ ├── GlobalSettingsActivity.java │ │ │ ├── AboutActivity.java │ │ │ ├── BlockingQueue.java │ │ │ ├── FixedSizeList.java │ │ │ ├── SerializableWorld.java │ │ │ ├── IndexedColors.java │ │ │ ├── WorldMessage.java │ │ │ ├── Utility.java │ │ │ ├── LineStyleInfo.java │ │ │ ├── WorldListAdapter.java │ │ │ ├── EchoColorPreference.java │ │ │ ├── BackgroundColorPreference.java │ │ │ ├── ForegroundColorPreference.java │ │ │ ├── TextSizePreference.java │ │ │ ├── World.java │ │ │ ├── WorldDbAdapter.java │ │ │ ├── ConsoleTextHistory.java │ │ │ ├── TcpConnection.java │ │ │ ├── WorldConnectionService.java │ │ │ ├── AddEditWorldActivity.java │ │ │ ├── AnsiUtility.java │ │ │ └── WorldListActivity.java │ │ └── AndroidManifest.xml └── build.gradle ├── README.md ├── LICENSE.md ├── gradlew.bat ├── .gitattributes ├── gradlew └── .gitignore /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':MuklukMudClient' 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /MuklukMudClient/libs/jackson-core-asl-1.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/libs/jackson-core-asl-1.9.0.jar -------------------------------------------------------------------------------- /MuklukMudClient/libs/GoogleAdMobAdsSdk-4.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/libs/GoogleAdMobAdsSdk-4.1.1.jar -------------------------------------------------------------------------------- /MuklukMudClient/libs/jackson-mapper-asl-1.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/libs/jackson-mapper-asl-1.9.0.jar -------------------------------------------------------------------------------- /MuklukMudClient/src/main/ic_launcher_boot-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/src/main/ic_launcher_boot-web.png -------------------------------------------------------------------------------- /MuklukMudClient/src/main/ic_notification_boot-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/src/main/ic_notification_boot-web.png -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/mipmap-hdpi/ic_launcher_boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/src/main/res/mipmap-hdpi/ic_launcher_boot.png -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/mipmap-mdpi/ic_launcher_boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/src/main/res/mipmap-mdpi/ic_launcher_boot.png -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/mipmap-xhdpi/ic_launcher_boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/src/main/res/mipmap-xhdpi/ic_launcher_boot.png -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/mipmap-xxhdpi/ic_launcher_boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/src/main/res/mipmap-xxhdpi/ic_launcher_boot.png -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/mipmap-xxxhdpi/ic_launcher_boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/src/main/res/mipmap-xxxhdpi/ic_launcher_boot.png -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/mipmap-hdpi/ic_notification_boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/src/main/res/mipmap-hdpi/ic_notification_boot.png -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/mipmap-mdpi/ic_notification_boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/src/main/res/mipmap-mdpi/ic_notification_boot.png -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/mipmap-xhdpi/ic_notification_boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/src/main/res/mipmap-xhdpi/ic_notification_boot.png -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/mipmap-xxhdpi/ic_notification_boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/src/main/res/mipmap-xxhdpi/ic_notification_boot.png -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/mipmap-xxxhdpi/ic_notification_boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/Mukluk/master/MuklukMudClient/src/main/res/mipmap-xxxhdpi/ic_notification_boot.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Oct 20 20:30:11 EDT 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip 7 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #A4C639 4 | #000000 5 | #BEBEBE 6 | #181818 7 | #FFFFFF 8 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/java/com/crap/mukluk/StyleInfo.java: -------------------------------------------------------------------------------- 1 | package com.crap.mukluk; 2 | 3 | import android.text.style.CharacterStyle; 4 | 5 | public class StyleInfo 6 | { 7 | CharacterStyle style; 8 | int start; 9 | int end; 10 | 11 | public StyleInfo(CharacterStyle style, int start) 12 | { 13 | this.style = style; 14 | this.start = start; 15 | this.end = -1; 16 | } 17 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Mukluk MUD Client is an Android M* (MUDs, MUSHs, MOOs, etc.) client that was originally added to the Google Play Store in 2010. It featured full ANSI support and the ability to connect to multiple worlds simultaneously. 2 | 3 | Mukluk no longer works on more recent versions of Android due to changes in the operating system's behavior and security. The source code is provided for anybody to do whatever they like with it. Enjoy! 4 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/values-en-rAU/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Background Colour 5 | Text Colour 6 | Command Colour 7 | 8 | 9 | ANSI Colours Enabled 10 | 11 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/values-en-rCA/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Background Colour 5 | Text Colour 6 | Command Colour 7 | 8 | 9 | ANSI Colours Enabled 10 | 11 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/values-en-rGB/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Background Colour 5 | Text Colour 6 | Command Colour 7 | 8 | 9 | ANSI Colours Enabled 10 | 11 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/drawable/entrystyle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 14 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/java/com/crap/mukluk/GlobalSettingsActivity.java: -------------------------------------------------------------------------------- 1 | package com.crap.mukluk; 2 | 3 | import android.os.Bundle; 4 | import android.preference.PreferenceActivity; 5 | 6 | public class GlobalSettingsActivity extends PreferenceActivity 7 | { 8 | @Override 9 | public void onCreate(Bundle savedInstanceState) 10 | { 11 | super.onCreate(savedInstanceState); 12 | addPreferencesFromResource(R.xml.global_settings); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/menu/world_list_context_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 12 | 16 | 20 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/layout/checkbox_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 20 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/layout/text_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 19 | 25 | 26 | -------------------------------------------------------------------------------- /MuklukMudClient/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 16 5 | buildToolsVersion "21.1.2" 6 | 7 | defaultConfig { 8 | applicationId "com.crap.mukluk" 9 | minSdkVersion 11 10 | targetSdkVersion 16 11 | versionCode 205 12 | versionName "2.05" 13 | } 14 | 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 19 | } 20 | } 21 | 22 | packagingOptions { 23 | exclude 'META-INF/ASL2.0' 24 | exclude 'META-INF/LICENSE' 25 | exclude 'META-INF/MANIFEST.MF' 26 | exclude 'META-INF/NOTICE' 27 | } 28 | } 29 | 30 | dependencies { 31 | compile files('libs/jackson-core-asl-1.9.0.jar') 32 | compile files('libs/jackson-mapper-asl-1.9.0.jar') 33 | } 34 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/java/com/crap/mukluk/AboutActivity.java: -------------------------------------------------------------------------------- 1 | package com.crap.mukluk; 2 | 3 | import android.app.Activity; 4 | import android.content.pm.PackageInfo; 5 | import android.content.pm.PackageManager; 6 | import android.content.pm.PackageManager.NameNotFoundException; 7 | import android.os.Bundle; 8 | import android.widget.TextView; 9 | 10 | public class AboutActivity extends Activity 11 | { 12 | @Override 13 | public void onCreate(Bundle savedInstanceState) 14 | { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.about); 17 | 18 | TextView version = (TextView) findViewById(R.id.text_version); 19 | PackageManager pm = getPackageManager(); 20 | PackageInfo pInfo; 21 | 22 | try 23 | { 24 | pInfo = pm.getPackageInfo("com.crap.mukluk", 0); 25 | version.setText(pInfo.versionName); 26 | } 27 | catch (NameNotFoundException ex) 28 | { 29 | version.setText("Unknown Version"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/menu/world_list_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 13 | 18 | 23 | 28 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/java/com/crap/mukluk/BlockingQueue.java: -------------------------------------------------------------------------------- 1 | package com.crap.mukluk; 2 | 3 | import java.util.LinkedList; 4 | 5 | public class BlockingQueue 6 | { 7 | private LinkedList list; 8 | 9 | public BlockingQueue() 10 | { 11 | list = new LinkedList(); 12 | } 13 | 14 | public synchronized void addMessage(T msg) 15 | { 16 | list.addLast(msg); 17 | 18 | notifyAll(); 19 | } 20 | 21 | // Gets a message from the queue. If none are available, blocks until some become available. 22 | // Returns null if thread interrupted 23 | // Returns null if queue will no longer be delivering messages 24 | public synchronized T getMessage() 25 | { 26 | while (list.size() == 0 /*&& !shutDownFlag*/) 27 | { 28 | try 29 | { 30 | wait(); 31 | } 32 | catch (InterruptedException e) 33 | { 34 | return null; 35 | } 36 | } 37 | 38 | return list.removeFirst(); 39 | } 40 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Mukluk is released under the MIT license. 2 | 3 | Copyright (c) 2010-2022 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /MuklukMudClient/src/main/java/com/crap/mukluk/FixedSizeList.java: -------------------------------------------------------------------------------- 1 | package com.crap.mukluk; 2 | 3 | import java.util.LinkedList; 4 | 5 | // A queue where items are removed if the list exceeds a certain size 6 | @SuppressWarnings("serial") 7 | public class FixedSizeList extends LinkedList 8 | { 9 | int _maximumSize; 10 | 11 | public FixedSizeList(int maximumSize) 12 | { 13 | super(); 14 | 15 | _maximumSize = maximumSize; 16 | } 17 | 18 | public boolean add(E item) 19 | { 20 | boolean addResult = super.add(item); 21 | 22 | if (this.size() > _maximumSize) 23 | this.removeFirst(); 24 | 25 | return addResult; 26 | } 27 | 28 | public void addFirst(E item) 29 | { 30 | super.addFirst(item); 31 | 32 | if (this.size() > _maximumSize) 33 | this.removeLast(); 34 | } 35 | 36 | public void setMaximumSize(int newMaximumSize) 37 | { 38 | int currentSize = this.size(); 39 | 40 | if (currentSize > newMaximumSize) 41 | this.subList(0, currentSize - newMaximumSize).clear(); 42 | 43 | _maximumSize = newMaximumSize; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/menu/world_connection_menu.xml: -------------------------------------------------------------------------------- 1 | 4 | 10 | 16 | 22 | 27 | 32 | 33 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/layout/world_list_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 27 | 28 | 37 | 38 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/java/com/crap/mukluk/SerializableWorld.java: -------------------------------------------------------------------------------- 1 | package com.crap.mukluk; 2 | 3 | import java.io.Serializable; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | // Weird errors occur when a class is both parcelable and serializable, so use this to export and import World class 8 | public class SerializableWorld implements Serializable 9 | { 10 | private static final long serialVersionUID = 358488681588640820L; 11 | public String name; 12 | public String host; 13 | public int port = 0; 14 | public boolean loggingEnabled = false; 15 | public boolean ansiColorEnabled = true; 16 | public String encodingName; 17 | public List postLoginCommands = new ArrayList(); 18 | 19 | public SerializableWorld(World world) 20 | { 21 | this.name = world.name; 22 | this.host = world.host; 23 | this.port = world.port; 24 | this.loggingEnabled = world.loggingEnabled; 25 | this.ansiColorEnabled = world.ansiColorEnabled; 26 | this.encodingName = world.encoding.name(); 27 | postLoginCommands.addAll(world.postLoginCommands); 28 | } 29 | 30 | public World getAsWorld() 31 | { 32 | World world = new World(); 33 | world.name = name; 34 | world.host = host; 35 | world.port = port; 36 | world.loggingEnabled = loggingEnabled; 37 | world.ansiColorEnabled = ansiColorEnabled; 38 | world.setCharset(encodingName); 39 | world.postLoginCommands.addAll(postLoginCommands); 40 | 41 | return world; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/layout/world_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 18 | 29 | 34 | 43 | 44 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/java/com/crap/mukluk/IndexedColors.java: -------------------------------------------------------------------------------- 1 | package com.crap.mukluk; 2 | 3 | import android.graphics.Color; 4 | 5 | public class IndexedColors 6 | { 7 | public int[] colorTable = new int[256]; 8 | 9 | public IndexedColors() 10 | { 11 | // first 16 colors are light and dark versions of the basic 8 VGA colors 12 | colorTable[0] = Color.parseColor("#000000"); 13 | colorTable[1] = Color.parseColor("#cd0000"); 14 | colorTable[2] = Color.parseColor("#00cd00"); 15 | colorTable[3] = Color.parseColor("#cdcd00"); 16 | colorTable[4] = Color.parseColor("#0000ee"); 17 | colorTable[5] = Color.parseColor("#cd00cd"); 18 | colorTable[6] = Color.parseColor("#00cdcd"); 19 | colorTable[7] = Color.parseColor("#e5e5e5"); 20 | colorTable[8] = Color.parseColor("#7f7f7f"); 21 | colorTable[9] = Color.parseColor("#ff0000"); 22 | colorTable[10] = Color.parseColor("#00ff00"); 23 | colorTable[11] = Color.parseColor("#ffff00"); 24 | colorTable[12] = Color.parseColor("#5c5cff"); 25 | colorTable[13] = Color.parseColor("#ff00ff"); 26 | colorTable[14] = Color.parseColor("#00ffff"); 27 | colorTable[15] = Color.parseColor("#ffffff"); 28 | 29 | // middle 216 30 | for (int red = 0; red <= 5; red++) 31 | { 32 | for (int green = 0; green <= 5; green++) 33 | { 34 | for (int blue = 0; blue <= 5; blue++) 35 | { 36 | int index = 16 + (red * 36) + (green * 6) + blue; 37 | 38 | colorTable[index] = Color.rgb((red * 40) + 55, (green * 40) + 55, (blue * 40) + 55); 39 | } 40 | } 41 | } 42 | 43 | // last 24 are a greyscale ramp 44 | for (int i = 0; i <= 23; i++) 45 | { 46 | int whiteness = (i * 10) + 8; 47 | colorTable[i + 232] = Color.rgb(whiteness, whiteness, whiteness); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/java/com/crap/mukluk/WorldMessage.java: -------------------------------------------------------------------------------- 1 | package com.crap.mukluk; 2 | 3 | import android.content.ContentValues; 4 | import android.os.Parcel; 5 | import android.os.Parcelable; 6 | 7 | // Represents messages from world -> activity or activity -> world 8 | public class WorldMessage implements Parcelable 9 | { 10 | public static final int MESSAGE_TYPE_ERROR = -1; 11 | public static final int MESSAGE_TYPE_STATUS_CHANGE = 0; 12 | public static final int MESSAGE_TYPE_TEXT = 1; 13 | 14 | public int type; 15 | public int currentStatus; 16 | public CharSequence text; 17 | 18 | public WorldMessage(int type, int currentStatus, CharSequence text) 19 | { 20 | this.type = type; 21 | this.currentStatus = currentStatus; 22 | this.text = text; 23 | } 24 | 25 | public WorldMessage(Parcel in) 26 | { 27 | type = in.readInt(); 28 | currentStatus = in.readInt(); 29 | text = in.readString(); 30 | } 31 | 32 | public ContentValues getContentValues() 33 | { 34 | ContentValues vals = new ContentValues(3); 35 | 36 | vals.put("type", type); 37 | vals.put("currentStatus", currentStatus); 38 | vals.put("text", (String) text); 39 | 40 | return vals; 41 | } 42 | 43 | @Override 44 | public int describeContents() 45 | { 46 | return 0; 47 | } 48 | 49 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() 50 | { 51 | public WorldMessage createFromParcel(Parcel in) 52 | { 53 | return new WorldMessage(in); 54 | } 55 | 56 | public WorldMessage[] newArray(int size) 57 | { 58 | return new WorldMessage[size]; 59 | } 60 | }; 61 | 62 | @Override 63 | public void writeToParcel(Parcel dest, int flags) 64 | { 65 | dest.writeInt(type); 66 | dest.writeInt(currentStatus); 67 | dest.writeString((String) text); 68 | } 69 | } -------------------------------------------------------------------------------- /MuklukMudClient/src/main/java/com/crap/mukluk/Utility.java: -------------------------------------------------------------------------------- 1 | package com.crap.mukluk; 2 | 3 | import java.nio.charset.Charset; 4 | import java.util.LinkedList; 5 | import java.util.regex.Matcher; 6 | import java.util.regex.Pattern; 7 | 8 | import android.content.Context; 9 | import android.net.ConnectivityManager; 10 | import android.net.NetworkInfo; 11 | 12 | public abstract class Utility 13 | { 14 | private static final Pattern NON_ALPHA_PATTERN = Pattern.compile("[^A-Za-z\\d]"); 15 | private static String[] _supportedCharsetNames = null; 16 | 17 | // Get an array with names of the supported charsets. Cache this so it only 18 | // has to be got once 19 | public static String[] getSupportedCharsetNames() 20 | { 21 | if (_supportedCharsetNames == null) 22 | { 23 | LinkedList availableCharsets = new LinkedList(); 24 | 25 | for (Charset enc : Charset.availableCharsets().values()) 26 | { 27 | availableCharsets.add(enc.name()); 28 | } 29 | 30 | _supportedCharsetNames = new String[availableCharsets.size()]; 31 | 32 | availableCharsets.toArray(_supportedCharsetNames); 33 | } 34 | 35 | return _supportedCharsetNames; 36 | } 37 | 38 | public static boolean isInternetConnectionAvailable(Context context) 39 | { 40 | ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); 41 | NetworkInfo wifi = connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI); 42 | NetworkInfo mobile = connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); 43 | 44 | if (wifi.isAvailable() || mobile.isAvailable()) 45 | return true; 46 | else 47 | return false; 48 | } 49 | 50 | public static String stripNonAlphanumericCharacters(String originalString) 51 | { 52 | Matcher m = NON_ALPHA_PATTERN.matcher(originalString); 53 | 54 | return m.replaceAll(""); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /MuklukMudClient/src/main/res/layout/text_size_preference.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 21 | 28 | 31 | 38 | 46 | 47 | 50 |