Commit 806048e5 authored by Edy Thenedy's avatar Edy Thenedy

initial android commit

parent 0f7e3455
<?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>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>BookShare</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>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.gmu.srct.bookshare"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="edu.gmu.srct.bookshare.Login"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Homepage"
>
</activity>
<activity
android:name=".Search"
>
</activity>
</application>
</manifest>
\ No newline at end of file
# 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 *;
#}
# 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
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:padding="30dip">
<TextView
android:text="@string/header"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="25dip"
android:textSize="24.5sp"
/>
<Button
android:id="@+id/create_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/create_label"
android:background="@color/button_background"
android:textColor="@color/text_button"
/>
<View
android:layout_width="1dp"
android:layout_height="30dp">
</View>
<Button
android:id="@+id/search_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/search_label"
android:background="@color/button_background"
android:textColor="@color/text_button"
/>
</LinearLayout>
\ No newline at end of file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="30dip"
tools:context=".Login" >
<TextView
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:textSize="22sp"
android:text="@string/header"
/>
<EditText
android:id="@+id/userId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/header"
android:hint="@string/user_id"
>
<!-- <requestFocus /> -->
</EditText>
<EditText
android:id="@+id/txtPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/userId"
android:inputType="textPassword"
android:hint="@string/password_label"
>
<!-- <requestFocus /> -->
</EditText>
<Button
android:id="@+id/btnSignIn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/txtPassword"
android:layout_alignParentRight="true"
android:text="@string/btnSignIn"
android:background="@color/button_background"
android:textColor="@color/text_button"
/>
<Button
android:id="@+id/btnCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/txtPassword"
android:text="@string/btnCancel"
android:background="@color/button_background"
android:textColor="@color/text_button"
/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="30dip">
<TextView
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:textSize="22sp"
android:text="@string/header"
/>
<EditText
android:id="@+id/searchId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/search_book_hint"
>
</EditText>
<View
android:layout_width="1dp"
android:layout_height="15dp">
</View>
<Button
android:id="@+id/search_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/search"
android:background="@color/button_background"
android:textColor="@color/text_button"
/>
<ScrollView
android:id="@+id/bookScroller"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableLayout
android:id="@+id/bookTable"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="*"/>
</ScrollView>
</LinearLayout>
\ No newline at end of file
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/menu_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/menu_settings"/>
</menu>
\ No newline at end of file
<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
<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
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="button_background">#006600</color>
<color name="text_button">#FFFFFF</color>
<color name="puzzle_hilite">#ffffffff</color>
<color name="puzzle_light">#64c6d4ef</color>
<color name="puzzle_dark">#6456648f</color>
<color name="puzzle_foreground">#ff000000</color>
<color name="puzzle_hint_0">#64ff0000</color>
<color name="puzzle_hint_1">#6400ff80</color>
<color name="puzzle_hint_2">#2000ff80</color>
<color name="puzzle_selected">#64ff8000</color>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Book Share</string>
<string name="main_title">Welcome to Book Share</string>
<string name="menu_settings">Settings</string>
<string name="btnSubmit">Submit</string>
<string name="header">GMU BOOKSHARE</string>
<string name="user_id">Username</string>
<string name="password_label">Password</string>
<string name="btnCancel">Cancel</string>
<string name="btnSignIn">Sign in</string>
<string name="invalid">Invalid UserID or Password</string>
<string name="create_label">I have a book</string>
<string name="search_label">I need a book</string>
<string name="search">Search</string>
<string name="search_book_hint">ISBN, Title, Author</string>
</resources>
\ No newline at end of file
<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
package edu.gmu.srct.bookshare;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;
public class Homepage extends Activity implements OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.homepage);
// Set up click listeners for all the buttons
View createButton = findViewById(R.id.create_button);
createButton.setOnClickListener(this);
View searchButton = findViewById(R.id.search_button);
searchButton.setOnClickListener(this);
} // end onCreate()
@Override
public void onClick(View v) {
switch(v.getId()) {
case R.id.create_button:
//Intent i = new Intent(this, Create.class);
//startActivity(i);
Toast.makeText(getApplicationContext(), "Create Button", Toast.LENGTH_SHORT).show();
break;
case R.id.search_button:
Intent i = new Intent(this, Search.class);
startActivity(i);
// Toast.makeText(getApplicationContext(), "Search", Toast.LENGTH_SHORT).show();
break;
/*
case R.id.exit_button:
finish();
break;
// More buttons go here (if any) ...
*
*/
} // end switch
} // end onClick()
}
package edu.gmu.srct.bookshare;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.Toast;
public class Login extends Activity implements OnClickListener{
private View cancelButton, signInButton;
private EditText userId, password;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
// Set up click listeners for all the buttons
signInButton = findViewById(R.id.btnSignIn);
signInButton.setOnClickListener(this);
cancelButton = findViewById(R.id.btnCancel);
cancelButton.setOnClickListener(this);
userId = (EditText) findViewById(R.id.userId);
password = (EditText) findViewById(R.id.txtPassword);
}
public void onClick(View v)
{
if(userId.getText().toString().trim().equals("bookshare") && password.getText().toString().trim().equals("bookshare"))
{
switch(v.getId())
{
case R.id.btnSignIn:
// If you click sign in, then you will be able to go to the next activity/interface
Intent i = new Intent(this, Homepage.class);
startActivity(i);
//Toast.makeText(getApplicationContext(), "You're logged in", Toast.LENGTH_SHORT).show();
break;
case R.id.btnCancel:
finish();
break;
// More buttons go here (if any)...
}
}
else
{
//Toast.makeText(Login.this, "Invalid UserID or Password", Toast.LENGTH_SHORT).show();
password.setText("");
showError();
}
} // end onClick()
private void showError()
{
password.setError("Invalid userID or Password");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.login, menu);
return true;
}
}
package edu.gmu.srct.bookshare;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import android.widget.Toast;
public class Search extends Activity implements OnClickListener {
private EditText search;
private String col1, col2, col3, col4;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.search);
// Set up click listeners for all the buttons
View searchButton = findViewById(R.id.search_button);
searchButton.setOnClickListener(this);
search = (EditText) findViewById(R.id.searchId);
} // end onCreate()
@Override
public void onClick(View v) {
switch(v.getId()) {
case R.id.search_button:
// What happens when the "Search" button is clicked
//Intent i = new Intent(this, .class);
//startActivity(i);
Toast.makeText(getApplicationContext(), "Search Button", Toast.LENGTH_SHORT).show();
break;
// More buttons go here (if any)
} // end switch
} // end onClick()
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment