--- /dev/null
+<?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>
--- /dev/null
+bin/
+gen/
\ No newline at end of file
--- /dev/null
+<?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>
--- /dev/null
+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
--- /dev/null
+<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
--- /dev/null
+# 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 *;
+#}
--- /dev/null
+# 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
--- /dev/null
+<?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
--- /dev/null
+<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
--- /dev/null
+<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
--- /dev/null
+<resources>
+
+ <string name="app_name">Unical</string>
+
+</resources>
\ No newline at end of file
--- /dev/null
+<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
--- /dev/null
+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";
+}
--- /dev/null
+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
+}
--- /dev/null
+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() {
+ }
+}
--- /dev/null
+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
--- /dev/null
+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();
+ }
+}