Skip to content
This repository was archived by the owner on Jun 23, 2022. It is now read-only.

Commit 99486e9

Browse files
author
Lyla
committed
1.01 Create Sunshine App with Default Hello World Contents
1 parent 267143c commit 99486e9

25 files changed

Lines changed: 497 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,13 @@ Sunshine
44
Sunshine is the companion Android app for the Udacity course [Developing Android Apps: Android Fundamentals](https://www.udacity.com/course/ud853).
55

66
Take the course to find out how to build this app a step at a time, and eventually create your own Android App!
7+
8+
This is the second version of the Sunshine code. The repository has been updated on:
9+
10+
* **February 13th, 2015** - Major update
11+
* February 25, 2015 - Minor bug fixes
12+
* March 4th, 2015 - Minor bug fixes
13+
14+
For the original version, please go [here](https://github.com/udacity/Sunshine).
15+
16+
A changelog for the course can be found [here](https://docs.google.com/a/knowlabs.com/document/d/193xJb_OpcNCqgquMhxPrMh05IEYFXQqt0S6-6YK8gBw/pub).

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 21
5+
buildToolsVersion "21.1.2"
6+
7+
defaultConfig {
8+
applicationId "com.example.android.sunshine.app"
9+
minSdkVersion 10
10+
targetSdkVersion 21
11+
versionCode 1
12+
versionName "1.0"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
compile 'com.android.support:appcompat-v7:21.0.2'
25+
}

app/proguard-rules.pro

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/lyla/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.example.android.sunshine.app;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class ApplicationTest extends ApplicationTestCase<Application> {
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
13+
}

app/src/main/AndroidManifest.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.example.android.sunshine.app" >
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@drawable/ic_launcher"
8+
android:label="@string/app_name"
9+
android:theme="@style/AppTheme" >
10+
<activity
11+
android:name=".MainActivity"
12+
android:label="@string/app_name" >
13+
<intent-filter>
14+
<action android:name="android.intent.action.MAIN" />
15+
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
</application>
20+
21+
</manifest>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package com.example.android.sunshine.app;
2+
3+
import android.support.v7.app.ActionBarActivity;
4+
import android.support.v4.app.Fragment;
5+
import android.os.Bundle;
6+
import android.view.LayoutInflater;
7+
import android.view.Menu;
8+
import android.view.MenuItem;
9+
import android.view.View;
10+
import android.view.ViewGroup;
11+
12+
13+
public class MainActivity extends ActionBarActivity {
14+
15+
@Override
16+
protected void onCreate(Bundle savedInstanceState) {
17+
super.onCreate(savedInstanceState);
18+
setContentView(R.layout.activity_main);
19+
if (savedInstanceState == null) {
20+
getSupportFragmentManager().beginTransaction()
21+
.add(R.id.container, new PlaceholderFragment())
22+
.commit();
23+
}
24+
}
25+
26+
@Override
27+
public boolean onCreateOptionsMenu(Menu menu) {
28+
// Inflate the menu; this adds items to the action bar if it is present.
29+
getMenuInflater().inflate(R.menu.main, menu);
30+
return true;
31+
}
32+
33+
@Override
34+
public boolean onOptionsItemSelected(MenuItem item) {
35+
// Handle action bar item clicks here. The action bar will
36+
// automatically handle clicks on the Home/Up button, so long
37+
// as you specify a parent activity in AndroidManifest.xml.
38+
int id = item.getItemId();
39+
40+
//noinspection SimplifiableIfStatement
41+
if (id == R.id.action_settings) {
42+
return true;
43+
}
44+
45+
return super.onOptionsItemSelected(item);
46+
}
47+
48+
/**
49+
* A placeholder fragment containing a simple view.
50+
*/
51+
public static class PlaceholderFragment extends Fragment {
52+
53+
public PlaceholderFragment() {
54+
}
55+
56+
@Override
57+
public View onCreateView(LayoutInflater inflater, ViewGroup container,
58+
Bundle savedInstanceState) {
59+
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
60+
return rootView;
61+
}
62+
}
63+
}
4.03 KB
Loading
2.29 KB
Loading
5.66 KB
Loading

0 commit comments

Comments
 (0)