Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RM14475 - Lab level 3. HTTP #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions PersonalLibraryCatalogueWithTwitter/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
2 changes: 2 additions & 0 deletions PersonalLibraryCatalogueWithTwitter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/gen
/bin
33 changes: 33 additions & 0 deletions PersonalLibraryCatalogueWithTwitter/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PersonalLibraryCatalogueWhithTwitter</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>
Original file line number Diff line number Diff line change
@@ -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
51 changes: 51 additions & 0 deletions PersonalLibraryCatalogueWithTwitter/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.personallibrarycataloguewhithtwitter"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="18" />

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
<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="com.example.personallibrarycataloguewhithtwitter.MainActivity"
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="com.example.personallibrarycataloguewhithtwitter.AddBookActivity"
android:label="@string/title_activity_add_book" >
</activity>
<activity
android:name="com.example.personallibrarycataloguewhithtwitter.ViewBookActivity"
android:label="@string/title_activity_view_book" >
</activity>
<activity
android:name="com.example.personallibrarycataloguewhithtwitter.TwitterActivity"
android:label="@string/title_activity_twitter"
android:launchMode="singleInstance"
android:configChanges="orientation" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="twit" android:host="app" />
</intent-filter>
</activity>
</application>

</manifest>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions PersonalLibraryCatalogueWithTwitter/proguard-project.txt
Original file line number Diff line number Diff line change
@@ -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 *;
#}
14 changes: 14 additions & 0 deletions PersonalLibraryCatalogueWithTwitter/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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-19
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.
114 changes: 114 additions & 0 deletions PersonalLibraryCatalogueWithTwitter/res/layout/activity_add_book.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<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:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".AddBookActivity" >

<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="@string/author"
android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText
android:id="@+id/author_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/author"
android:ems="10"
android:maxLines="1"
android:singleLine="true" >
</EditText>

<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/author_input"
android:layout_marginTop="16dp"
android:text="@string/title"
android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText
android:id="@+id/title_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/title"
android:layout_below="@+id/title"
android:ems="10"
android:maxLines="1"
android:singleLine="true" >
</EditText>

<TextView
android:id="@+id/cover"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/title_input"
android:layout_below="@+id/title_input"
android:layout_marginTop="16dp"
android:text="@string/cover"
android:textAppearance="?android:attr/textAppearanceMedium" />

<ImageView
android:id="@+id/cover_image"
android:layout_width="@dimen/book_cover_width"
android:layout_height="@dimen/book_cover_height"
android:layout_alignLeft="@+id/cover"
android:layout_below="@+id/cover"
android:maxHeight="@dimen/book_cover_height"
android:maxWidth="@dimen/book_cover_width"
android:onClick="coverImageClicked"
android:src="@drawable/book" />

<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/cover_image"
android:layout_below="@+id/cover_image"
android:layout_marginTop="16dp"
android:text="@string/description"
android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText
android:id="@+id/description_input"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/description"
android:layout_below="@+id/description"
android:ems="10"
android:inputType="textMultiLine"
android:maxLines="2" >
</EditText>

<Button
android:id="@+id/save"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/description_input"
android:layout_below="@+id/description_input"
android:layout_marginTop="16dp"
android:onClick="onSaveClicked"
android:text="@string/save" />

<Button
android:id="@+id/cancel"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/save"
android:layout_alignBottom="@+id/save"
android:layout_alignRight="@+id/description_input"
android:onClick="onCancelClicked"
android:text="@string/cancel" />

</RelativeLayout>
40 changes: 40 additions & 0 deletions PersonalLibraryCatalogueWithTwitter/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >

<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />

<RelativeLayout
android:id="@android:id/empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<TextView
android:id="@+id/no_book_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/add_book_button"
android:layout_centerHorizontal="true"
android:text="@string/no_book"
android:textAppearance="?android:attr/textAppearanceMedium" />

<Button
android:id="@+id/add_book_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:onClick="onAddBookClicked"
android:text="@string/add_new_book" />
</RelativeLayout>

</LinearLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<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:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".TwitterActivity" >

<EditText
android:id="@+id/twit_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:ems="10"
android:maxLength="140"
android:maxLines="8" >
</EditText>

<Button
android:id="@+id/twit_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/twit_message"
android:layout_below="@+id/twit_message"
android:text="@string/twit"
android:onClick="onTwitClicked" />

<TextView
android:id="@+id/characters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/characters_label"
android:layout_alignBottom="@+id/characters_label"
android:layout_alignRight="@+id/twit_message"
android:text="@string/characters_sample"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:id="@+id/characters_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/twit_button"
android:layout_toLeftOf="@+id/characters"
android:text="@string/characters_label"
android:textAppearance="?android:attr/textAppearanceLarge" />

</RelativeLayout>
Loading