Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
db13424
android app now has login/registration
mstombaugh Mar 29, 2014
c17a74b
Update DatabaseAccessTask.java
mstombaugh Mar 31, 2014
bcade78
Update UserFunctions.java
mstombaugh Mar 31, 2014
d449d12
Update UserFunctions.java
mstombaugh Mar 31, 2014
67d1893
Login, Register, Homes, Rooms work
mstombaugh Apr 1, 2014
437a81d
Update RoomsActivity.java
ANixon124 Apr 1, 2014
eef86d6
Update HomesActivity.java
ANixon124 Apr 1, 2014
f983a6d
Update EditActivity.java
ANixon124 Apr 1, 2014
444cd5c
updated HomesActivity and RoomsActivity
ANixon124 Apr 1, 2014
9aa2b90
Update RoomsActivity.java
mstombaugh Apr 2, 2014
096a08b
adding rooms kinda works
mstombaugh Apr 2, 2014
cfa3e29
fixed nullPointerAcception and changed login screen text
mstombaugh Apr 5, 2014
992d3f4
changed back button to reload the previous room
mstombaugh Apr 6, 2014
38fe6fc
login state loaded from internal database
mstombaugh Apr 6, 2014
a11f1c8
renamed package to make sense
mstombaugh Apr 6, 2014
b74b198
added camera requirements to manifest
mstombaugh Apr 6, 2014
07ae70b
added infrastructure for delete home and room buttons
ANixon124 Apr 6, 2014
57730cc
added call to open camera app
mstombaugh Apr 6, 2014
5e2943e
Merge branch 'master' of https://github.com/MMMADscientists/Promenade…
mstombaugh Apr 6, 2014
14a7cc3
added delete button functionality
ANixon124 Apr 6, 2014
db00b50
Merge branch 'master' of https://github.com/MMMADscientists/Promenade…
ANixon124 Apr 6, 2014
3d5e394
added simple image capture
mstombaugh Apr 6, 2014
50dbf63
Merge branch 'master' of https://github.com/MMMADscientists/Promenade…
mstombaugh Apr 7, 2014
566ec26
started amazon s3 integration for saving photos
mstombaugh Apr 7, 2014
c241379
added room/property deletion, beginning S3 upload
mstombaugh Apr 9, 2014
ce4f8a6
Update DatabaseHandler.java
mstombaugh Apr 9, 2014
d2d8c38
recovered Delete room/property confirmation functionality
ANixon124 Apr 10, 2014
659239f
added "add connection" functionality
ANixon124 Apr 14, 2014
06846a5
Added loading pics to EditRooms
mstombaugh Apr 15, 2014
72b5414
Update HomesActivity.java
ANixon124 Apr 16, 2014
9f468e7
Update RoomsActivity.java
ANixon124 Apr 16, 2014
20a0dd1
Update EditActivity.java
ANixon124 Apr 16, 2014
4a88609
bug fixes for tablets
mstombaugh Apr 19, 2014
7821672
Merge branch 'master' of https://github.com/MMMADscientists/Promenade…
mstombaugh Apr 19, 2014
8546317
changed git ignore, changed upload/download of files
mstombaugh Apr 19, 2014
3f4578d
more gitignore changes
mstombaugh Apr 19, 2014
a262285
temp fix
mstombaugh Apr 19, 2014
9cc3ae7
Revert "bug fixes for tablets"
mstombaugh Apr 19, 2014
077d761
finally unbroke all the things i broke
mstombaugh Apr 19, 2014
fc2d25f
I think I fixed it
mstombaugh Apr 20, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
11,365 changes: 11,365 additions & 0 deletions .metadata/.bak_0.log

Large diffs are not rendered by default.

11,421 changes: 11,421 additions & 0 deletions .metadata/.bak_1.log

Large diffs are not rendered by default.

11,407 changes: 11,407 additions & 0 deletions .metadata/.bak_2.log

Large diffs are not rendered by default.

11,583 changes: 11,583 additions & 0 deletions .metadata/.bak_3.log

Large diffs are not rendered by default.

11,537 changes: 11,537 additions & 0 deletions .metadata/.bak_4.log

Large diffs are not rendered by default.

11,473 changes: 11,473 additions & 0 deletions .metadata/.bak_5.log

Large diffs are not rendered by default.

11,610 changes: 11,610 additions & 0 deletions .metadata/.bak_6.log

Large diffs are not rendered by default.

11,615 changes: 11,615 additions & 0 deletions .metadata/.bak_7.log

Large diffs are not rendered by default.

11,719 changes: 11,719 additions & 0 deletions .metadata/.bak_8.log

Large diffs are not rendered by default.

11,547 changes: 11,547 additions & 0 deletions .metadata/.bak_9.log

Large diffs are not rendered by default.

4,873 changes: 1,796 additions & 3,077 deletions .metadata/.log

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
background=#ffffff
foreground=#000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
background=#000000
foreground=#ffffff
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<uiBinderReferences>
<referenceManager>
<references/>
</referenceManager>
<uiBinderSubtypeToOwner/>
<uiBinderSubtypeToUiXml/>
<uiXmlReferencedFields/>
</uiBinderReferences>
25 changes: 25 additions & 0 deletions .metadata/.plugins/org.eclipse.cdt.core/.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,28 @@
*** SESSION Mar 15, 2014 15:55:43.02 -------------------------------------------
*** SESSION Mar 15, 2014 15:58:19.63 -------------------------------------------
*** SESSION Mar 15, 2014 15:58:41.50 -------------------------------------------
*** SESSION Mar 15, 2014 16:01:11.48 -------------------------------------------
*** SESSION Mar 28, 2014 18:24:12.70 -------------------------------------------
*** SESSION Apr 01, 2014 09:48:28.30 -------------------------------------------
*** SESSION Apr 01, 2014 09:57:16.54 -------------------------------------------
*** SESSION Apr 02, 2014 15:00:01.53 -------------------------------------------
*** SESSION Apr 02, 2014 15:07:00.39 -------------------------------------------
*** SESSION Apr 05, 2014 15:34:07.21 -------------------------------------------
*** SESSION Apr 05, 2014 19:37:11.87 -------------------------------------------
*** SESSION Apr 06, 2014 14:11:45.89 -------------------------------------------
*** SESSION Apr 07, 2014 22:19:45.56 -------------------------------------------
*** SESSION Apr 08, 2014 18:52:25.67 -------------------------------------------
*** SESSION Apr 08, 2014 18:54:56.58 -------------------------------------------
*** SESSION Apr 08, 2014 18:56:29.22 -------------------------------------------
*** SESSION Apr 08, 2014 18:57:06.50 -------------------------------------------
*** SESSION Apr 08, 2014 19:02:53.41 -------------------------------------------
*** SESSION Apr 08, 2014 19:56:40.82 -------------------------------------------
*** SESSION Apr 08, 2014 19:58:01.21 -------------------------------------------
*** SESSION Apr 08, 2014 20:01:57.51 -------------------------------------------
*** SESSION Apr 08, 2014 21:11:01.42 -------------------------------------------
*** SESSION Apr 09, 2014 20:37:56.40 -------------------------------------------
*** SESSION Apr 13, 2014 20:36:53.40 -------------------------------------------
*** SESSION Apr 18, 2014 22:18:52.77 -------------------------------------------
*** SESSION Apr 18, 2014 23:28:57.92 -------------------------------------------
*** SESSION Apr 20, 2014 12:00:26.19 -------------------------------------------
*** SESSION Apr 20, 2014 12:06:30.71 -------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
package com.promenadevt;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.promenadevt.android.R;
import com.promenadevt.library.DatabaseHandler;
import com.promenadevt.library.UserFunctions;

public class RoomsActivity extends Activity
{
List<Button> rooms;
Button btnNewRoom;
Button btnChangeAddr;
Button btnLogout;
Button btnDelete;
EditText inputAddr;

UserFunctions userFunctions;

private static String username;
private static String address;
private static String dbID;

private static String KEY_SUCCESS = "success";
private static String KEY_ERROR = "error";
private static String KEY_ERROR_MSG = "error_msg";
private static String KEY_TUPLE = "tuples";
private static String KEY_IDROOM = "idRoom";
private static String KEY_ROOMNAME = "name";
private static String KEY_ROOMURL = "roomURL";
private static String KEY_IDPROPERTY = "idProperty";

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK ) {
// do something on back.
DatabaseHandler db = new DatabaseHandler(getApplicationContext());
Intent homes = new Intent(getApplicationContext(), HomesActivity.class);
HashMap<String, String> loginInfo = db.getUserDetails();
homes.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
homes.putExtra("name",loginInfo.get("username"));
startActivity(homes);
finish();
return true;
}

return super.onKeyDown(keyCode, event);
}

@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.rooms);

rooms = new ArrayList<Button>();


