Built and linked nlohmann::json package
This commit is contained in:
+2
-2
File diff suppressed because one or more lines are too long
@@ -32,6 +32,10 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
path "src/main/cpp/CMakeLists.txt"
|
path "src/main/cpp/CMakeLists.txt"
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.example.mear">
|
package="com.example.mear">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
@@ -11,6 +9,16 @@
|
|||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
|
<activity
|
||||||
|
android:name=".activities.DemoStreamActivity"
|
||||||
|
android:label="@string/title_activity_demo_stream"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SongViewActivity"
|
android:name=".activities.SongViewActivity"
|
||||||
android:label="@string/title_activity_song_view"
|
android:label="@string/title_activity_song_view"
|
||||||
@@ -45,4 +53,6 @@
|
|||||||
<service android:name=".playback.service.MusicService" />
|
<service android:name=".playback.service.MusicService" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
+1
Submodule app/src/main/cpp/3rdparty/json added at 99d7518d21
@@ -15,6 +15,11 @@ set (HEADERS
|
|||||||
model/Song.h
|
model/Song.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(JSON_BuildTests OFF CACHE INTERNAL "")
|
||||||
|
|
||||||
|
|
||||||
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/json)
|
||||||
|
|
||||||
|
|
||||||
add_library( # Sets the name of the library.
|
add_library( # Sets the name of the library.
|
||||||
native-lib
|
native-lib
|
||||||
@@ -47,7 +52,9 @@ find_library( # Sets the name of the path variable.
|
|||||||
|
|
||||||
target_link_libraries( # Specifies the target library.
|
target_link_libraries( # Specifies the target library.
|
||||||
native-lib
|
native-lib
|
||||||
|
PRIVATE nlohmann_json::nlohmann_json
|
||||||
|
|
||||||
# Links the target library to the log library
|
# Links the target library to the log library
|
||||||
# included in the NDK.
|
# included in the NDK.
|
||||||
${log-lib} )
|
${log-lib}
|
||||||
|
)
|
||||||
@@ -15,17 +15,50 @@
|
|||||||
#include <android/sharedmem.h>
|
#include <android/sharedmem.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
|
#include "nlohmann/json.hpp"
|
||||||
|
|
||||||
#include "model/Song.h"
|
#include "model/Song.h"
|
||||||
|
|
||||||
int demoCall()
|
model::Song initSong();
|
||||||
|
|
||||||
|
int demoCall();
|
||||||
|
|
||||||
|
void printSong(const model::Song&);
|
||||||
|
|
||||||
|
|
||||||
|
model::Song initSong()
|
||||||
{
|
{
|
||||||
model::Song song;
|
model::Song song;
|
||||||
song.title = "hello";
|
song.title = "hello";
|
||||||
song.artist = "some artist";
|
song.artist = "some artist";
|
||||||
|
|
||||||
|
|
||||||
|
return song;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int demoCall()
|
||||||
|
{
|
||||||
|
model::Song song = initSong();
|
||||||
|
|
||||||
std::cout << "testing" << std::endl;
|
std::cout << "testing" << std::endl;
|
||||||
|
printSong(song);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void printSong(const model::Song& song)
|
||||||
|
{
|
||||||
|
std::cout << "\nsong information" << std::endl;
|
||||||
|
std::cout << "title: " << song.title << std::endl;
|
||||||
|
std::cout << "artist: " << song.artist << std::endl;
|
||||||
|
std::cout << "album: " << song.album << std::endl;
|
||||||
|
std::cout << "genre: " << song.genre << std::endl;
|
||||||
|
std::cout << "year: " << song.year << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
JNIEXPORT void
|
JNIEXPORT void
|
||||||
JNICALL
|
JNICALL
|
||||||
@@ -34,4 +67,14 @@ Java_com_example_mear_activities_MainActivity_test(
|
|||||||
jobject /* this */) {
|
jobject /* this */) {
|
||||||
|
|
||||||
demoCall();
|
demoCall();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT void
|
||||||
|
JNICALL
|
||||||
|
Java_com_example_mear_activities_DemoStreamActivity_test(
|
||||||
|
JNIEnv *env,
|
||||||
|
jobject /* this */) {
|
||||||
|
|
||||||
|
demoCall();
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.example.mear.activities
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.support.design.widget.Snackbar
|
||||||
|
import android.support.v7.app.AppCompatActivity
|
||||||
|
import com.example.mear.R
|
||||||
|
|
||||||
|
import kotlinx.android.synthetic.main.activity_demo_stream.*
|
||||||
|
import kotlinx.android.synthetic.main.content_demo_stream.*
|
||||||
|
|
||||||
|
class DemoStreamActivity : AppCompatActivity() {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
init {
|
||||||
|
System.loadLibrary("native-lib")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
external fun test();
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(R.layout.activity_demo_stream)
|
||||||
|
setSupportActionBar(toolbar)
|
||||||
|
|
||||||
|
demoStream.setOnClickListener {
|
||||||
|
test()
|
||||||
|
}
|
||||||
|
|
||||||
|
fab.setOnClickListener {view ->
|
||||||
|
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||||
|
.setAction("Action", null).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".activities.DemoStreamActivity">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
app:srcCompat="@android:drawable/ic_dialog_email" />
|
||||||
|
|
||||||
|
<include layout="@layout/content_demo_stream" />
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:context=".activities.DemoStreamActivity"
|
||||||
|
tools:showIn="@layout/activity_demo_stream">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demoStream"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="140dp"
|
||||||
|
android:text="Stream"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0.499" />
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
@@ -56,64 +56,22 @@
|
|||||||
<string name="pref_default_display_name">John Smith</string>
|
<string name="pref_default_display_name">John Smith</string>
|
||||||
|
|
||||||
<string name="pref_title_add_friends_to_messages">Add friends to messages</string>
|
<string name="pref_title_add_friends_to_messages">Add friends to messages</string>
|
||||||
<string-array name="pref_example_list_titles">
|
<string name="pref_header_data_sync">Data & sync</string>
|
||||||
<item>Always</item>
|
<string name="pref_title_sync_frequency">Sync frequency</string>
|
||||||
<item>When possible</item>
|
|
||||||
<item>Never</item>
|
|
||||||
</string-array>
|
|
||||||
<string-array name="pref_example_list_values">
|
|
||||||
<item>1</item>
|
|
||||||
<item>0</item>
|
|
||||||
<item>-1</item>
|
|
||||||
</string-array>
|
|
||||||
|
|
||||||
<!-- Example settings for Data & Sync -->
|
<!-- Example settings for Data & Sync -->
|
||||||
<string name="pref_header_data_sync">Data & sync</string>
|
|
||||||
|
|
||||||
<string name="pref_title_sync_frequency">Sync frequency</string>
|
|
||||||
<string-array name="pref_sync_frequency_titles">
|
|
||||||
<item>15 minutes</item>
|
|
||||||
<item>30 minutes</item>
|
|
||||||
<item>1 hour</item>
|
|
||||||
<item>3 hours</item>
|
|
||||||
<item>6 hours</item>
|
|
||||||
<item>Never</item>
|
|
||||||
</string-array>
|
|
||||||
<string-array name="pref_sync_frequency_values">
|
|
||||||
<item>15</item>
|
|
||||||
<item>30</item>
|
|
||||||
<item>60</item>
|
|
||||||
<item>180</item>
|
|
||||||
<item>360</item>
|
|
||||||
<item>-1</item>
|
|
||||||
</string-array>
|
|
||||||
|
|
||||||
<string-array name="list_preference_entries">
|
|
||||||
<item>Entry 1</item>
|
|
||||||
<item>Entry 2</item>
|
|
||||||
<item>Entry 3</item>
|
|
||||||
</string-array>
|
|
||||||
|
|
||||||
<string-array name="list_preference_entry_values">
|
|
||||||
<item>1</item>
|
|
||||||
<item>2</item>
|
|
||||||
<item>3</item>
|
|
||||||
</string-array>
|
|
||||||
|
|
||||||
<string-array name="multi_select_list_preference_default_value" />
|
|
||||||
|
|
||||||
<string name="pref_title_system_sync_settings">System sync settings</string>
|
<string name="pref_title_system_sync_settings">System sync settings</string>
|
||||||
|
|
||||||
<!-- Example settings for Notifications -->
|
|
||||||
<string name="pref_header_notifications">Notifications</string>
|
<string name="pref_header_notifications">Notifications</string>
|
||||||
|
|
||||||
<string name="pref_title_new_message_notifications">New message notifications</string>
|
<string name="pref_title_new_message_notifications">New message notifications</string>
|
||||||
|
|
||||||
<string name="pref_title_ringtone">Ringtone</string>
|
<string name="pref_title_ringtone">Ringtone</string>
|
||||||
|
|
||||||
<string name="pref_ringtone_silent">Silent</string>
|
<string name="pref_ringtone_silent">Silent</string>
|
||||||
|
|
||||||
<string name="pref_title_vibrate">Vibrate</string>
|
<string name="pref_title_vibrate">Vibrate</string>
|
||||||
|
|
||||||
<string name="title_activity_song_view">SongViewActivity</string>
|
<string name="title_activity_song_view">SongViewActivity</string>
|
||||||
|
|
||||||
<string name="large_text">
|
<string name="large_text">
|
||||||
"Material is the metaphor.\n\n"
|
"Material is the metaphor.\n\n"
|
||||||
|
|
||||||
@@ -203,4 +161,47 @@
|
|||||||
"For example, position the FAB to one side of stream of a cards so the FAB won’t interfere "
|
"For example, position the FAB to one side of stream of a cards so the FAB won’t interfere "
|
||||||
"when a user tries to pick up one of cards.\n\n"
|
"when a user tries to pick up one of cards.\n\n"
|
||||||
</string>
|
</string>
|
||||||
|
|
||||||
|
<!-- Example settings for Notifications -->
|
||||||
|
<string name="title_activity_demo_stream">DemoStreamActivity</string>
|
||||||
|
|
||||||
|
<string-array name="pref_example_list_titles">
|
||||||
|
<item>Always</item>
|
||||||
|
<item>When possible</item>
|
||||||
|
<item>Never</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="pref_example_list_values">
|
||||||
|
<item>1</item>
|
||||||
|
<item>0</item>
|
||||||
|
<item>-1</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="pref_sync_frequency_titles">
|
||||||
|
<item>15 minutes</item>
|
||||||
|
<item>30 minutes</item>
|
||||||
|
<item>1 hour</item>
|
||||||
|
<item>3 hours</item>
|
||||||
|
<item>6 hours</item>
|
||||||
|
<item>Never</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="pref_sync_frequency_values">
|
||||||
|
<item>15</item>
|
||||||
|
<item>30</item>
|
||||||
|
<item>60</item>
|
||||||
|
<item>180</item>
|
||||||
|
<item>360</item>
|
||||||
|
<item>-1</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="list_preference_entries">
|
||||||
|
<item>Entry 1</item>
|
||||||
|
<item>Entry 2</item>
|
||||||
|
<item>Entry 3</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="list_preference_entry_values">
|
||||||
|
<item>1</item>
|
||||||
|
<item>2</item>
|
||||||
|
<item>3</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="multi_select_list_preference_default_value" />
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -8,8 +8,10 @@
|
|||||||
<item name="colorAccent">@color/colorAccent</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
|
|
||||||
<item name="android:popupMenuStyle">@style/PopupMenu</item>
|
<item name="android:popupMenuStyle">@style/PopupMenu</item>
|
||||||
<item name="android:textAppearanceSmallPopupMenu">@style/myPopupMenuTextAppearanceSmall</item>
|
<item name="android:textAppearanceSmallPopupMenu">@style/myPopupMenuTextAppearanceSmall
|
||||||
<item name="android:textAppearanceLargePopupMenu">@style/myPopupMenuTextAppearanceLarge</item>
|
</item>
|
||||||
|
<item name="android:textAppearanceLargePopupMenu">@style/myPopupMenuTextAppearanceLarge
|
||||||
|
</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="PopupMenu" parent="@android:style/Widget.PopupMenu">
|
<style name="PopupMenu" parent="@android:style/Widget.PopupMenu">
|
||||||
|
|||||||
Reference in New Issue
Block a user