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
apply plugin: 'jacoco' | |
apply from: "../reports/jacoco/jacoco-report-exclusions.gradle" | |
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) { | |
group = "Reporting" | |
description = "Generate Jacoco coverage reports after running tests." | |
getClassDirectories().from(fileTree( | |
dir: "$buildDir/tmp/kotlin-classes/debug", | |
excludes: jacocoExclusions)) |
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
apply plugin: 'org.sonarqube' | |
apply from : "../reports/jacoco/jacoco-report-exclusions.gradle" | |
sonar { | |
properties { | |
property "sonar.projectKey", "App-Android" | |
property "sonar.sourceEncoding", "UTF-8" | |
property "sonar.projectName", "yourAppName" | |
property "sonar.java.coveragePlugin", "jacoco" | |
property "sonar.sources", "${project.projectDir}/src/main/java" |
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
class CustomBroadcastReceiver: BroadcastReceiver() { | |
override fun onReceive(context: Context, intent: Intent) { | |
// All the logic we want to execute when the app receive the event/intent. | |
} | |
} |
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
<manifest ... > | |
... | |
<application ... > | |
<service android:name=".ExampleService" /> | |
... | |
</application> | |
</manifest> |
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
<receiver android:name=".MyBroadcastReceiver" android:exported="true"> | |
<intent-filter> | |
<action android:name="android.intent.action.BOOT_COMPLETED"/> | |
</intent-filter> | |
</receiver> |
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
class SampleViewModel : LifecycleObserver { | |
… | |
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME) | |
fun initializeCamera() { | |
if (camera == null) { | |
getCamera() | |
} | |
} | |
… | |
} |
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
override fun onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState) | |
// creating LinearLayout | |
val linLayout: LinearLayout = LinearLayout(this) | |
// specifying vertical orientation | |
linLayout.setOrientation(LinearLayout.VERTICAL) | |
// creating LayoutParams | |
val linLayoutParam: LayoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); | |
// set LinearLayout as a root element of the screen | |
setContentView(linLayout, linLayoutParam); |
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 './App.css' | |
import SectionItem from './components/section-item/sectionItem' | |
import { useTranslation } from 'react-i18next' | |
import React from 'react' | |
export default function App () { | |
const { t } = useTranslation() | |
var section = t('section', { returnObjects: true }) // Return the array from my local JSON file |
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 ReactDOM from 'react-dom' | |
import './index.css' | |
import App from './App' | |
import reportWebVitals from './reportWebVitals' | |
import i18n from './i18n' | |
import { I18nextProvider } from 'react-i18next' | |
import React, { Suspense } from 'react' | |
ReactDOM.render( | |
<React.StrictMode> |
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
{ | |
"title": "title", | |
"section": [ | |
{ | |
"title": "Some title", | |
"subtitle": "Some subtitle", | |
"description": "Some description" | |
}, | |
{ | |
"title": "Some title 1", |
NewerOlder