Skip to content

Commit 2918198

Browse files
committed
added script for How to create VirtualHost in Linux Ubuntu 10.04 Lucid Lynx post
1 parent 273cef6 commit 2918198

File tree

23 files changed

+622
-0
lines changed

23 files changed

+622
-0
lines changed

android/Mp3player/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
bin
22
gen
3+
.settings
4+
.git
5+
target
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bin
2+
gen
3+
.settings
4+
.git
5+
target
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hrupin.edu.androidEx2" android:versionCode="1" android:versionName="0.0.1-SNAPSHOT">
3+
<uses-permission android:name="android.permission.INTERNET" />
4+
<uses-permission android:name="android.permission.CAMERA" />
5+
6+
<application android:icon="@drawable/icon" android:label="@string/app_name">
7+
<uses-library android:name="com.google.android.maps" android:required="true"></uses-library>
8+
<activity android:name=".HelloAndroidActivity">
9+
<intent-filter>
10+
<action android:name="android.intent.action.MAIN" />
11+
<category android:name="android.intent.category.LAUNCHER" />
12+
</intent-filter>
13+
</activity>
14+
15+
<activity android:name=".video.VideoSample" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar"></activity>
16+
</application>
17+
18+
</manifest>
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# File used by Eclipse to determine the target system
2+
# Project target.
3+
target=android-8

