<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET"/>
+ <uses-permission android:name="android.permission.READ_CALENDAR"/>
+ <uses-permission android:name="android.permission.WRITE_CALENDAR"/>
<application
android:allowBackup="true"
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
+ <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>
+ <activity android:name="com.facebook.LoginActivity"></activity>
</application>
</manifest>
\ No newline at end of file
# Project target.
target=android-17
+android.library.reference.1=../../../../eclipse/facebook-android-sdk-3.0.1/facebook
/>
<TextView
- android:id="@+id/desc"
+ android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Description:"
<resources>
<string name="app_name">Unical</string>
+ <string name="app_id">148275978690487</string>
</resources>
\ No newline at end of file
package ro.ieval.unical;
+import java.util.ArrayList;
+import java.util.List;
+
import android.content.ContentValues;
import android.content.Context;
+import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
public DatabaseInteract(Context context) {
dbHelper = new MySQLiteHelper(context);
+ database=dbHelper.getWritableDatabase();
}
public void open() throws SQLException {
//Insert event
public void insertEvent(Event e) {
ContentValues values = new ContentValues();
- values.put(allColumns[1],e.title);
- values.put(allColumns[2],e.description);
- values.put(allColumns[3],e.date);
- values.put(allColumns[4],e.duration);
+ values.put(allColumns[0], e._id);
+ values.put(allColumns[1], e.title);
+ values.put(allColumns[2], e.description);
+ values.put(allColumns[3], e.date);
+ values.put(allColumns[4], e.duration);
values.put(allColumns[5], e.repeat);
values.put(allColumns[6], e.repeatInterval);
values.put(allColumns[7], e.location);
database.insert(MySQLiteHelper.Name, null, values);
}
//Delete event
+ public void deleteEvent(String id) {
+ database.delete(MySQLiteHelper.Name, MySQLiteHelper.ID + "=" + id, null);
+ }
//Search event
+ //Get all events
+ public List<Event> getAllEvents() {
+ List<Event> events=new ArrayList<Event>();
+ Cursor cursor=database.query(MySQLiteHelper.Name,allColumns,null,null,null,null,null);
+
+ for(cursor.moveToFirst();!cursor.isAfterLast();cursor.moveToNext()) {
+ Event ev=cursorToEvent(cursor);
+ events.add(ev);
+ }
+ return events;
+ }
+
+ private Event cursorToEvent(Cursor cursor) {
+ // TODO Auto-generated method stub
+ Event e = new Event();
+ e._id=cursor.getString(0);
+ e.title=cursor.getString(1);
+ e.description=cursor.getString(2);
+ e.date=cursor.getInt(3);
+ e.duration=cursor.getInt(4);
+ if(cursor.getInt(5)==1) e.repeat=true;
+ else e.repeat=false;
+ e.repeatInterval=cursor.getInt(6);
+ e.location=cursor.getString(7);
+ return e;
+ }
}
package ro.ieval.unical;
+
+import android.database.Cursor;
+
public class Event {
+ public String _id;
public int date,duration;
public boolean repeat;
public int repeatInterval;
public String description;
public String tags[];
public String title;
- Event() {
+ Event(Cursor cursor) {
+ _id=cursor.getString(0);
+ title=cursor.getString(1);
+ description=cursor.getString(2);
+ date=cursor.getInt(3);
+ duration=cursor.getInt(4);
+ if(cursor.getInt(5)==1) repeat=true;
+ else repeat=false;
+ repeatInterval=cursor.getInt(6);
+ location=cursor.getString(7);
+ }
+ Event () {
+
}
}
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;
private static final int dbversion=1;
private static final String Database_create = "create table " + Name + "(" +
- ID + " integer primary key autoincrement, " +
+ //ID + " integer primary key autoincrement, " +
+ ID + " text primary key, " +
title + " text not null, " +
description + " text, " +
date + " integer, " +
import ro.ieval.unical.R;
import com.google.gson.Gson;
+import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.widget.EditText;
import android.widget.TextView;
+import com.facebook.*;
+
+import com.facebook.model.*;
public class mainActivity extends android.app.Activity {
Event[] getEventList() {
protected void onCreate(Bundle savedInstanceState) {
// All Begins here :)
// And here it began the olympic app that does olympic thing
- setContentView(R.layout.eventview);
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.login);
+
+ /*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);
final Handler h=new Handler();
new Thread(new Runnable() {
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);
- //DatabaseInteract db=new DatabaseInteract(null);
- //db.insertEvent(events[0]);
+ DatabaseInteract db=new DatabaseInteract(mainActivity.this);
}
});
}
- }).start();
+ }).start();*/
}
}