diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..7bc01d9
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..64d3c97
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,23 @@
+# Built application files
+*.apk
+*.ap_
+
+# Files for the Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
diff --git a/.project b/.project
new file mode 100644
index 0000000..c13647f
--- /dev/null
+++ b/.project
@@ -0,0 +1,33 @@
+
+
+ PasteeDroid
+
+
+
+
+
+ com.android.ide.eclipse.adt.ResourceManagerBuilder
+
+
+
+
+ com.android.ide.eclipse.adt.PreCompilerBuilder
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ com.android.ide.eclipse.adt.ApkBuilder
+
+
+
+
+
+ com.android.ide.eclipse.adt.AndroidNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..b080d2d
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,4 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
new file mode 100644
index 0000000..d08a04d
--- /dev/null
+++ b/AndroidManifest.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/proguard.cfg b/proguard.cfg
new file mode 100644
index 0000000..b1cdf17
--- /dev/null
+++ b/proguard.cfg
@@ -0,0 +1,40 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+ native ;
+}
+
+-keepclasseswithmembers class * {
+ public (android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+ public (android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * extends android.app.Activity {
+ public void *(android.view.View);
+}
+
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+ public static final android.os.Parcelable$Creator *;
+}
diff --git a/project.properties b/project.properties
new file mode 100644
index 0000000..22d0dca
--- /dev/null
+++ b/project.properties
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-7
diff --git a/res/drawable-hdpi/ic_menu_about.png b/res/drawable-hdpi/ic_menu_about.png
new file mode 100644
index 0000000..21952c0
Binary files /dev/null and b/res/drawable-hdpi/ic_menu_about.png differ
diff --git a/res/drawable-hdpi/ic_menu_more.png b/res/drawable-hdpi/ic_menu_more.png
new file mode 100644
index 0000000..ac725b6
Binary files /dev/null and b/res/drawable-hdpi/ic_menu_more.png differ
diff --git a/res/drawable-hdpi/icon.png b/res/drawable-hdpi/icon.png
new file mode 100644
index 0000000..85105df
Binary files /dev/null and b/res/drawable-hdpi/icon.png differ
diff --git a/res/drawable-ldpi/ic_menu_about.png b/res/drawable-ldpi/ic_menu_about.png
new file mode 100644
index 0000000..725ca5c
Binary files /dev/null and b/res/drawable-ldpi/ic_menu_about.png differ
diff --git a/res/drawable-ldpi/ic_menu_more.png b/res/drawable-ldpi/ic_menu_more.png
new file mode 100644
index 0000000..6a31444
Binary files /dev/null and b/res/drawable-ldpi/ic_menu_more.png differ
diff --git a/res/drawable-ldpi/icon.png b/res/drawable-ldpi/icon.png
new file mode 100644
index 0000000..e851881
Binary files /dev/null and b/res/drawable-ldpi/icon.png differ
diff --git a/res/drawable-mdpi/ic_menu_about.png b/res/drawable-mdpi/ic_menu_about.png
new file mode 100644
index 0000000..52ac241
Binary files /dev/null and b/res/drawable-mdpi/ic_menu_about.png differ
diff --git a/res/drawable-mdpi/ic_menu_more.png b/res/drawable-mdpi/ic_menu_more.png
new file mode 100644
index 0000000..0668c8a
Binary files /dev/null and b/res/drawable-mdpi/ic_menu_more.png differ
diff --git a/res/drawable-mdpi/icon.png b/res/drawable-mdpi/icon.png
new file mode 100644
index 0000000..30cae6e
Binary files /dev/null and b/res/drawable-mdpi/icon.png differ
diff --git a/res/drawable-xhdpi/ic_menu_about.png b/res/drawable-xhdpi/ic_menu_about.png
new file mode 100644
index 0000000..e95d6bf
Binary files /dev/null and b/res/drawable-xhdpi/ic_menu_about.png differ
diff --git a/res/drawable-xhdpi/ic_menu_more.png b/res/drawable-xhdpi/ic_menu_more.png
new file mode 100644
index 0000000..0c46d4e
Binary files /dev/null and b/res/drawable-xhdpi/ic_menu_more.png differ
diff --git a/res/drawable-xhdpi/icon.png b/res/drawable-xhdpi/icon.png
new file mode 100644
index 0000000..2bab452
Binary files /dev/null and b/res/drawable-xhdpi/icon.png differ
diff --git a/res/layout/about.xml b/res/layout/about.xml
new file mode 100644
index 0000000..53da465
--- /dev/null
+++ b/res/layout/about.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/main.xml b/res/layout/main.xml
new file mode 100644
index 0000000..5fe5a2d
--- /dev/null
+++ b/res/layout/main.xml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/pastee.xml b/res/layout/pastee.xml
new file mode 100644
index 0000000..ea91f7c
--- /dev/null
+++ b/res/layout/pastee.xml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/menu/app_menu.xml b/res/menu/app_menu.xml
new file mode 100644
index 0000000..9508b2f
--- /dev/null
+++ b/res/menu/app_menu.xml
@@ -0,0 +1,11 @@
+
+
diff --git a/res/raw/about.txt b/res/raw/about.txt
new file mode 100644
index 0000000..58f42d0
--- /dev/null
+++ b/res/raw/about.txt
@@ -0,0 +1,38 @@
+License Information
+
+Pastee Droid is free software and the source code is released under the GPL3+ licence. The source is available at https://github.com/dillbyrne/PasteeDroid
+
+The Pastee Droid Logo is a modification based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. Original can be found at http://www.android.com/developers/branding.html
+
+The "Pastee" name is copyrighted by Pastee
+
+
+Pastee Droid is an Android client for "the secure pastebin" Pastee!
+
+If you wish to donate you can do so using bitcoin
+1L44pgmZpeMsWsd24WgN6SJjEUARG5eY6G
+
+
+Supports Paste encryption. If encryption is selected pastes are encrypted server side (AES-256) with a password. A SHA-256 hash of the password is stored in the database, not the passphrase itself, which helps ensure that only those who know the password will be able to view the content of your paste. All traffic is sent over SSL
+
+Supports over 100 languages. Languages are listed in order of common (C, Java , Text Only, etc) , other (ActionScript, Debian Source File, etc ) and combo (XML+Ruby , HTML+Django/jinja, etc) .
+
+Supports pastes of up to 200,000 characters
+
+Pastes are not listed. Pastee assures users that it will never list or index your pastes for any reason. Privacy and security are essential to Pastee.
+
+Paste IDs are carefully chosen , this makes them less susceptible to crawling bots. Paste ID's are short and easy to remember if you must.
+
+Pastee Droid supports sharing of pastes via various apps such as twitter , text message , email etc.
+
+
+Pastee Droid also supports URL-shortening . Just paste a URL and it will be shortened .
+
+
+Pastes have reasonable expire times. An hour , a day , a week , a month and a year.
+
+
+For more information on Pastee see https://pastee.org/about
+
+For bug reports see https://github.com/dillbyrne/PasteeDroid/issues
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
new file mode 100644
index 0000000..fd222de
--- /dev/null
+++ b/res/values/strings.xml
@@ -0,0 +1,508 @@
+
+
+
+ Pastee Droid
+ Paste
+ Lexer
+ Time to live :
+ Password
+ Encrypt with Password ?
+ Copy URL
+ Loading
+ Share
+ Return to previous screen
+ About
+ More from Developer
+
+
+
+
+ c
+ C
+
+ csharp
+ C#
+
+ cpp
+ C++
+
+
+ css
+ CSS
+
+
+ diff
+ Diff
+
+
+ html
+ HTML
+
+
+ java
+ Java
+
+
+ js
+ JavaScript
+
+ objective-c
+ Objective-C
+
+ php
+ PHP
+
+ perl
+ Perl
+
+ python
+ Python
+
+ rb
+ Ruby
+
+ sql
+ SQL
+
+ tex
+ TeX
+
+ text
+ Text Only
+
+ xml
+ XML
+
+
+
+
+ as
+ ActionScript
+
+ apacheconf
+ Apache Conf
+
+ bbcode
+ BBCode
+
+ bash
+ Bash
+
+ bat
+ Batchfile
+
+ befunge
+ Befunge
+
+ boo
+ Boo
+
+ brainfuck
+ Brainfuck
+
+ common-lisp
+ Common Lisp
+
+ d
+ D
+
+ dpatch
+ Darcs Patch
+
+ control
+ Debian Control file
+
+
+ sourceslist
+ Debian Sourcelist
+
+ delphi
+ Delphi
+
+
+ django
+ Django/Jinja
+
+ dylan
+ Dylan
+
+ erb
+ ERB
+
+
+ erlang
+ Erlang
+
+ fortran
+ Fortran
+
+ gas
+ GAS
+
+ genshi
+ Genshi
+
+ genshitext
+ Genshi Text
+
+ pot
+ Gettext catalog
+
+ groff
+ Groff
+
+ haskell
+ Haskell
+
+ ini
+ INI
+
+ irc
+ IRC Logs
+
+ io
+ Io
+
+ jsp
+ Java Server Page
+
+ llvm
+ LLVM
+
+ lhs
+ Literate Haskell
+
+ logtalk
+ Logtalk
+
+ lua
+ Lua
+
+ moocode
+ MOOCode
+
+ basemake
+ Makefile
+
+ mako
+ Mako
+
+ matlab
+ Matlab
+
+ matlabsession
+ Matlab Session
+
+ minid
+ MiniD
+
+ trac-wiki
+ MoinMoin/Trac Wiki markup
+
+ mupad
+ MuPAD
+
+ mysql
+ mySQL
+
+ myghty
+ Myghty
+
+ numpy
+ NumPy
+
+ ocaml
+ OCaml
+
+ python3
+ Python 3
+
+ pytb
+ Python Traceback
+
+ pycon
+ Python console session
+
+ rhtml
+ RHTML
+
+ raw
+ Raw token data
+
+ redcode
+ Redcode
+
+ rbcon
+ Ruby irb session
+
+ splus
+ S
+
+
+ scheme
+ Scheme
+
+ smalltalk
+ Smalltalk
+
+ smarty
+ Smarty
+
+ squidconf
+ Squid Conf
+
+ tcl
+ Tcl
+
+ tcsh
+ Tcsh
+
+ vb.net
+ VB.net
+
+ vim
+ VimL
+
+ xslt
+ XSLT
+
+ c-objdump
+ C-Objdump
+
+ cpp-objdump
+ CPP-Objdump
+
+ d-objdump
+ D-Objdump
+
+ objdump
+ Objdump
+
+ rst
+ reStructuredText
+
+
+
+
+ css+django
+ CSS+Django/Jinja
+
+ css+genshitext
+ CSS+Genshi Text
+
+ css+mako
+ CSS+Mako
+
+ css+myghty
+ CSS+Myghty
+
+ css+php
+ CSS+PHP
+
+ css+erb
+ CSS+Ruby
+
+ css+smarty
+ CSS+Smarty
+
+ html+django
+ HTML+Django/Jinja
+
+ html+genshi
+ HTML+Genshi
+
+ html+mako
+ HTML+Mako
+
+ html+myghty
+ HTML+Myghty
+
+ html+php
+ HTML+PHP
+
+ html+smarty
+ HTML+Smarty
+
+ js+django
+ JavaScript+Django/Jinja
+
+ js+genshitext
+ JavaScript+Genshi Text
+
+ js+mako
+ JavaScript+Mako
+
+ js+myghty
+ JavaScript+Myghty
+
+ js+php
+ JavaScript+PHP
+
+ js+erb
+ JavaScript+Ruby
+
+ js+smarty
+ JavaScript+Smarty
+
+ xml+django
+ XML+Django/Jinja
+
+ xml+mako
+ XML+Mako
+
+ xml+myghty
+ XML+Myghty
+
+ xml+php
+ XML+PHP
+
+ xml+erb
+ XML+Ruby
+
+ xml+smarty
+ XML+Smarty
+
+
+
+
+ an hour
+ a day
+ a week
+ a month
+ a year
+
+
+
+
+
+
+
+ - @string/C
+ - @string/Csharp
+ - @string/Cplusplus
+ - @string/CSS
+ - @string/Diff
+ - @string/HTML
+ - @string/Java
+ - @string/JavaScript
+ - @string/ObjectiveC
+ - @string/PHP
+ - @string/Perl
+ - @string/Python
+ - @string/Ruby
+ - @string/SQL
+ - @string/TeX
+ - @string/TextOnly
+ - @string/XML
+
+
+
+ - @string/ActionScript
+ - @string/ApacheConf
+ - @string/BBCode
+ - @string/Bash
+ - @string/Batchfile
+ - @string/Befunge
+ - @string/Boo
+ - @string/Brainfuck
+ - @string/Common_Lisp
+ - @string/D
+ - @string/Darcs_Patch
+ - @string/Debian_Control_file
+ - @string/Debian_Sourcelist
+ - @string/Delphi
+ - @string/Django_Jinja
+ - @string/Dylan
+ - @string/ERB
+ - @string/Erlang
+ - @string/Fortran
+ - @string/GAS
+ - @string/Genshi
+ - @string/Genshi_Text
+ - @string/Gettext_Catalog
+ - @string/Groff
+ - @string/Haskell
+ - @string/INI
+ - @string/IRC_logs
+ - Io
+ - @string/Java_Server_Page
+ - @string/LLVM
+ - @string/Literate_Haskell
+ - @string/Logtalk
+ - @string/Lua
+ - @string/MOOCode
+ - @string/Makefile
+ - @string/Mako
+ - @string/Matlab
+ - @string/Matlab_Session
+ - @string/MiniD
+ - @string/MoinMoin_Trac_Wiki_markup
+ - @string/MuPAD
+ - @string/mySQL
+ - @string/Myghty
+ - @string/NumPy
+ - @string/OCaml
+ - @string/Python_3
+ - @string/Python_Traceback
+ - @string/Python_console_session
+ - @string/RHTML
+ - @string/Raw_token_data
+ - @string/Redcode
+ - @string/Ruby_irb_session
+ - @string/S
+ - @string/Scheme
+ - @string/Smalltalk
+ - @string/Smarty
+ - @string/SquidConf
+ - @string/Tcl
+ - @string/Tcsh
+ - @string/VB.net
+ - @string/VimL
+ - @string/XSLT
+ - @string/c_objdump
+ - @string/cpp_objdump
+ - @string/d_objdump
+ - @string/objdump
+ - reStructuredText
+
+
+
+ - @string/CSS_Django_Jinja
+ - @string/CSS_Genshi_Text
+ - @string/CSS_Mako
+ - @string/CSS_Myghty
+ - @string/CSS_PHP
+ - @string/CSS_Ruby
+ - @string/CSS_Smarty
+ - @string/HTML_Django_Jinja
+ - @string/HTML_Genshi
+ - @string/HTML_Mako
+ - @string/HTML_Myghty
+ - @string/HTML_PHP
+ - @string/HTML_Smarty
+ - @string/JavaScript_Django_Jinja
+ - @string/JavaScript_Genshi_Text
+ - @string/JavaScript_Mako
+ - @string/JavaScript_Myghty
+ - @string/JavaScript_PHP
+ - @string/JavaScript_Ruby
+ - @string/JavaScript_Smarty
+ - @string/XML_Django_Jinja
+ - @string/XML_Mako
+ - @string/XML_Myghty
+ - @string/XML_PHP
+ - @string/XML_Ruby
+ - @string/XML_Smarty
+
+
+
+
+ - @string/hour
+ - @string/day
+ - @string/week
+ - @string/month
+ - @string/year
+
+
+
+
diff --git a/src/byrne/utilities/pasteedroid/About.java b/src/byrne/utilities/pasteedroid/About.java
new file mode 100644
index 0000000..17b4889
--- /dev/null
+++ b/src/byrne/utilities/pasteedroid/About.java
@@ -0,0 +1,47 @@
+package byrne.utilities.pasteedroid;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.util.Log;
+import android.widget.TextView;
+
+
+public class About extends Activity {
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.about);
+
+
+
+ //read in the help text file
+ InputStream iFile = getResources().openRawResource(R.raw.about);
+ try {
+ TextView helpText = (TextView) findViewById(R.id.abouttext);
+ String strFile = inputStreamToString(iFile);
+ helpText.setText(strFile);
+ } catch (Exception e) {
+ Log.e("FILE_IO", "InputStreamToString failure", e);
+ }
+ }
+
+ //converts an input stream to a string
+
+ public String inputStreamToString(InputStream is) throws IOException {
+ StringBuffer sBuffer = new StringBuffer();
+ DataInputStream dis = new DataInputStream(is);
+ String strLine = null;
+ while ((strLine = dis.readLine()) != null) {
+ sBuffer.append(strLine + "\n");
+ }
+ dis.close();
+ is.close();
+ return sBuffer.toString();
+ }
+}
+
diff --git a/src/byrne/utilities/pasteedroid/Pastee.java b/src/byrne/utilities/pasteedroid/Pastee.java
new file mode 100644
index 0000000..5a56633
--- /dev/null
+++ b/src/byrne/utilities/pasteedroid/Pastee.java
@@ -0,0 +1,286 @@
+package byrne.utilities.pasteedroid;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.protocol.HTTP;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.text.ClipboardManager;
+import android.text.util.Linkify;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+
+public class Pastee extends Activity implements OnClickListener{
+
+
+
+ private String content;
+ private String encrypt;
+ private String lexer;
+ private String ttl;
+ private String key;
+ private TextView result;
+ private Button copy;
+ private Button share;
+ private Button quit;
+ private String URL = "pastee.org/";
+ private LinearLayout linProgressBar;
+
+
+
+ /** Called when the activity is first created. */
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.pastee);
+
+ //get UI component references
+ result = (TextView)findViewById(R.id.result);
+ copy = (Button)findViewById(R.id.copy);
+ share = (Button)findViewById(R.id.share);
+ quit = (Button)findViewById(R.id.quit);
+
+ linProgressBar = (LinearLayout) findViewById(R.id.lin_progress_bar);
+
+ //add listeners to buttons
+ copy.setOnClickListener(this);
+ share.setOnClickListener(this);
+ quit.setOnClickListener(this);
+
+ //access the strings that were passed to this activity
+ Bundle b = getIntent().getExtras();
+ key = b.getString("key");
+ encrypt = b.getString("encrypt");
+ ttl = b.getString("ttl");
+ content = b.getString("content");
+ lexer = b.getString("lexer");
+
+ //create post paste instance and execute it
+ postPaste post_paste = new postPaste();
+ post_paste.execute();
+
+ }
+
+
+
+ @Override
+ public void onClick(View v) {
+
+ //copy to clipboard
+ if(v == copy){
+
+ ClipboardManager clipboard =
+ (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
+ clipboard.setText("https://" + result.getText().toString());
+ Toast.makeText(this, "Paste URL copied to clipboard", Toast.LENGTH_SHORT).show();
+ }
+
+ //share via various installed applications
+ if(v == share){
+
+ Intent send = new Intent(Intent.ACTION_SEND);
+ send.setType("text/plain");
+ send.putExtra(Intent.EXTRA_TEXT, "https://" + result.getText().toString());
+ startActivity(Intent.createChooser(send, "Share Paste"));
+ }
+
+ //if an error is shown and the user selects quit to return to previous screen
+ if(v == quit){
+
+ this.finish();
+ }
+
+ }
+
+ /***
+ * postPaste is an asynchronous task that posts a paste
+ * in the background and updates the result (the paste url or a network failure)
+ */
+ private class postPaste extends AsyncTask {
+
+
+
+ //perform the connection and sending in a separate thread
+ protected String doInBackground(Context... params) {
+
+ String result = null;
+
+
+ try {
+ HttpClient client = new DefaultHttpClient();
+ String postURL = "https://pastee.org:443/submit";
+ HttpPost post = new HttpPost(postURL);
+
+ //Add parameters to post
+
+ List paramaters = new ArrayList();
+ paramaters.add(new BasicNameValuePair("content", content));
+ paramaters.add(new BasicNameValuePair("lexer", lexer));
+ paramaters.add(new BasicNameValuePair("ttl", ttl));
+
+ //add encryption only if it was selected in the previous screen
+ if(encrypt.compareTo("on") == 0)
+ paramaters.add(new BasicNameValuePair("encrypt",encrypt));
+
+ paramaters.add(new BasicNameValuePair("key", key));
+
+
+ //encode the parameters
+ UrlEncodedFormEntity ent = new UrlEncodedFormEntity(paramaters,HTTP.UTF_8);
+ post.setEntity(ent);
+ //send post and get result
+ HttpResponse responsePOST = client.execute(post);
+ HttpEntity resEntity = responsePOST.getEntity();
+
+ if (resEntity != null) {
+ //get the response and put it into an input stream
+ InputStream is = resEntity.getContent();
+ //get the line containing the paste code
+ result = getKeywordLineFromStream(is , "");
+ result = getTextBetweenTags(result, "code");
+
+ return result;
+ }
+
+
+
+ } catch (UnsupportedEncodingException uee){
+ //Log.e("UEE","Exception caught " + uee.toString());
+ //return "UEE";
+
+
+ } catch (ClientProtocolException cpe){
+ //Log.e("CPE","Exception caught " + cpe.toString());
+ //return "CPE";
+
+
+ } catch (IOException ioe){
+ //Log.e("IOE","Exception caught " + ioe.toString());
+ //return "IOE";
+
+ }
+
+ //return null if no string is returned
+ return result;
+
+ }
+
+ //Display the results from the connection thread
+ protected void onPostExecute( String response ) {
+
+ //set progress bar to hidden
+ linProgressBar.setVisibility(View.GONE);
+
+ //set text view to visible
+ result.setVisibility(View.VISIBLE);
+
+
+ //if there was a connection drop in the activity
+ if(response == null){
+
+ quit.setVisibility(View.VISIBLE);
+
+ result.setText("There was a network error\nPlease ensure the network is connected and try again");
+ }else{
+
+ //set buttons to visible
+ copy.setVisibility(View.VISIBLE);
+ share.setVisibility(View.VISIBLE);
+
+ //add paste code to pastee url
+ URL = URL + response;
+ //Display the resulting text
+ result.setText(URL);
+
+ //pattern we want to match and turn into a clickable link
+ Pattern pattern = Pattern.compile(URL);
+
+ //prefix pattern with https
+ Linkify.addLinks(result,pattern, "https://");
+ }
+
+ }
+
+ /**
+ * Get a line from an input stream which contains a specific keyword
+ * @param InputStream inputStream : the input stream
+ * @param String keyword : the keyword that the line must contain
+ * @return String line or null if no match is found
+ *
+ * */
+ private String getKeywordLineFromStream(InputStream inputStream, String keyword){
+
+ BufferedReader r = new BufferedReader(new InputStreamReader(inputStream));
+ String line;
+ try {
+ while ((line = r.readLine()) != null) {
+ //get line with the keyword in it
+ if (line.contains(keyword)== true){
+ //close streams
+ inputStream.close();
+ r.close();
+
+ return line;
+ }
+ }
+ } catch (IOException e) {
+
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ /**
+ * Get the text between two in a line
+ * @param String text : the line or text to parse
+ * @param String tag : the tag which will surround the text that is returned
+ * @param string parsedText : the text extracted from the tags
+ */
+
+ private String getTextBetweenTags(String text, String tag){
+
+
+ final Pattern pattern = Pattern.compile("<"+tag+">(.+?)"+tag+">");
+ final Matcher matcher = pattern.matcher(text);
+ matcher.find();
+
+ return matcher.group(1);
+
+
+ }//close gtbt
+
+
+ }//close postpaste class
+
+}
+
+
+
+
+
+
diff --git a/src/byrne/utilities/pasteedroid/PasteeDroidActivity.java b/src/byrne/utilities/pasteedroid/PasteeDroidActivity.java
new file mode 100644
index 0000000..e3d3c6d
--- /dev/null
+++ b/src/byrne/utilities/pasteedroid/PasteeDroidActivity.java
@@ -0,0 +1,805 @@
+package byrne.utilities.pasteedroid;
+
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+import android.net.Uri;
+import android.os.Bundle;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemSelectedListener;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.EditText;
+import android.widget.Spinner;
+import android.widget.Toast;
+
+
+public class PasteeDroidActivity extends Activity implements OnClickListener , OnItemSelectedListener{
+
+ //Create Ui Components
+
+ private EditText content;
+ private EditText password;
+ private Spinner lexer;
+ private Spinner ttl;
+ private CheckBox encrypt;
+ private Button paste;
+ private String time; // selected time to live
+ private String lex; // selected lexer
+ private String the_paste ; //the paste entered
+
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+
+ //get references to ui components
+
+ content = (EditText) findViewById(R.id.content);
+ password = (EditText) findViewById(R.id.password);
+ lexer = (Spinner) findViewById(R.id.lexer);
+ ttl = (Spinner) findViewById(R.id.ttl);
+ encrypt = (CheckBox) findViewById(R.id.encrypt);
+ paste = (Button) findViewById(R.id.submit);
+
+
+ //add listeners
+ paste.setOnClickListener(this);
+ lexer.setOnItemSelectedListener(this);
+
+ //set Text only as the default lexer
+ lexer.setSelection(15, true);
+
+
+
+ //handle share intent to allow users to send
+ //text via this application
+ Intent intent = getIntent();
+
+ if (savedInstanceState == null && intent != null) {
+
+ if (intent.getAction().equals(Intent.ACTION_SEND)) {
+ the_paste = intent.getStringExtra(Intent.EXTRA_TEXT);
+ content.setText(the_paste);
+ }
+ }
+
+
+ }//end onCreate
+
+
+ @Override
+ public void onClick(View v) {
+
+ //if a paste has been entered
+ if(v == paste && content.getText().toString().length() != 0){
+
+ if (isOnline() == true){
+
+ //get ttl and the paste
+ time = "" + getTimeToLive(ttl.getSelectedItem().toString());
+ the_paste = content.getText().toString();
+
+
+ //if a password has been specified and encrypt is selected
+ if(encrypt.isChecked() == true && password.getText().toString().length() != 0){
+
+
+ //pass parameter to sending activity and call it
+ //bundle post parameters and add them to the child activity
+ Bundle b=new Bundle();
+ b.putString("content", the_paste);
+ b.putString("lexer", lex);
+ b.putString("ttl", time);
+ b.putString("encrypt", "on");
+ b.putString("key", password.getText().toString());
+
+ Intent intent = new Intent(PasteeDroidActivity.this, Pastee.class);
+ intent.putExtras(b);
+ startActivity(intent);
+
+ }
+ //no password has been entered but encrypt is checked
+ else if(encrypt.isChecked() == true && password.getText().toString().length() == 0){
+ Toast.makeText(this, "please enter a password or unselect encrypt", Toast.LENGTH_SHORT).show();
+
+ }
+ //a password has been entered but encrypt is not checked
+ else if(encrypt.isChecked() == false && password.getText().toString().length() != 0){
+ Toast.makeText(this, "please select encrypt or remove password ", Toast.LENGTH_SHORT).show();
+
+ }
+ else{ // no password and encrypt is not checked
+
+ //pass parameter to sending activity and call it
+ //bundle post parameters and add them to the child activity
+ Bundle b=new Bundle();
+ b.putString("content", the_paste);
+ b.putString("lexer", lex);
+ b.putString("ttl", time);
+ b.putString("encrypt", "off");
+ b.putString("key", "");
+
+ Intent intent = new Intent(PasteeDroidActivity.this, Pastee.class);
+ intent.putExtras(b);
+ startActivity(intent);
+
+ }
+ }
+ else{
+ //Turn on networking message
+ Toast.makeText(this, "Please enable the mobile network or wifi", Toast.LENGTH_SHORT).show();
+ }
+ }
+ else{
+ //if paste is empty show message
+ Toast.makeText(this, "Paste must not be empty", Toast.LENGTH_SHORT).show();
+ }
+
+
+
+ }
+
+ /**
+ * Calculates the time to live based on the input
+ * @param String ttl : Time to live (an hour , a day , a week , a month or a year )
+ * @return int Seconds : The number of seconds
+ *
+ * */
+ private int getTimeToLive(String ttl){
+
+ // A Year
+ if(ttl.equals(getResources().getString(R.string.year)) == true){
+ return 60 * 60 * 24 * 365 ;
+ }
+ // A Day
+ if(ttl.equals(getResources().getString(R.string.day)) == true){
+ return 60 * 60 * 24 ;
+ }
+ // A month
+ if(ttl.equals(getResources().getString(R.string.month)) == true){
+ return 60 * 60 * 24 * 30 ;
+ }
+ // A week
+ if(ttl.equals(getResources().getString(R.string.week)) == true){
+ return 60 * 60 * 24 * 7 ;
+ }
+ // An Hour
+ else{
+ return 60 * 60;
+ }
+
+ }
+
+
+ @Override
+ public void onItemSelected(AdapterView> arg0, View v, int pos,
+ long id) {
+
+ //Get the correct Lexer codes based on the selected item
+
+
+ //common lexers
+
+ //C
+ if(pos == 0){
+ lex = getResources().getString(R.string.C1);
+ }
+
+ //C#
+ if(pos == 1){
+ lex = getResources().getString(R.string.Csharp1);
+ }
+
+ //C++
+ if(pos == 2){
+ lex = getResources().getString(R.string.Cplusplus1);
+ }
+
+ //CSS
+ if(pos == 3){
+ lex = getResources().getString(R.string.CSS1);
+ }
+
+ //Diff
+ if(pos == 4){
+ lex = getResources().getString(R.string.Diff1);
+ }
+
+ //HTML
+ if(pos == 5){
+ lex = getResources().getString(R.string.HTML1);
+ }
+
+ //Java
+ if(pos == 6){
+ lex = getResources().getString(R.string.Java1);
+ }
+
+ //JavaScript
+ if(pos == 7){
+ lex = getResources().getString(R.string.JavaScript1);
+ }
+
+ //ObjectiveC
+ if(pos == 8){
+ lex = getResources().getString(R.string.ObjectiveC1);
+ }
+
+ //PHP
+ if(pos == 9){
+ lex = getResources().getString(R.string.PHP1);
+ }
+
+ //Perl
+ if(pos == 10){
+ lex = getResources().getString(R.string.Perl1);
+ }
+
+ //Python
+ if(pos == 11){
+ lex = getResources().getString(R.string.Python1);
+ }
+
+ //Ruby
+ if(pos == 12){
+ lex = getResources().getString(R.string.Ruby1);
+ }
+
+ //SQL
+ if(pos == 13){
+ lex = getResources().getString(R.string.SQL1);
+ }
+
+ //TeX
+ if(pos == 14){
+ lex = getResources().getString(R.string.TeX1);
+ }
+
+ //Text Only
+ if(pos == 15){
+ lex = getResources().getString(R.string.TextOnly1);
+ }
+
+ //XML
+ if(pos == 16){
+ lex = getResources().getString(R.string.XML1);
+ }
+
+
+ // Other Lexer Codes
+
+ //ActionScript
+ if(pos == 17){
+ lex = getResources().getString(R.string.ActionScript1);
+ }
+
+ //Apache Conf
+ if(pos == 18){
+ lex = getResources().getString(R.string.ApacheConf1);
+ }
+
+ //BBCode
+ if(pos == 19){
+ lex = getResources().getString(R.string.BBCode1);
+ }
+ //Bash
+ if(pos == 20){
+ lex = getResources().getString(R.string.Bash1);
+ }
+ //Batchfile
+ if(pos == 21){
+ lex = getResources().getString(R.string.Batchfile1);
+ }
+
+ //Befunge
+ if(pos == 22){
+ lex = getResources().getString(R.string.Befunge1);
+ }
+
+ //Boo
+ if(pos == 23){
+ lex = getResources().getString(R.string.Boo1);
+ }
+
+ //Brainfuck
+ if(pos == 24){
+ lex = getResources().getString(R.string.Brainfuck1);
+ }
+
+ //Common Lisp
+ if(pos == 25){
+ lex = getResources().getString(R.string.Common_Lisp1);
+ }
+
+ //D
+ if(pos == 26){
+ lex = getResources().getString(R.string.D1);
+ }
+
+ //Darcs Patch
+ if(pos == 27){
+ lex = getResources().getString(R.string.Darcs_Patch1);
+ }
+
+ //Debian Control file
+ if(pos == 28){
+ lex = getResources().getString(R.string.Debian_Control_file1);
+ }
+
+ //Debian Sourcelist
+ if(pos == 29){
+ lex = getResources().getString(R.string.Debian_Sourcelist1);
+ }
+
+ //Delphi
+ if(pos == 30){
+ lex = getResources().getString(R.string.Delphi1);
+ }
+
+ //Django/Jinja
+ if(pos == 31){
+ lex = getResources().getString(R.string.Django_Jinja1);
+ }
+
+ //Dylan
+ if(pos == 32){
+ lex = getResources().getString(R.string.Dylan1);
+ }
+
+ //ERB
+ if(pos == 33){
+ lex = getResources().getString(R.string.ERB1);
+ }
+
+ //Erlang
+ if(pos == 34){
+ lex = getResources().getString(R.string.Erlang1);
+ }
+
+ //Fortran
+ if(pos == 35){
+ lex = getResources().getString(R.string.Fortran1);
+ }
+
+ //Gas
+ if(pos == 36){
+ lex = getResources().getString(R.string.GAS1);
+ }
+
+ //Genshi
+ if(pos == 37){
+ lex = getResources().getString(R.string.Genshi1);
+ }
+
+ //Genshi Text
+ if(pos == 38){
+ lex = getResources().getString(R.string.Genshi_Text1);
+ }
+
+ //Gettext Catalog
+ if(pos == 39){
+ lex = getResources().getString(R.string.Gettext_Catalog1);
+ }
+
+ //Groff
+ if(pos == 40){
+ lex = getResources().getString(R.string.Groff1);
+ }
+
+ //Haskell
+ if(pos == 41){
+ lex = getResources().getString(R.string.Haskell1);
+ }
+
+ //INI
+ if(pos == 42){
+ lex = getResources().getString(R.string.INI1);
+ }
+
+ //IRC logs
+ if(pos == 43){
+ lex = getResources().getString(R.string.IRC_logs1);
+ }
+
+ //Io
+ if(pos == 44){
+ lex = getResources().getString(R.string.Io1);
+ }
+
+ //Java Server Page
+ if(pos == 45){
+ lex = getResources().getString(R.string.Java_Server_Page1);
+ }
+
+ //LLVM
+ if(pos == 46){
+ lex = getResources().getString(R.string.LLVM1);
+ }
+
+ //Literate Haskell
+ if(pos == 47){
+ lex = getResources().getString(R.string.Literate_Haskell1);
+ }
+
+ //Logtalk
+ if(pos == 48){
+ lex = getResources().getString(R.string.Logtalk1);
+ }
+
+ //Lua
+ if(pos ==49){
+ lex = getResources().getString(R.string.Lua1);
+ }
+
+ //MOOCode
+ if(pos == 50){
+ lex = getResources().getString(R.string.MOOCode1);
+ }
+
+ //Makefile
+ if(pos == 51){
+ lex = getResources().getString(R.string.Makefile1);
+ }
+
+ //Mako
+ if(pos == 52){
+ lex = getResources().getString(R.string.Mako1);
+ }
+
+ //Matlab
+ if(pos == 53){
+ lex = getResources().getString(R.string.Matlab1);
+ }
+
+ //Matlab Session
+ if(pos == 54){
+ lex = getResources().getString(R.string.Matlab_Session1);
+ }
+
+ //MiniD
+ if(pos == 55){
+ lex = getResources().getString(R.string.MiniD1);
+ }
+
+ //MoinMoin / Trac Wiki
+ if(pos == 56){
+ lex = getResources().getString(R.string.MoinMoin_Trac_Wiki_markup1);
+ }
+
+ //MuPAD
+ if(pos == 57){
+ lex = getResources().getString(R.string.MuPAD1);
+ }
+
+ //mySQL
+ if(pos == 58){
+ lex = getResources().getString(R.string.mySQL1);
+ }
+
+ //Myghty
+ if(pos == 59){
+ lex = getResources().getString(R.string.Myghty1);
+ }
+
+ //NumPy
+ if(pos == 60){
+ lex = getResources().getString(R.string.NumPy1);
+ }
+
+ //OCaml
+ if(pos == 61){
+ lex = getResources().getString(R.string.OCaml1);
+ }
+
+ //Python 3
+ if(pos == 62){
+ lex = getResources().getString(R.string.Python_31);
+ }
+
+ //Python Traceback
+ if(pos == 63){
+ lex = getResources().getString(R.string.Python_Traceback1);
+ }
+
+ //Python console session
+ if(pos == 64){
+ lex = getResources().getString(R.string.Python_console_session1);
+ }
+
+ //RHTML
+ if(pos == 65){
+ lex = getResources().getString(R.string.RHTML1);
+ }
+
+ //Raw token data
+ if(pos == 66){
+ lex = getResources().getString(R.string.Raw_token_data1);
+ }
+
+ //Redcode
+ if(pos == 67){
+ lex = getResources().getString(R.string.Redcode1);
+ }
+
+ //Ruby irb session
+ if(pos == 68){
+ lex = getResources().getString(R.string.Ruby_irb_session1);
+ }
+
+ //S
+ if(pos == 69){
+ lex = getResources().getString(R.string.S1);
+ }
+
+ //Scheme
+ if(pos == 70){
+ lex = getResources().getString(R.string.Scheme1);
+ }
+
+ //Smalltalk
+ if(pos == 71){
+ lex = getResources().getString(R.string.Smalltalk1);
+ }
+
+ //Smarty
+ if(pos == 72){
+ lex = getResources().getString(R.string.Smarty1);
+ }
+
+ //Squid Conf
+ if(pos == 73){
+ lex = getResources().getString(R.string.SquidConf1);
+ }
+
+ //Tcl1
+ if(pos == 74){
+ lex = getResources().getString(R.string.Tcl1);
+ }
+
+ //Tcsh
+ if(pos == 75){
+ lex = getResources().getString(R.string.Tcsh1);
+ }
+
+ //VB.net
+ if(pos == 76){
+ lex = getResources().getString(R.string.VB_net1);
+ }
+
+ //VimL
+ if(pos == 77){
+ lex = getResources().getString(R.string.VimL1);
+ }
+
+ //XSLT
+ if(pos == 78){
+ lex = getResources().getString(R.string.XSLT1);
+ }
+
+ //C Objdump
+ if(pos == 79){
+ lex = getResources().getString(R.string.c_objdump1);
+ }
+
+ //CPP Objdump
+ if(pos == 80){
+ lex = getResources().getString(R.string.cpp_objdump1);
+ }
+
+ //D Objdump
+ if(pos == 81){
+ lex = getResources().getString(R.string.d_objdump1);
+ }
+
+ //objdump
+ if(pos == 82){
+ lex = getResources().getString(R.string.objdump1);
+ }
+
+ //reStructuredText
+ if(pos == 83){
+ lex = getResources().getString(R.string.reStructuredText1);
+ }
+
+
+ //Combo Lexers
+
+ //CSS+Django/Jinja
+ if(pos == 84){
+ lex = getResources().getString(R.string.CSS_Django_Jinja1);
+ }
+
+ //CSS+Genshi Text
+ if(pos == 85){
+ lex = getResources().getString(R.string.CSS_Genshi_Text1);
+ }
+
+ //CSS+Mako
+ if(pos == 86){
+ lex = getResources().getString(R.string.CSS_Mako1);
+ }
+
+ //CSS+Myghty
+ if(pos == 87){
+ lex = getResources().getString(R.string.CSS_Myghty1);
+ }
+
+ //CSS+PHP
+ if(pos == 88){
+ lex = getResources().getString(R.string.CSS_PHP1);
+ }
+
+ //CSS+Ruby
+ if(pos == 89){
+ lex = getResources().getString(R.string.CSS_Ruby1);
+ }
+
+ //CSS+Smarty
+ if(pos == 90){
+ lex = getResources().getString(R.string.CSS_Smarty1);
+ }
+
+ //HTML+Django/Jinja
+ if(pos == 91){
+ lex = getResources().getString(R.string.HTML_Django_Jinja1);
+ }
+
+ //HTML+Genshi
+ if(pos == 92){
+ lex = getResources().getString(R.string.HTML_Genshi1);
+ }
+
+ //HTML+Mako
+ if(pos == 93){
+ lex = getResources().getString(R.string.HTML_Mako1);
+ }
+
+ //HTML+Myghty
+ if(pos == 94){
+ lex = getResources().getString(R.string.HTML_Myghty1);
+ }
+
+
+ //HTML+PHP
+ if(pos == 95){
+ lex = getResources().getString(R.string.HTML_PHP1);
+ }
+
+ //HTML+Smarty
+ if(pos == 96){
+ lex = getResources().getString(R.string.HTML_Smarty1);
+ }
+
+ //JavaScript+Django/Jinja
+ if(pos == 97){
+ lex = getResources().getString(R.string.JavaScript_Django_Jinja1);
+ }
+
+ //JavaScript+Genshi Text
+ if(pos == 98){
+ lex = getResources().getString(R.string.JavaScript_Genshi_Text1);
+ }
+
+ //JavaScript+Mako
+ if(pos == 99){
+ lex = getResources().getString(R.string.JavaScript_Mako1);
+ }
+
+ //JavaScript+Myghty
+ if(pos == 100){
+ lex = getResources().getString(R.string.JavaScript_Myghty1);
+ }
+
+ //JavaScript+PHP
+ if(pos == 101){
+ lex = getResources().getString(R.string.JavaScript_PHP1);
+ }
+
+ //JavaScript+Ruby
+ if(pos == 102){
+ lex = getResources().getString(R.string.JavaScript_Ruby1);
+ }
+
+ //JavaScript+Smarty
+ if(pos == 103){
+ lex = getResources().getString(R.string.JavaScript_Smarty1);
+ }
+
+ //XML+Django/Jinja
+ if(pos == 104){
+ lex = getResources().getString(R.string.XML_Django_Jinja1);
+ }
+
+ //XML+Mako
+ if(pos == 105){
+ lex = getResources().getString(R.string.XML_Mako1);
+ }
+
+ //XML+Myghty
+ if(pos == 106){
+ lex = getResources().getString(R.string.XML_Myghty1);
+ }
+
+ //XML+PHP
+ if(pos == 107){
+ lex = getResources().getString(R.string.XML_PHP1);
+ }
+
+ //XML+Ruby
+ if(pos == 108){
+ lex = getResources().getString(R.string.XML_Ruby1);
+ }
+
+ //XML+Smarty
+ if(pos == 109){
+ lex = getResources().getString(R.string.XML_Smarty1);
+ }
+
+ }
+
+
+ @Override
+ public void onNothingSelected(AdapterView> arg0) {
+ // Does not apply
+
+ }
+
+ /**
+ * Checks for 3G or WiFi connectivity
+ * @return boolean : true or false
+ * */
+ public boolean isOnline() {
+ ConnectivityManager cm =
+ (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo netInfo = cm.getActiveNetworkInfo();
+ if (netInfo != null && netInfo.isConnectedOrConnecting()) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.app_menu, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle item selection
+ switch (item.getItemId()) {
+ case R.id.about:
+
+ //Start the about activity
+ Intent intent = new Intent(PasteeDroidActivity.this, About.class);
+ startActivity(intent);
+
+ return true;
+
+ case R.id.more:
+
+ String url = "https://play.google.com/store/apps/developer?id=dillbyrne";
+ Intent i = new Intent(Intent.ACTION_VIEW);
+ i.setData(Uri.parse(url));
+ startActivity(i);
+
+ return true;
+
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }
+
+}