android/streamingVideoPlayer/pom.xml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.hrupin.edu</groupId>
5+
<artifactId>androidEx2</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
<packaging>apk</packaging>
8+
<name>androidEx2</name>
9+
10+
<dependencies>
11+
<dependency>
12+
<groupId>com.google.android</groupId>
13+
<artifactId>android</artifactId>
14+
<version>2.2.1</version>
15+
<scope>provided</scope>
16+
</dependency>
17+
18+
<!-- Google Maps -->
19+
<dependency>
20+
<groupId>com.google.android.maps</groupId>
21+
<artifactId>maps</artifactId>
22+
<version>8_r2</version>
23+
<scope>provided</scope>
24+
</dependency>
25+
26+
<!-- Gson 1.6: -->
27+
<dependency>
28+
<groupId>com.google.code.gson</groupId>
29+
<artifactId>gson</artifactId>
30+
<version>1.6</version>
31+
<scope>compile</scope>
32+
</dependency>
33+
34+
<!-- JUnit 4 -->
35+
<dependency>
36+
<groupId>junit</groupId>
37+
<artifactId>junit</artifactId>
38+
<version>4.0</version>
39+
<scope>test</scope>
40+
</dependency>
41+
</dependencies>
42+
43+
<build>
44+
<plugins>
45+
<plugin>
46+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
47+
<artifactId>maven-android-plugin</artifactId>
48+
<version>2.8.3</version>
49+
<configuration>
50+
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
51+
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
52+
<resourceDirectory>${project.basedir}/res</resourceDirectory>
53+
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
54+
<sdk>
55+
<platform>8</platform>
56+
</sdk>
57+
<deleteConflictingFiles>true</deleteConflictingFiles>
58+
<undeployBeforeDeploy>true</undeployBeforeDeploy>
59+
</configuration>
60+
<extensions>true</extensions>
61+
</plugin>
62+
63+
<plugin>
64+
<artifactId>maven-compiler-plugin</artifactId>
65+
<version>2.3.2</version>
66+
<configuration>
67+
<source>1.5</source>
68+
<target>1.5</target>
69+
</configuration>
70+
</plugin>
71+
</plugins>
72+
</build>
73+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<set xmlns:android="http://schemas.android.com/apk/res/android">
3+
<alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="400" />
4+
</set>
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
2+
<item android:id="@android:id/background">
3+
<shape>
4+
<solid android:color="@color/seekbar_bg" />
5+
</shape>
6+
</item>
7+
<item android:id="@android:id/secondaryProgress">
8+
<clip>
9+
<shape>
10+
<solid android:color="@color/seekbar_sec_progress" />
11+
</shape>
12+
</clip>
13+
</item>
14+
<item android:id="@android:id/progress">
15+
<clip>
16+
<shape>
17+
<solid android:color="@color/seekbar_progress" />
18+
</shape>
19+
</clip>
20+
</item>
21+
</layer-list>
772 Bytes
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent"
3+
android:layout_height="fill_parent">
4+
<Button android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/buttonVideoSample" android:text="Video Sample"></Button>
5+
</LinearLayout>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent"
3+
android:layout_height="match_parent">
4+
<FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/frameLayoutRoot">
5+
<SurfaceView android:id="@+id/surfaceViewFrame" android:layout_gravity="center" android:layout_height="wrap_content" android:layout_width="wrap_content"></SurfaceView>
6+
<LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayoutMediaController" android:layout_height="wrap_content" android:paddingBottom="5dp"
7+
android:paddingTop="5dp" android:layout_gravity="bottom" android:gravity="center_vertical" android:background="@color/media_controller_bg_color">
8+
<TextView android:layout_width="wrap_content" android:id="@+id/textViewPlayed" android:layout_marginLeft="5dp" android:layout_marginRight="5dp"
9+
android:textColor="@color/media_controller_text_color" android:textStyle="bold" android:text="0:00:00" android:padding="0dp" android:textSize="13sp" android:gravity="center"
10+
android:layout_height="wrap_content"></TextView>
11+
<SeekBar android:id="@+id/seekBarProgress" android:layout_weight="1" style="@style/MyCustomProgressStyle" android:layout_width="fill_parent"
12+
android:layout_height="wrap_content" android:progress="50"></SeekBar>
13+
<TextView android:layout_width="wrap_content" android:id="@+id/textViewLength" android:layout_marginLeft="5dp" android:layout_marginRight="5dp"
14+
android:textColor="@color/media_controller_text_color" android:textStyle="bold" android:text="0:00:00" android:textSize="13sp" android:padding="0dp" android:gravity="center"
15+
android:layout_height="wrap_content"></TextView>
16+
</LinearLayout>
17+
<ProgressBar style="?android:attr/progressBarStyleLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"
18+
android:id="@+id/progressBarWait"></ProgressBar>
19+
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageViewPauseIndicator" android:layout_gravity="center"
20+
android:src="@drawable/pause_button"></ImageView>
21+
</FrameLayout>
22+
23+
</LinearLayout>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="media_controller_text_color">#FFFFFF</color>
4+
<color name="media_controller_bg_color">#5f5f5f</color>
5+
<color name="seekbar_bg">#141414</color>
6+
<color name="seekbar_progress">#a53130</color>
7+
<color name="seekbar_sec_progress">#875e5e</color>
8+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="hello">Hello androidEx2!</string>
4+
<string name="app_name">androidEx2</string>
5+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<style name="MyCustomProgressStyle">
4+
<item name="android:indeterminateOnly">false</item>
5+
<item name="android:progressDrawable">@drawable/seekbarcolors</item>
6+
<item name="android:indeterminateDrawable">@android:drawable/progress_indeterminate_horizontal</item>
7+
<item name="android:minHeight">10dp</item>
8+
<item name="android:maxHeight">10dp</item>
9+
<item name="android:thumbOffset">0dp</item>
10+
<item name="android:thumb">@drawable/thumb</item>
11+
</style>
12+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.hrupin.edu.androidEx2;
2+
3+
import com.hrupin.edu.androidEx2.video.VideoSample;
4+
5+
import android.app.Activity;
6+
import android.content.Intent;
7+
import android.os.Bundle;
8+
import android.util.Log;
9+
import android.view.View;
10+
import android.view.View.OnClickListener;
11+
import android.widget.Button;
12+
13+
public class HelloAndroidActivity extends Activity implements OnClickListener {
14+
15+
private static String TAG = "androidEx2";
16+
17+
private Button buttonVideoSample;
18+
19+
@Override
20+
public void onCreate(Bundle savedInstanceState) {
21+
super.onCreate(savedInstanceState);
22+
Log.i(TAG, "onCreate");
23+
setContentView(R.layout.main);
24+
25+
buttonVideoSample = (Button) findViewById(R.id.buttonVideoSample);
26+
buttonVideoSample.setOnClickListener(this);
27+
}
28+
29+
public void onClick(View v) {
30+
if (v.getId() == R.id.buttonVideoSample) {
31+
// **********************************
32+
// HERE SET YOUR VIDEO URI
33+
String video_uri = "VIDEO_URI";
34+
// HERE SET YOUR VIDEO URI
35+
// For example: http://www.pocketjourney.com/downloads/pj/video/famous.3gp
36+
// **********************************
37+
38+
Intent intent = new Intent(this, VideoSample.class);
39+
intent.putExtra("video_path", video_uri);
40+
startActivity(intent);
41+
}
42+
}
43+
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.hrupin.edu.androidEx2.video;
2+
3+
import java.text.DecimalFormat;
4+
5+
public class Utils {
6+
public static String durationInSecondsToString(int sec){
7+
int hours = sec / 3600;
8+
int minutes = (sec / 60) - (hours * 60);
9+
int seconds = sec - (hours * 3600) - (minutes * 60) ;
10+
String formatted = String.format("%d:%02d:%02d", hours, minutes, seconds);
11+
return formatted;
12+
}
13+
}

0 commit comments

Comments
 (0)