First real commit
authorPetru Trimbitas <l3asketballplayer@yahoo.com>
Thu, 23 May 2013 08:43:31 +0000 (11:43 +0300)
committerPetru Trimbitas <l3asketballplayer@yahoo.com>
Thu, 23 May 2013 08:43:31 +0000 (11:43 +0300)
26 files changed:
.classpath [new file with mode: 0644]
.gitignore [new file with mode: 0644]
.project [new file with mode: 0644]
.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
AndroidManifest.xml [new file with mode: 0644]
ic_launcher-web.png [new file with mode: 0644]
libs/android-support-v4.jar [new file with mode: 0644]
libs/gson-2.2.4-javadoc.jar [new file with mode: 0644]
libs/gson-2.2.4-sources.jar [new file with mode: 0644]
libs/gson-2.2.4.jar [new file with mode: 0644]
proguard-project.txt [new file with mode: 0644]
project.properties [new file with mode: 0644]
res/drawable-hdpi/ic_launcher.png [new file with mode: 0644]
res/drawable-mdpi/ic_launcher.png [new file with mode: 0644]
res/drawable-xhdpi/ic_launcher.png [new file with mode: 0644]
res/drawable-xxhdpi/ic_launcher.png [new file with mode: 0644]
res/layout/eventview.xml [new file with mode: 0644]
res/values-v11/styles.xml [new file with mode: 0644]
res/values-v14/styles.xml [new file with mode: 0644]
res/values/strings.xml [new file with mode: 0644]
res/values/styles.xml [new file with mode: 0644]
src/ro/ieval/unical/Constants.java [new file with mode: 0644]
src/ro/ieval/unical/DatabaseInteract.java [new file with mode: 0644]
src/ro/ieval/unical/Event.java [new file with mode: 0644]
src/ro/ieval/unical/MySQLiteHelper.java [new file with mode: 0644]
src/ro/ieval/unical/mainActivity.java [new file with mode: 0644]

