Permalink
Browse files

added android studio examples

  • Loading branch information...
codeanticode committed Jun 12, 2016
1 parent 5a1de46 commit 3fc2e29ed68fe3a061b46e4d6407ce4595227eaf
Showing with 1,237 additions and 0 deletions.
  1. +8 −0 android_studio/ex1_fragmentsv3/.gitignore
  2. +1 −0 android_studio/ex1_fragmentsv3/.idea/.name
  3. +22 −0 android_studio/ex1_fragmentsv3/.idea/compiler.xml
  4. +3 −0 android_studio/ex1_fragmentsv3/.idea/copyright/profiles_settings.xml
  5. +6 −0 android_studio/ex1_fragmentsv3/.idea/encodings.xml
  6. +24 −0 android_studio/ex1_fragmentsv3/.idea/gradle.xml
  7. +62 −0 android_studio/ex1_fragmentsv3/.idea/misc.xml
  8. +9 −0 android_studio/ex1_fragmentsv3/.idea/modules.xml
  9. +12 −0 android_studio/ex1_fragmentsv3/.idea/runConfigurations.xml
  10. +1 −0 android_studio/ex1_fragmentsv3/app/.gitignore
  11. +27 −0 android_studio/ex1_fragmentsv3/app/build.gradle
  12. BIN android_studio/ex1_fragmentsv3/app/libs/android-core.jar
  13. +17 −0 android_studio/ex1_fragmentsv3/app/proguard-rules.pro
  14. +13 −0 ...ex1_fragmentsv3/app/src/androidTest/java/tutorials/androidstudio/fragmentsv3/ApplicationTest.java
  15. +20 −0 android_studio/ex1_fragmentsv3/app/src/main/AndroidManifest.xml
  16. +19 −0 ...id_studio/ex1_fragmentsv3/app/src/main/java/tutorials/androidstudio/fragmentsv3/MainActivity.java
  17. +17 −0 android_studio/ex1_fragmentsv3/app/src/main/java/tutorials/androidstudio/fragmentsv3/Sketch.java
  18. +12 −0 android_studio/ex1_fragmentsv3/app/src/main/res/layout/activity_main.xml
  19. BIN android_studio/ex1_fragmentsv3/app/src/main/res/mipmap-hdpi/ic_launcher.png
  20. BIN android_studio/ex1_fragmentsv3/app/src/main/res/mipmap-mdpi/ic_launcher.png
  21. BIN android_studio/ex1_fragmentsv3/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  22. BIN android_studio/ex1_fragmentsv3/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  23. BIN android_studio/ex1_fragmentsv3/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  24. +6 −0 android_studio/ex1_fragmentsv3/app/src/main/res/values-w820dp/dimens.xml
  25. +6 −0 android_studio/ex1_fragmentsv3/app/src/main/res/values/colors.xml
  26. +5 −0 android_studio/ex1_fragmentsv3/app/src/main/res/values/dimens.xml
  27. +3 −0 android_studio/ex1_fragmentsv3/app/src/main/res/values/strings.xml
  28. +11 −0 android_studio/ex1_fragmentsv3/app/src/main/res/values/styles.xml
  29. +15 −0 ...studio/ex1_fragmentsv3/app/src/test/java/tutorials/androidstudio/fragmentsv3/ExampleUnitTest.java
  30. +23 −0 android_studio/ex1_fragmentsv3/build.gradle
  31. +18 −0 android_studio/ex1_fragmentsv3/gradle.properties
  32. BIN android_studio/ex1_fragmentsv3/gradle/wrapper/gradle-wrapper.jar
  33. +6 −0 android_studio/ex1_fragmentsv3/gradle/wrapper/gradle-wrapper.properties
  34. +160 −0 android_studio/ex1_fragmentsv3/gradlew
  35. +90 −0 android_studio/ex1_fragmentsv3/gradlew.bat
  36. +1 −0 android_studio/ex1_fragmentsv3/settings.gradle
  37. +8 −0 android_studio/ex2_fragmentsv4/.gitignore
  38. +1 −0 android_studio/ex2_fragmentsv4/.idea/.name
  39. +22 −0 android_studio/ex2_fragmentsv4/.idea/compiler.xml
  40. +3 −0 android_studio/ex2_fragmentsv4/.idea/copyright/profiles_settings.xml
  41. +6 −0 android_studio/ex2_fragmentsv4/.idea/encodings.xml
  42. +24 −0 android_studio/ex2_fragmentsv4/.idea/gradle.xml
  43. +62 −0 android_studio/ex2_fragmentsv4/.idea/misc.xml
  44. +9 −0 android_studio/ex2_fragmentsv4/.idea/modules.xml
  45. +12 −0 android_studio/ex2_fragmentsv4/.idea/runConfigurations.xml
  46. +1 −0 android_studio/ex2_fragmentsv4/app/.gitignore
  47. +27 −0 android_studio/ex2_fragmentsv4/app/build.gradle
  48. BIN android_studio/ex2_fragmentsv4/app/libs/android-core.jar
  49. +17 −0 android_studio/ex2_fragmentsv4/app/proguard-rules.pro
  50. +13 −0 ...ex2_fragmentsv4/app/src/androidTest/java/tutorials/androidstudio/fragmentsv4/ApplicationTest.java
  51. +20 −0 android_studio/ex2_fragmentsv4/app/src/main/AndroidManifest.xml
  52. +22 −0 ...id_studio/ex2_fragmentsv4/app/src/main/java/tutorials/androidstudio/fragmentsv4/MainActivity.java
  53. +17 −0 android_studio/ex2_fragmentsv4/app/src/main/java/tutorials/androidstudio/fragmentsv4/Sketch.java
  54. +12 −0 android_studio/ex2_fragmentsv4/app/src/main/res/layout/activity_main.xml
  55. BIN android_studio/ex2_fragmentsv4/app/src/main/res/mipmap-hdpi/ic_launcher.png
  56. BIN android_studio/ex2_fragmentsv4/app/src/main/res/mipmap-mdpi/ic_launcher.png
  57. BIN android_studio/ex2_fragmentsv4/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  58. BIN android_studio/ex2_fragmentsv4/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  59. BIN android_studio/ex2_fragmentsv4/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  60. +6 −0 android_studio/ex2_fragmentsv4/app/src/main/res/values-w820dp/dimens.xml
  61. +6 −0 android_studio/ex2_fragmentsv4/app/src/main/res/values/colors.xml
  62. +5 −0 android_studio/ex2_fragmentsv4/app/src/main/res/values/dimens.xml
  63. +3 −0 android_studio/ex2_fragmentsv4/app/src/main/res/values/strings.xml
  64. +11 −0 android_studio/ex2_fragmentsv4/app/src/main/res/values/styles.xml
  65. +15 −0 ...studio/ex2_fragmentsv4/app/src/test/java/tutorials/androidstudio/fragmentsv4/ExampleUnitTest.java
  66. +23 −0 android_studio/ex2_fragmentsv4/build.gradle
  67. +18 −0 android_studio/ex2_fragmentsv4/gradle.properties
  68. BIN android_studio/ex2_fragmentsv4/gradle/wrapper/gradle-wrapper.jar
  69. +6 −0 android_studio/ex2_fragmentsv4/gradle/wrapper/gradle-wrapper.properties
  70. +160 −0 android_studio/ex2_fragmentsv4/gradlew
  71. +90 −0 android_studio/ex2_fragmentsv4/gradlew.bat
  72. +1 −0 android_studio/ex2_fragmentsv4/settings.gradle
