Skip to content

Commit 5616cbe

Browse files
committed
Added Eclipse project files
1 parent 25d2ec0 commit 5616cbe

File tree

11 files changed

+230
-17
lines changed

11 files changed

+230
-17
lines changed

GaeGuestbook/.classpath

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="com.google.appengine.eclipse.core.GAE_CONTAINER"/>
5+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
6+
<classpathentry kind="output" path="war/WEB-INF/classes"/>
7+
</classpath>

GaeGuestbook/.project

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>GaeGuestbook</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.jdt.core.javabuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>com.google.appengine.eclipse.core.projectValidator</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
<buildCommand>
29+
<name>com.google.appengine.eclipse.core.enhancerbuilder</name>
30+
<arguments>
31+
</arguments>
32+
</buildCommand>
33+
</buildSpec>
34+
<natures>
35+
<nature>org.eclipse.jdt.core.javanature</nature>
36+
<nature>com.google.appengine.eclipse.core.gaeNature</nature>
37+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
38+
</natures>
39+
</projectDescription>

HelloAndroid/.classpath

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="src" path="gen"/>
5+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
6+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
7+
<classpathentry kind="output" path="bin/classes"/>
8+
</classpath>

HelloAndroid/.project

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>HelloAndroid</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.jdt.core.javabuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
31+
<nature>org.eclipse.jdt.core.javanature</nature>
32+
</natures>
33+
</projectDescription>

HelloAndroid/res/layout/activity_main.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
android:layout_height="wrap_content"
3434
android:layout_weight="1"
3535
android:onClick="startRecording"
36-
android:text="@string/button_video_capture" />
36+
android:text="@string/button_start_capture" />
3737

3838
<Button
3939
android:layout_width="0dip"
4040
android:layout_height="wrap_content"
4141
android:layout_weight="1"
4242
android:onClick="stopRecording"
43-
android:text="@string/button_video_capture" />
43+
android:text="@string/button_stop_capture" />
4444
</LinearLayout>
4545

4646
<!-- The camera preview -->

HelloAndroid/res/values/strings.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<string name="button_send">Send</string>
88
<string name="hello_world">Hello world!</string>
99
<string name="title_activity_display_message">My Message</string>
10-
<string name="button_video_capture">Capture Video</string>
10+
<string name="button_start_capture">Capture Capture</string>
11+
<string name="button_stop_capture">Stop Capture</string>
1112

1213
</resources>

HelloAndroid/src/com/example/helloandroid/MainActivity.java

+31-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.example.helloandroid;
22

33
import android.annotation.SuppressLint;
4+
import android.annotation.TargetApi;
45
import android.app.ActionBar;
56
import android.app.Activity;
67
import android.content.Intent;
@@ -66,21 +67,42 @@ public void sendMessage(View view) {
6667
startActivity(intent);
6768
}
6869

69-
@SuppressLint("NewApi")
70+
@TargetApi(14)
71+
@Override
72+
protected void onResume() {
73+
super.onResume();
74+
75+
camera = Camera.open();
76+
cameraPreview = new CameraPreview(this, camera);
77+
FrameLayout previewFrameLayout = (FrameLayout) findViewById(R.id.camera_preview);
78+
previewFrameLayout.addView(cameraPreview);
79+
camera.getParameters().setRecordingHint(true);
80+
}
81+
82+
@Override
83+
protected void onPause() {
84+
super.onPause();
85+
86+
try {
87+
if (camera != null) {
88+
camera.stopPreview();
89+
camera.setPreviewDisplay(null);
90+
camera.release();
91+
camera = null;
92+
}
93+
} catch (Exception e) {
94+
Log.e(TAG, e.getMessage());
95+
e.printStackTrace();
96+
}
97+
}
98+
7099
public void startRecording(View view) {
71100
try {
72101
if (!Utils.isIntentAvailable(this, MediaStore.ACTION_VIDEO_CAPTURE)) {
73102
Toast.makeText(this, "No camera available", Toast.LENGTH_SHORT).show();
74103
return;
75104
}
76105

77-
camera = Camera.open();
78-
cameraPreview = new CameraPreview(this, camera);
79-
FrameLayout previewFrameLayout = (FrameLayout) findViewById(R.id.camera_preview);
80-
previewFrameLayout.addView(cameraPreview);
81-
82-
camera.getParameters().setRecordingHint(true);
83-
84106
camera.unlock();
85107
recorder = new MediaRecorder();
86108
recorder.setCamera(camera);
@@ -112,6 +134,7 @@ public void stopRecording(View view) {
112134
if (recorder != null) {
113135
recorder.stop();
114136
releaseMediaRecorder();
137+
camera.lock();
115138
}
116139

117140
Log.i(TAG, "Recording stopped");
@@ -123,11 +146,5 @@ private void releaseMediaRecorder() {
123146
recorder.release();
124147
recorder = null;
125148
}
126-
if (camera != null) {
127-
camera.lock();
128-
camera.release();
129-
// camera.stopPreview();
130-
camera.release();
131-
}
132149
}
133150
}

HelloGWT/.classpath

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="src" output="test-classes" path="test"/>
5+
<classpathentry kind="con" path="com.google.appengine.eclipse.core.GAE_CONTAINER"/>
6+
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
7+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
8+
<classpathentry kind="output" path="war/WEB-INF/classes"/>
9+
</classpath>

HelloGWT/.project

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>HelloGWT</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.jdt.core.javabuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
<buildCommand>
29+
<name>com.google.appengine.eclipse.core.projectValidator</name>
30+
<arguments>
31+
</arguments>
32+
</buildCommand>
33+
<buildCommand>
34+
<name>com.google.appengine.eclipse.core.enhancerbuilder</name>
35+
<arguments>
36+
</arguments>
37+
</buildCommand>
38+
</buildSpec>
39+
<natures>
40+
<nature>org.eclipse.jdt.core.javanature</nature>
41+
<nature>com.google.appengine.eclipse.core.gaeNature</nature>
42+
<nature>com.google.gwt.eclipse.core.gwtNature</nature>
43+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
44+
</natures>
45+
</projectDescription>

StockWatcher/.classpath

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="src" output="test-classes" path="test"/>
5+
<classpathentry kind="con" path="com.google.appengine.eclipse.core.GAE_CONTAINER"/>
6+
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
7+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
8+
<classpathentry kind="output" path="war/WEB-INF/classes"/>
9+
</classpath>

StockWatcher/.project

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>StockWatcher</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.jdt.core.javabuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
<buildCommand>
29+
<name>com.google.appengine.eclipse.core.projectValidator</name>
30+
<arguments>
31+
</arguments>
32+
</buildCommand>
33+
<buildCommand>
34+
<name>com.google.appengine.eclipse.core.enhancerbuilder</name>
35+
<arguments>
36+
</arguments>
37+
</buildCommand>
38+
</buildSpec>
39+
<natures>
40+
<nature>org.eclipse.jdt.core.javanature</nature>
41+
<nature>com.google.appengine.eclipse.core.gaeNature</nature>
42+
<nature>com.google.gwt.eclipse.core.gwtNature</nature>
43+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
44+
</natures>
45+
</projectDescription>

0 commit comments

Comments
 (0)