This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private const val CACHE_TTL_SECONDS: Short = 30 * 60 | |
private const val INET_BROADCAST_INTERVAL_SECONDS: Short = 30 * 60 | |
class Dscp( | |
private val inetServer: InetServer, | |
private val addressProvider: AddressProvider, | |
private val bleAdvertiser: BleAdvertiser, | |
private val bleScanner: BleScanner, | |
private val inetBroadcaster: InetBroadcaster, | |
private val timer: Timer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.os.Bundle | |
import android.os.Handler | |
import android.support.v7.app.AppCompatActivity | |
class SplashActivity: AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_splash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- The android:opacity=”opaque” line — this is critical in preventing a flash of black as your theme transitions. --> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque"> | |
<!-- The background color, preferably the same as your normal theme --> | |
<item android:drawable="@android:color/white"/> | |
<!-- Your product logo - 144dp color version of your app icon --> | |
<item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mobymagic.opencvproject; | |
import java.util.List; | |
import org.opencv.android.BaseLoaderCallback; | |
import org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame; | |
import org.opencv.android.LoaderCallbackInterface; | |
import org.opencv.android.OpenCVLoader; | |
import org.opencv.core.Core; | |
import org.opencv.core.CvType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mobymagic.opencvproject; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
import org.opencv.core.Core; | |
import org.opencv.core.CvType; | |
import org.opencv.core.Mat; | |
import org.opencv.core.MatOfPoint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-permission android:name="android.permission.CAMERA"/> | |
<uses-feature android:name="android.hardware.camera" android:required="false"/> | |
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> | |
<uses-feature android:name="android.hardware.camera.front" android:required="false"/> | |
<uses-feature android:name="android.hardware.camera.front.autofocus" android:required="false"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" > | |
<org.opencv.android.JavaCameraView | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:id="@+id/color_blob_detection_activity_surface_view" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- Your AppTheme or other themes/styles here --> | |
<!-- The launcher theme. It sets the main window background to the launch_screen drawable --> | |
<style name=”AppTheme.Launcher”> | |
<item name=”android:windowBackground”>@drawable/launch_screen</item> | |
<!-- Optional, on Android 5+ you can modify the colorPrimaryDark color to match the windowBackground color for further branding--> | |
<!-- <item name="colorPrimaryDark">@android:color/white</item> --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mobymagic.veryquicknewsaggregator | |
import android.support.v4.app.Fragment | |
import android.support.v7.widget.DividerItemDecoration | |
import android.support.v7.widget.LinearLayoutManager | |
import android.support.v7.widget.RecyclerView | |
import android.view.LayoutInflater | |
import android.view.ViewGroup | |
import com.google.firebase.database.DatabaseError | |
import com.google.firebase.database.FirebaseDatabase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<List> getCurrencies() async { | |
String apiUrl = 'https://api.coinmarketcap.com/v1/ticker/?limit=50'; | |
// Make a HTTP GET request to the CoinMarketCap API. | |
// Await basically pauses execution until the get() function returns a Response | |
http.Response response = await http.get(apiUrl); | |
// Using the JSON class to decode the JSON String | |
return JSON.decode(response.body); | |
} |