View java2jar.bat
:: This script compiles java files from
:: java folder and puts class files into
:: classes folder which are then compiled
:: into a jar file in build folder.
@echo off
title Java2Jar
echo Compiling java files...
md classes
View forloop.bat
setlocal EnableDelayedExpansion
echo Searching for java files...
set JAVA_FILES=
for %%i in (java\*.java) do set JAVA_FILES=!JAVA_FILES! %%i && echo %%i
echo Found Java Files:%JAVA_FILES%
View forloop.bat
setlocal EnableDelayedExpansion
echo Searching for java files...
set JAVA_FILES=
for %%i in (java\*.java) do set JAVA_FILES=!JAVA_FILES! %%i && echo %%i
echo Found Java Files:%JAVA_FILES%
View Android.java
public String getParentPackageName() {
PackageManager pm = context.getPackageManager();
String packageName = context.getApplicationContext().getPackageName();
PackageInfo pi;
try {
pi = pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
View Blockly.js
// Get workspace
var ws = Blockly.getMainWorkspace();
// Access yail generator
var yail = Blockly.Yail
// Access REPL
var repl = Blockly.ReplMgr
// Get all blocks
View jartf.bat
@echo off
for %%f in (*.jar) do echo %%f && jar tf %%f > %%f.txt
View aar2jar.py
import zipfile, os
cd = os.getcwd()
for file in os.listdir(cd):
if file.endswith(".aar"):
print("Got aar: " + file)
with zipfile.ZipFile(cd + "\\" + file) as aar:
aar.extract("classes.jar", cd)
print("Extracted aar")
os.rename("classes.jar", os.path.splitext(file)[0] + ".jar")
View SimpleMaths.java
package com.makeroid; //package of the extension will be "com.makeroid.SimpleMaths"
//Only these imports are required to interact with Makeroid
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.runtime.*;
import com.google.appinventor.components.common.*;
import android.content.Context;
@DesignerComponent(
View FAB.java
FloatingActionButton fab = new FloatingActionButton(context);
fab.setId(View.generateViewId());
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d("DEBUG", "onFabFoo");
}});
fab.setImageResource(R.drawable.btn_plus);
fab.setElevation(2);
fab.setSize(FloatingActionButton.SIZE_MINI);
View AdSense2Slack.gs
function doGet() {
getAdReports();
}
function getAdReports() {
var start = "today-6d"; //one week ago
var end = "today";
var clients = AdSense.Adclients.list().getItems();