Skip to content

Instantly share code, notes, and snippets.

View mjonesjr90's full-sized avatar

Malcom mjonesjr90

View GitHub Profile

Privacy Policy

Your privacy is important to us. It is Malcom Jones' policy to respect your privacy regarding any information we may collect from you across our website, http://triviumapp.com, and other sites we own and operate.

We only ask for personal information when we truly need it to provide a service to you. We collect it by fair and lawful means, with your knowledge and consent. We also let you know why we’re collecting it and how it will be used.

We only retain collected information for as long as necessary to provide you with your requested service. What data we store, we’ll protect within commercially acceptable means to prevent loss and theft, as well as unauthorised access, disclosure, copying, use or modification.

We don’t share any personally identifying information publicly or with third-parties, except when required to by law.

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, Image, Button} from 'react-native';
import ToastModule from 'react-native-toast-library';
import RNAdCall from 'react-native-ad-call';
type Props = {};
var pic = {uri: 'https://developer.android.com/images/brand/Android_Robot_200.png'};
var osName = 'Android';
class OS extends Component {
render() {
import com.millennialmedia.MMException;
import com.millennialmedia.MMSDK;
import com.millennialmedia.AppInfo;
...
private static final String SITE_ID = "[YOUR_SITE_ID]";
...
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Arrays.<NativeModule>asList(new RNAdCallModule(reactContext));
}
@ReactMethod
public void callBannerActivity(){
Intent intent = new Intent(reactContext, BannerActivity.class);
reactContext.startActivity(intent);
}
package com.reactlibrary;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
@mjonesjr90
mjonesjr90 / ReactNativeIssues.md
Last active September 12, 2018 20:20
Documenting small issues I run into while tinkering with React Native

ISSUE

Modifying my native module (Android code) I would see the following error when trying to compile my app

Execution failed for task ':react-native-[package-name]:compileReleaseJavaWithJavac'. 
Unable to find source java class […] because it does not belong to any of the source dirs: […]

FIX

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, Image, Button} from 'react-native';
import ToastModule from 'react-native-toast-library';
type Props = {};
var pic = {uri: 'https://developer.android.com/images/brand/Android_Robot_200.png'};
var osName = 'Android';
class OS extends Component {
render() {
return (
import com.reactlibrary.ToastPackage;
//...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new ToastPackage()
);