@@ -0,0 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
@@ -0,0 +1 @@
Fragments v3
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
@@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.10" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="myModules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/ex1_fragmentsv3.iml" filepath="$PROJECT_DIR$/ex1_fragmentsv3.iml" />
</modules>
</component>
</project>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
@@ -0,0 +1 @@
/build
@@ -0,0 +1,27 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "tutorials.androidstudio.fragmentsv3"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile files('libs/android-core.jar')
}
Binary file not shown.
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/andres/code/android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# 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 *;
#}
@@ -0,0 +1,13 @@
package tutorials.androidstudio.fragmentsv3;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="tutorials.androidstudio.fragmentsv3"
xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
@@ -0,0 +1,19 @@
package tutorials.androidstudio.fragmentsv3;
import android.os.Bundle;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FragmentManager fragmentManager = getFragmentManager();
Fragment fragment = new Sketch();
fragmentManager.beginTransaction()
.replace(R.id.container, fragment)
.commit();
}
}
@@ -0,0 +1,17 @@
package tutorials.androidstudio.fragmentsv3;
import processing.core.PApplet;
public class Sketch extends PApplet {
public void settings() {
size(600, 600);
}
public void setup() { }
public void draw() {
if (mousePressed) {
ellipse(mouseX, mouseY, 50, 50);
}
}
}
@@ -0,0 +1,12 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="tutorials.androidstudio.fragmentsv3.MainActivity" >
<FrameLayout android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
@@ -0,0 +1,6 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
@@ -0,0 +1,5 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">Fragments v3</string>
</resources>
@@ -0,0 +1,11 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
@@ -0,0 +1,15 @@
package tutorials.androidstudio.fragmentsv3;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
@@ -0,0 +1,23 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
@@ -0,0 +1,18 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
Oops, something went wrong.

0 comments on commit 3fc2e29

Please sign in to comment.