Skip to content

Commit b25c7f4

Browse files
initial commit
0 parents  commit b25c7f4

File tree

101 files changed

+22285
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+22285
-0
lines changed

.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" path="gen"/>
5+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
6+
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
7+
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
8+
<classpathentry kind="output" path="bin"/>
9+
</classpath>

.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>Connect-SDK-Android-Core</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>

AndroidManifest.xml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.connectsdk.androidcore"
3+
android:versionCode="1"
4+
android:versionName="1.0" >
5+
6+
<uses-sdk
7+
android:minSdkVersion="10"
8+
android:targetSdkVersion="10" />
9+
10+
<application
11+
/>
12+
13+
</manifest>

bin/jarlist.cache

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cache for current jar dependency. DO NOT EDIT.
2+
# format is <lastModified> <length> <SHA-1> <path>
3+
# Encoding is UTF-8

libs/android-support-v4.jar

741 KB
Binary file not shown.

project.properties

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system edit
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
#
10+
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11+
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12+
13+
# Project target.
14+
target=android-19
15+
android.library=true

res/drawable-hdpi/ic_launcher.png

9.18 KB
Loading

res/drawable-mdpi/ic_launcher.png

5.11 KB
Loading

res/drawable-xhdpi/ic_launcher.png

14 KB
Loading

res/values-v11/styles.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<resources>
2+
3+
<!--
4+
Base application theme for API 11+. This theme completely replaces
5+
AppBaseTheme from res/values/styles.xml on API 11+ devices.
6+
-->
7+
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
8+
<!-- API 11 theme customizations can go here. -->
9+
</style>
10+
11+
</resources>

res/values-v14/styles.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<resources>
2+
3+
<!--
4+
Base application theme for API 14+. This theme completely replaces
5+
AppBaseTheme from BOTH res/values/styles.xml and
6+
res/values-v11/styles.xml on API 14+ devices.
7+
-->
8+
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
9+
<!-- API 14 theme customizations can go here. -->
10+
</style>
11+
12+
</resources>

res/values/strings.xml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<resources>
2+
3+
<string name="app_name">Connect-SDK-Android-Core</string>
4+
5+
</resources>

res/values/styles.xml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<resources>
2+
3+
<!--
4+
Base application theme, dependent on API level. This theme is replaced
5+
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
6+
-->
7+
<style name="AppBaseTheme" parent="android:Theme.Light">
8+
<!--
9+
Theme customizations available in newer API levels can go in
10+
res/values-vXX/styles.xml, while customizations related to
11+
backward-compatibility can go here.
12+
-->
13+
</style>
14+
15+
<!-- Application theme. -->
16+
<style name="AppTheme" parent="AppBaseTheme">
17+
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
18+
</style>
19+
20+
</resources>

src/com/connectsdk/core/AppInfo.java

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
/*
2+
* AppInfo
3+
* Connect SDK
4+
*
5+
* Copyright (c) 2014 LG Electronics.
6+
* Created by Hyun Kook Khang on 19 Jan 2014
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
21+
package com.connectsdk.core;
22+
23+
import org.json.JSONException;
24+
import org.json.JSONObject;
25+
26+
/**
27+
* Normalized reference object for information about a DeviceService's app. This
28+
* object will, in most cases, be used to launch apps.
29+
*
30+
* In some cases, all that is needed to launch an app is the app id.
31+
*/
32+
public class AppInfo implements JSONSerializable {
33+
// @cond INTERNAL
34+
String id;
35+
String name;
36+
JSONObject raw;
37+
38+
// @endcond
39+
40+
/**
41+
* Default constructor method.
42+
*/
43+
public AppInfo() {
44+
}
45+
46+
/**
47+
* Default constructor method.
48+
*
49+
* @param id
50+
* App id to launch
51+
*/
52+
public AppInfo(String id) {
53+
this.id = id;
54+
}
55+
56+
/**
57+
* Gets the ID of the app on the first screen device. Format is different
58+
* depending on the platform. (ex. youtube.leanback.v4, 0000001134, netflix,
59+
* etc).
60+
*/
61+
public String getId() {
62+
return id;
63+
}
64+
65+
/**
66+
* Sets the ID of the app on the first screen device. Format is different
67+
* depending on the platform. (ex. youtube.leanback.v4, 0000001134, netflix,
68+
* etc).
69+
*/
70+
public void setId(String id) {
71+
this.id = id;
72+
}
73+
74+
/**
75+
* Gets the user-friendly name of the app (ex. YouTube, Browser, Netflix,
76+
* etc).
77+
*/
78+
public String getName() {
79+
return name;
80+
}
81+
82+
/**
83+
* Sets the user-friendly name of the app (ex. YouTube, Browser, Netflix,
84+
* etc).
85+
*/
86+
public void setName(String name) {
87+
this.name = name.trim();
88+
}
89+
90+
/** Gets the raw data from the first screen device about the app. */
91+
public JSONObject getRawData() {
92+
return raw;
93+
}
94+
95+
/** Sets the raw data from the first screen device about the app. */
96+
public void setRawData(JSONObject data) {
97+
raw = data;
98+
}
99+
100+
// @cond INTERNAL
101+
@Override
102+
public JSONObject toJSONObject() throws JSONException {
103+
JSONObject obj = new JSONObject();
104+
105+
obj.put("name", name);
106+
obj.put("id", id);
107+
108+
return obj;
109+
}
110+
111+
// @endcond
112+
113+
/**
114+
* Compares two AppInfo objects.
115+
*
116+
* @param o
117+
* Other AppInfo object to compare.
118+
*
119+
* @return true if both AppInfo id values are equal
120+
*/
121+
@Override
122+
public boolean equals(Object o) {
123+
if (o instanceof AppInfo) {
124+
AppInfo ai = (AppInfo) o;
125+
return this.id.equals(ai.id);
126+
}
127+
return super.equals(o);
128+
}
129+
}

0 commit comments

Comments
 (0)