// may need to account for newly registered user here
Intent intent = getIntent();
// pull info from previous page
username = intent.getStringExtra("user");
address = intent.getStringExtra("addr");
inputAddr = (EditText) findViewById(R.id.addr);
inputAddr.setText(address);

userFunctions = new UserFunctions();

dbID = intent.getStringExtra("id");

btnChangeAddr = (Button) findViewById(R.id.btnUpdateP);

// make database call
final UserFunctions userFunction = new UserFunctions();
JSONObject json = userFunction.getRooms(dbID);

//lists of recieved data
List<Integer> idRoom = new ArrayList<Integer>();
List<String> roomName = new ArrayList<String>();
List<String> roomURL = new ArrayList<String>();

try {
if (json.getString(KEY_SUCCESS) != null) {
//loginErrorMsg.setText("");
String res = json.getString(KEY_SUCCESS);
if(Integer.parseInt(res) == 1){
JSONArray tuples = json.getJSONArray(KEY_TUPLE);
for(int i = 0; i< tuples.length(); i++){
JSONObject curTuple = tuples.getJSONObject(i);
idRoom.add(curTuple.getInt(KEY_IDROOM));
roomName.add(curTuple.getString(KEY_ROOMNAME));
roomURL.add(curTuple.getString(KEY_ROOMURL));
}
}

}
} catch (JSONException e) {
e.printStackTrace();
}

// fill xml based on db call
LinearLayout ll = (LinearLayout) findViewById(R.id.roomsLayout);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT);

// may need separate file
for(int i = 0; i < idRoom.size(); i++)
{

Button btn = new Button(this);
btn.setId(i);
final int id_ = btn.getId();
// set text to address
btn.setText(roomName.get(i).toString());
ll.addView(btn, params);
// fill properties based on db call
rooms.add((Button) findViewById(id_));
}

//new room button
Button newRoom = new Button(this);
newRoom.setId(idRoom.size());
newRoom.setText("Add new room +");
ll.addView(newRoom, params);
btnNewRoom = (Button) findViewById(idRoom.size());

//logout button
Button logout = new Button(this);
logout.setId(idRoom.size()+1);
logout.setText("Logout");
ll.addView(logout, params);
btnLogout = (Button) findViewById(idRoom.size()+1);

Button deleteRoom = new Button(this);
logout.setId(idRoom.size()+2);
logout.setText("Delete Property");
ll.addView(deleteRoom, params);
btnDelete = (Button) findViewById(idRoom.size()+2);

btnChangeAddr.setOnClickListener(new View.OnClickListener()
{

@Override
public void onClick(View arg0) {
// change address name in database
String newAddr = inputAddr.getText().toString();
userFunctions.renameHome(dbID,newAddr);
}

});

for(int i = 0; i < rooms.size(); i++)
{
final String name = roomName.get(i);
final Integer id = idRoom.get(i);
rooms.get(i).setOnClickListener(new View.OnClickListener()
{

@Override
public void onClick(View arg0) {
// go to next page with given room selected
Intent next = new Intent(getApplicationContext(),
EditActivity.class);
next.putExtra("user", username);
next.putExtra("name", name);
next.putExtra("id",id.toString());
next.putExtra("propID",dbID);
next.putExtra("addr",address);
startActivity(next);
finish();
}

});
}

btnNewRoom.setOnClickListener(new View.OnClickListener()
{

@Override
public void onClick(View arg0) {
// create new room and go to edit page
JSONObject jsonID = userFunctions.addRoom("New Room",dbID,null);

String value = "";
try {
value = jsonID.getString(KEY_IDROOM);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Intent next = new Intent(getApplicationContext(),
EditActivity.class);
next.putExtra("user", username);
next.putExtra("name", "New Room");
next.putExtra("id",value.toString());
next.putExtra("propID",dbID);
next.putExtra("addr",address);
startActivity(next);
finish();

}

});

btnLogout.setOnClickListener(new View.OnClickListener()
{

@Override
public void onClick(View arg0) {
userFunctions.logoutUser(getApplicationContext());
Intent login = new Intent(getApplicationContext(), LoginActivity.class);
login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(login);
// Closing rooms screen
finish();

}

});

btnDelete.setOnClickListener(new View.OnClickListener()
{

@Override
public void onClick(View arg0) {
//boolean cont = confirm();
if(true)//cont)
{
//userFunctions.deleteProperty(dbID);
Intent homes = new Intent(getApplicationContext(), HomesActivity.class);
homes.putExtra("name",username);
startActivity(homes);
}


}

});
}
}
Loading