Skip to content

Commit 8e7d9cf

Browse files
committed
Implementing ANT Lite version
* Skeleton of ANT Companion Lite version * HTTP Server of ANT for IoT.js
1 parent 518819b commit 8e7d9cf

Some content is hidden

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

47 files changed

+1148
-28
lines changed

android-companion/.gitignore

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Built application files
2+
build
3+
4+
# Crashlytics configuations
5+
com_crashlytics_export_strings.xml
6+
7+
# Local configuration file (sdk path, etc)
8+
9+
# Gradle generated files
10+
.gradle/*
11+
gradle
12+
gradlew
13+
14+
15+
# Signing files
16+
.signing/
17+
18+
# OS-specific files
19+
.DS_Store
20+
.DS_Store?
21+
._*
22+
.Spotlight-V100
23+
.Trashes
24+
ehthumbs.db
25+
26+
#built application files
27+
28+
29+
*.ap_
30+
# files for the dex VM
31+
32+
*.dex
33+
34+
35+
36+
# Java class files
37+
38+
*.class
39+
40+
41+
42+
# generated files
43+
44+
bin/
45+
46+
gen/
47+
48+
49+
50+
# Local configuration file (sdk path, etc)
51+
52+
local.properties
53+
54+
55+
56+
# Windows thumbnail db
57+
58+
Thumbs.db
59+
60+
61+
62+
# Eclipse project files
63+
64+
.classpath
65+
66+
.project
67+
68+
69+
70+
# Android Studio
71+
72+
*.iml
73+
74+
.idea/
75+
.idea/workspace.xml remove # and delete .idea if it better suit your needs.
76+
77+
jni/assets/
78+
jni/gst-build-armeabi/
79+
jni/src/
80+
obj/

android-companion/app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

android-companion/app/build.gradle

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 28
5+
defaultConfig {
6+
applicationId "skku.eslab.ant.companion"
7+
minSdkVersion 24
8+
targetSdkVersion 28
9+
versionCode 1
10+
versionName "1.0"
11+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
12+
}
13+
buildTypes {
14+
release {
15+
minifyEnabled false
16+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
17+
}
18+
}
19+
}
20+
21+
dependencies {
22+
implementation fileTree(dir: 'libs', include: ['*.jar'])
23+
implementation 'androidx.appcompat:appcompat:1.0.2'
24+
implementation 'com.google.android.material:material:1.0.0'
25+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
26+
implementation 'androidx.navigation:navigation-fragment:2.0.0'
27+
implementation 'androidx.navigation:navigation-ui:2.0.0'
28+
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
29+
testImplementation 'junit:junit:4.12'
30+
androidTestImplementation 'androidx.test:runner:1.1.1'
31+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
32+
}
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package skku.eslab.ant.companion;
2+
3+
import android.content.Context;
4+
5+
import androidx.test.platform.app.InstrumentationRegistry;
6+
import androidx.test.ext.junit.runners.AndroidJUnit4;
7+
8+
import org.junit.Test;
9+
import org.junit.runner.RunWith;
10+
11+
import static org.junit.Assert.*;
12+
13+
/**
14+
* Instrumented test, which will execute on an Android device.
15+
*
16+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17+
*/
18+
@RunWith(AndroidJUnit4.class)
19+
public class ExampleInstrumentedTest {
20+
@Test
21+
public void useAppContext() {
22+
// Context of the app under test.
23+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24+
25+
assertEquals("skku.eslab.ant.companion", appContext.getPackageName());
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="skku.eslab.ant.companion">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<activity
13+
android:name=".MainActivity"
14+
android:label="@string/app_name">
15+
<intent-filter>
16+
<action android:name="android.intent.action.MAIN" />
17+
18+
<category android:name="android.intent.category.LAUNCHER" />
19+
</intent-filter>
20+
</activity>
21+
</application>
22+
23+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package skku.eslab.ant.companion;
2+
3+
import android.os.Bundle;
4+
5+
import com.google.android.material.bottomnavigation.BottomNavigationView;
6+
7+
import androidx.appcompat.app.AppCompatActivity;
8+
import androidx.navigation.NavController;
9+
import androidx.navigation.Navigation;
10+
import androidx.navigation.ui.AppBarConfiguration;
11+
import androidx.navigation.ui.NavigationUI;
12+
13+
public class MainActivity extends AppCompatActivity {
14+
15+
@Override
16+
protected void onCreate(Bundle savedInstanceState) {
17+
super.onCreate(savedInstanceState);
18+
setContentView(R.layout.activity_main);
19+
BottomNavigationView navView = findViewById(R.id.nav_view);
20+
// Passing each menu ID as a set of Ids because each
21+
// menu should be considered as top level destinations.
22+
AppBarConfiguration appBarConfiguration =
23+
new AppBarConfiguration.Builder(R.id.navigation_home, R.id.navigation_dashboard,
24+
R.id.navigation_notifications).build();
25+
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
26+
NavigationUI.setupActionBarWithNavController(this, navController,
27+
appBarConfiguration);
28+
NavigationUI.setupWithNavController(navView, navController);
29+
30+
31+
}
32+
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package skku.eslab.ant.companion.ui.home;
2+
3+
import android.os.Bundle;
4+
import android.view.LayoutInflater;
5+
import android.view.View;
6+
import android.view.ViewGroup;
7+
8+
import androidx.annotation.NonNull;
9+
import androidx.annotation.Nullable;
10+
import androidx.fragment.app.Fragment;
11+
import androidx.lifecycle.Observer;
12+
import androidx.lifecycle.ViewModelProviders;
13+
import skku.eslab.ant.companion.R;
14+
15+
public class HomeFragment extends Fragment {
16+
17+
private HomeViewModel homeViewModel;
18+
19+
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
20+
homeViewModel = ViewModelProviders.of(this).get(HomeViewModel.class);
21+
View root = inflater.inflate(R.layout.fragment_home, container, false);
22+
homeViewModel.getText().observe(this, new Observer<String>() {
23+
@Override
24+
public void onChanged(@Nullable String s) {
25+
//
26+
}
27+
});
28+
return root;
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package skku.eslab.ant.companion.ui.home;
2+
3+
import androidx.lifecycle.LiveData;
4+
import androidx.lifecycle.MutableLiveData;
5+
import androidx.lifecycle.ViewModel;
6+
7+
public class HomeViewModel extends ViewModel {
8+
9+
private MutableLiveData<String> mText;
10+
11+
public HomeViewModel() {
12+
mText = new MutableLiveData<>();
13+
mText.setValue("This is home fragment");
14+
}
15+
16+
public LiveData<String> getText() {
17+
return mText;
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package skku.eslab.ant.companion.ui.notifications;
2+
3+
import android.os.Bundle;
4+
import android.view.LayoutInflater;
5+
import android.view.View;
6+
import android.view.ViewGroup;
7+
8+
import androidx.annotation.NonNull;
9+
import androidx.annotation.Nullable;
10+
import androidx.fragment.app.Fragment;
11+
import androidx.lifecycle.Observer;
12+
import androidx.lifecycle.ViewModelProviders;
13+
import skku.eslab.ant.companion.R;
14+
15+
public class NotificationsFragment extends Fragment {
16+
17+
private NotificationsViewModel notificationsViewModel;
18+
19+
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
20+
notificationsViewModel =
21+
ViewModelProviders.of(this).get(NotificationsViewModel.class);
22+
View root = inflater.inflate(R.layout.fragment_notifications, container,
23+
false);
24+
notificationsViewModel.getText().observe(this, new Observer<String>() {
25+
@Override
26+
public void onChanged(@Nullable String s) {
27+
//
28+
}
29+
});
30+
return root;
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package skku.eslab.ant.companion.ui.notifications;
2+
3+
import androidx.lifecycle.LiveData;
4+
import androidx.lifecycle.MutableLiveData;
5+
import androidx.lifecycle.ViewModel;
6+
7+
public class NotificationsViewModel extends ViewModel {
8+
9+
private MutableLiveData<String> mText;
10+
11+
public NotificationsViewModel() {
12+
mText = new MutableLiveData<>();
13+
mText.setValue("This is notifications fragment");
14+
}
15+
16+
public LiveData<String> getText() {
17+
return mText;
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package skku.eslab.ant.companion.ui.streaming;
2+
3+
import android.os.Bundle;
4+
import android.view.LayoutInflater;
5+
import android.view.View;
6+
import android.view.ViewGroup;
7+
8+
import androidx.annotation.NonNull;
9+
import androidx.annotation.Nullable;
10+
import androidx.fragment.app.Fragment;
11+
import androidx.lifecycle.Observer;
12+
import androidx.lifecycle.ViewModelProviders;
13+
import skku.eslab.ant.companion.R;
14+
15+
public class StreamingFragment extends Fragment {
16+
17+
private StreamingViewModel streamingViewModel;
18+
19+
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
20+
streamingViewModel =
21+
ViewModelProviders.of(this).get(StreamingViewModel.class);
22+
View root =
23+
inflater.inflate(R.layout.fragment_streaming, container, false);
24+
streamingViewModel.getText().observe(this, new Observer<String>() {
25+
@Override
26+
public void onChanged(@Nullable String s) {
27+
//
28+
}
29+
});
30+
return root;
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package skku.eslab.ant.companion.ui.streaming;
2+
3+
import androidx.lifecycle.LiveData;
4+
import androidx.lifecycle.MutableLiveData;
5+
import androidx.lifecycle.ViewModel;
6+
7+
public class StreamingViewModel extends ViewModel {
8+
9+
private MutableLiveData<String> mText;
10+
11+
public StreamingViewModel() {
12+
mText = new MutableLiveData<>();
13+
mText.setValue("This is dashboard fragment");
14+
}
15+
16+
public LiveData<String> getText() {
17+
return mText;
18+
}
19+
}

0 commit comments

Comments
 (0)