diff --git a/.classpath b/.classpath
new file mode 100644 (file)
index 0000000..a4763d1
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="src" path="gen"/>
+       <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+       <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+       <classpathentry kind="output" path="bin/classes"/>
+</classpath>
diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..1ec69fa
--- /dev/null
@@ -0,0 +1,2 @@
+bin/
+gen/
\ No newline at end of file
diff --git a/.project b/.project
new file mode 100644 (file)
index 0000000..6760bcd
--- /dev/null
+++ b/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>Unical</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..b080d2d
--- /dev/null
@@ -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 (file)
index 0000000..621590d
--- /dev/null
@@ -0,0 +1,24 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="ro.ieval.unical"
+    android:versionCode="1"
+    android:versionName="1.0" >
+
+    <uses-sdk
+        android:minSdkVersion="8"
+        android:targetSdkVersion="17" />
+    <uses-permission android:name="android.permission.INTERNET"/>
+
+    <application
+        android:allowBackup="true"
+        android:icon="@drawable/ic_launcher"
+        android:label="@string/app_name"
+        android:theme="@style/AppTheme" >
+        <activity android:name=".mainActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.LAUNCHER"/>
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>
\ No newline at end of file
diff --git a/ic_launcher-web.png b/ic_launcher-web.png
new file mode 100644 (file)
index 0000000..a256e1c
Binary files /dev/null and b/ic_launcher-web.png differ
diff --git a/libs/android-support-v4.jar b/libs/android-support-v4.jar
new file mode 100644 (file)
index 0000000..65ebaf8
Binary files /dev/null and b/libs/android-support-v4.jar differ
diff --git a/libs/gson-2.2.4-javadoc.jar b/libs/gson-2.2.4-javadoc.jar
new file mode 100644 (file)
index 0000000..ce8fa7d
Binary files /dev/null and b/libs/gson-2.2.4-javadoc.jar differ
diff --git a/libs/gson-2.2.4-sources.jar b/libs/gson-2.2.4-sources.jar
new file mode 100644 (file)
index 0000000..30b13f6
Binary files /dev/null and b/libs/gson-2.2.4-sources.jar differ
diff --git a/libs/gson-2.2.4.jar b/libs/gson-2.2.4.jar
new file mode 100644 (file)
index 0000000..9478253
Binary files /dev/null and b/libs/gson-2.2.4.jar differ
diff --git a/proguard-project.txt b/proguard-project.txt
new file mode 100644 (file)
index 0000000..f2fe155
--- /dev/null
@@ -0,0 +1,20 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
diff --git a/project.properties b/project.properties
new file mode 100644 (file)
index 0000000..21e5f60
--- /dev/null
@@ -0,0 +1,15 @@
+# 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-17
+android.library.reference.1=../gridlayout_v7
diff --git a/res/drawable-hdpi/ic_launcher.png b/res/drawable-hdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..f48ba3e
Binary files /dev/null and b/res/drawable-hdpi/ic_launcher.png differ
diff --git a/res/drawable-mdpi/ic_launcher.png b/res/drawable-mdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..3ff2b76
Binary files /dev/null and b/res/drawable-mdpi/ic_launcher.png differ
diff --git a/res/drawable-xhdpi/ic_launcher.png b/res/drawable-xhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..774763e
Binary files /dev/null and b/res/drawable-xhdpi/ic_launcher.png differ
diff --git a/res/drawable-xxhdpi/ic_launcher.png b/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..32da992
Binary files /dev/null and b/res/drawable-xxhdpi/ic_launcher.png differ
diff --git a/res/layout/eventview.xml b/res/layout/eventview.xml
new file mode 100644 (file)
index 0000000..218fae9
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
+
+    <TextView
+        android:id="@+id/eventTitle"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:text=""
+        android:textSize="35sp"
+        android:selectAllOnFocus="true"
+        android:textIsSelectable="true"
+         />
+
+    <TextView
+        android:id="@+id/date"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:selectAllOnFocus="true"
+        android:textIsSelectable="true"
+        android:textSize="20sp"
+        />
+
+    <android.support.v7.widget.Space
+        android:id="@+id/space1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
+
+    <TextView
+        android:id="@+id/desc"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="Description:"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
+
+    <TextView
+        android:id="@+id/description"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="Small Text"
+        android:textAppearance="?android:attr/textAppearanceSmall" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/values-v11/styles.xml b/res/values-v11/styles.xml
new file mode 100644 (file)
index 0000000..541752f
--- /dev/null
@@ -0,0 +1,11 @@
+<resources>
+
+    <!--
+        Base application theme for API 11+. This theme completely replaces
+        AppBaseTheme from res/values/styles.xml on API 11+ devices.
+    -->
+    <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
+        <!-- API 11 theme customizations can go here. -->
+    </style>
+
+</resources>
\ No newline at end of file
diff --git a/res/values-v14/styles.xml b/res/values-v14/styles.xml
new file mode 100644 (file)
index 0000000..f20e015
--- /dev/null
@@ -0,0 +1,12 @@
+<resources>
+
+    <!--
+        Base application theme for API 14+. This theme completely replaces
+        AppBaseTheme from BOTH res/values/styles.xml and
+        res/values-v11/styles.xml on API 14+ devices.
+    -->
+    <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
+        <!-- API 14 theme customizations can go here. -->
+    </style>
+
+</resources>
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
new file mode 100644 (file)
index 0000000..3b009ce
--- /dev/null
@@ -0,0 +1,5 @@
+<resources>
+
+    <string name="app_name">Unical</string>
+
+</resources>
\ No newline at end of file
diff --git a/res/values/styles.xml b/res/values/styles.xml
new file mode 100644 (file)
index 0000000..4a10ca4
--- /dev/null
@@ -0,0 +1,20 @@
+<resources>
+
+    <!--
+        Base application theme, dependent on API level. This theme is replaced
+        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
+    -->
+    <style name="AppBaseTheme" parent="android:Theme.Light">
+        <!--
+            Theme customizations available in newer API levels can go in
+            res/values-vXX/styles.xml, while customizations related to
+            backward-compatibility can go here.
+        -->
+    </style>
+
+    <!-- Application theme. -->
+    <style name="AppTheme" parent="AppBaseTheme">
+        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
+    </style>
+
+</resources>
\ No newline at end of file
diff --git a/src/ro/ieval/unical/Constants.java b/src/ro/ieval/unical/Constants.java
new file mode 100644 (file)
index 0000000..031ea59
--- /dev/null
@@ -0,0 +1,8 @@
+package ro.ieval.unical;
+
+
+public class Constants {
+       public static String searchUrl="https://unical.ieval.ro/search";
+       public static String user="asd";
+       public static String password="asd";
+}
diff --git a/src/ro/ieval/unical/DatabaseInteract.java b/src/ro/ieval/unical/DatabaseInteract.java
new file mode 100644 (file)
index 0000000..a4d2580
--- /dev/null
@@ -0,0 +1,26 @@
+package ro.ieval.unical;
+
+import android.content.Context;
+import android.database.SQLException;
+import android.database.sqlite.SQLiteDatabase;
+
+public class DatabaseInteract {
+       private SQLiteDatabase database;
+       private MySQLiteHelper dbHelper;
+       
+       public DatabaseInteract(Context context) {
+               dbHelper = new MySQLiteHelper(context);
+       }
+       
+       public void open() throws SQLException {
+               database=dbHelper.getWritableDatabase();
+       }
+       
+       public void close() {
+               dbHelper.close();
+       }
+       
+       //Add event
+       //Delete event
+       //Search event
+}
diff --git a/src/ro/ieval/unical/Event.java b/src/ro/ieval/unical/Event.java
new file mode 100644 (file)
index 0000000..8d99947
--- /dev/null
@@ -0,0 +1,12 @@
+package ro.ieval.unical;
+public class Event {
+       public int date,time;
+       public boolean repeat;
+       public int repeatInterval;
+       public String location;
+       public String description;
+       public String tags[];
+       public String title;
+       Event() {
+       }
+}
diff --git a/src/ro/ieval/unical/MySQLiteHelper.java b/src/ro/ieval/unical/MySQLiteHelper.java
new file mode 100644 (file)
index 0000000..889ebda
--- /dev/null
@@ -0,0 +1,58 @@
+package ro.ieval.unical;
+
+import java.sql.SQLClientInfoException;
+
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteDatabase.CursorFactory;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.util.Log;
+
+public class MySQLiteHelper extends SQLiteOpenHelper {
+       public static final String Name="Events";
+       
+       public static final String ID = "_id";
+       public static final String name = "Name";
+       public static final String description = "Description";
+       public static final String date = "Date";
+       public static final String time = "Time";
+       public static final String repeat = "repeat";
+       public static final String repeatIn = "repeatInterval";
+       public static final String location = "Location";
+       
+       private static final int dbversion=1;
+       
+       private static final String Database_create = "create table " + Name + "(" + 
+                       ID + " integer primary key autoincrement, " +
+                       name + " text not null, " + 
+                       description + " text, " + 
+                       date + " integer, " + 
+                       time + " integer, " +
+                       repeat + " integer, "+
+                       repeatIn + " integer, " +
+                       location + " text);"
+                       ;
+       
+       public MySQLiteHelper(Context context) {
+               super(context,Name, null, dbversion);
+               // TODO Auto-generated constructor stub
+       }
+
+       @Override
+       public void onCreate(SQLiteDatabase db) {
+               // TODO Auto-generated method stub
+               db.execSQL(Database_create);
+               
+       }
+
+       @Override
+       public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+               // TODO Auto-generated method stub
+               Log.w(MySQLiteHelper.class.getName(),
+                       "Upgrading database from version " + oldVersion + " to "
+                           + newVersion + ", which will destroy all old data");
+                   db.execSQL("DROP TABLE IF EXISTS " + Name);
+                   onCreate(db);
+       }
+       
+}
\ No newline at end of file
diff --git a/src/ro/ieval/unical/mainActivity.java b/src/ro/ieval/unical/mainActivity.java
new file mode 100644 (file)
index 0000000..eba4604
--- /dev/null
@@ -0,0 +1,72 @@
+package ro.ieval.unical;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Date;
+
+import ro.ieval.unical.R;
+import com.google.gson.Gson;
+
+import android.graphics.Color;
+import android.os.Bundle;
+import android.os.Handler;
+import android.util.Base64;
+import android.widget.EditText;
+import android.widget.TextView;
+
+
+public class mainActivity extends android.app.Activity {
+       Event[] getEventList() {
+               Event events[];
+               URL hostUrlJson;
+               InputStreamReader in;
+               try {
+                       hostUrlJson=new URL(Constants.searchUrl);
+                       URLConnection calConnection = hostUrlJson.openConnection();
+                       calConnection.setRequestProperty("Authorization", "Basic "+Base64.encodeToString( (Constants.user+':'+Constants.password).getBytes(), Base64.NO_WRAP));
+                       in = new InputStreamReader(calConnection.getInputStream());
+                       Gson gson=new Gson();
+                       events=gson.fromJson(in,Event[].class);
+                       in.close();
+                       return events;
+               } catch (MalformedURLException e) {
+                       // TODO Auto-generated catch block
+                       System.err.println("catch1");
+                       e.printStackTrace();
+               } catch (IOException e) {
+                       // TODO Auto-generated catch block
+                       System.err.println("catch2");
+                       e.printStackTrace();
+               }
+               throw new AssertionError();
+       }
+       
+       @Override
+       protected void onCreate(Bundle savedInstanceState) {
+               // All Begins here :)
+               // And here it began the olympic app that does olympic thing
+               setContentView(R.layout.eventview);
+               final TextView eventTitle= (TextView) findViewById(R.id.eventTitle);
+               final TextView date=(TextView) findViewById(R.id.date);
+               final TextView description=(TextView) findViewById(R.id.description);
+               super.onCreate(savedInstanceState);
+               System.err.println("MuieLaComisie");
+               final Handler h=new Handler();
+               new Thread(new Runnable() {
+                       public void run() {
+                               final Event events[]=getEventList();
+                               h.post(new Runnable() {
+                                       public void run() {
+                                               // aici incepe
+                                               eventTitle.setText(events[0].title);
+                                               date.setText((new Date(events[0].date)).toString());
+                                               description.setText(events[0].description);
+                                       }
+                               });
+                       }
+               }).start();
+       }
+}
This page took 0.024239 seconds and 4 git commands to generate.