Exsent-Project: Create your own functions

Your idea

Step 1: Create the basics

Step 2: Setup

build.gradle(Project)
build.gradle(app)

Step 3: Environment

Understanding the Cloud environment

  • Source.jar
  • Contents.zip
  • Focus.zip
{ 
"n": "FunctionABX",
"s": "Short subtitle",
"a": "Author",
"i": "Some info",
"v": "version",
"ic": "init_class_package.init_class_name",
"b": isBeta,
"o":"download url of the Contents.zip file see above!",
"su":"download url of the Source.jar file see above!",
"u":"download url of the Focus.zip file see above!",
"d": "your website",
"c": category_int,
"l": "languages_as_list",
"x": number_of_files_in_focus_zip}
  • “n”: Her stands your Function Name, it should by unique!
  • “s”: This is a short subtitle, example: “A powerful machine” or “Best game ever”
  • “a”: The name of the author/dev of the function
  • “i”: Information about the function. What are the main features? What does it do?
  • “v”: The version of the function
  • “ic”: The file path of the main function class. Example: com.myfunction.va.MyFunction (without .class at the end)
  • “b”: Is this a beta version?
  • “o”: The download link of your Contents.zip file, should be public and should be fast
  • “su”: The download link of your Source.jar file, should be public and should be fast
  • “u”: The download link of your Focus.zip file, should be public and should be fast
  • “d”: Your company website, if you don’t have any, type: “”
  • “c”: The category tag. This enum shows the int parameter matching each category name:
public enum Category {

Books(0),
Business(1),
Developer_Tools(2),
Education(3),
Entertainment(4),
Finance(5),
Food_and_Drink(6),
Games(7),
Graphics_and_Design(8),
Health_and_Fitness(9),
Lifestyle(10),
Magazines_and_Newspapers(11),
Medical(12),
Music(13),
Navigation(14),
News(15),
Photo_and_Video(16),
Productivity(17),
Reference(18),
Shopping(19),
Social_Networking(20),
Sports(21),
Travel(22),
Utilities(23),
Weather(24);
}
  • “l”: Language int tags as list. Here is a file of each language tag: https://gist.github.com/ValentinAhrend/71d4afbdc58715dd48d3eaa632d48627 Please use the line number as int value. As an example: If you want to say that your languages are “German,English,French”. You search for the value and type down the line number. The result is “87,110,248”.
  • “x”: Put here the number of files in Focus.zip. The minimum amount is 1, because you need to put there a higher resolution picture of your function image (like an app icon). The other files are images in that are sized like the default android phone size. These files should be in-function-images.

Code Environment

FunctionHandler1.loaded_classes.put("Name of your function",MyFunction.class);SecureFile.SecureFileSave.setSecureFile(new SecureFile());

Intent opener = new Intent(getApplicationContext(), Function.class);
opener.putExtra("function_id", id_of_your_function);
opener.putExtra("function_version", version_of_your_function);
opener.putExtra("function_beta", true);
opener.putExtra("function_name", "Name of your function");
opener.putExtra("function_author", "Name of the dev");

startActivity(opener);

Step 4: Create the function

public class MyFunction extends Function {



public MyFunction(Function f){super(f);}


}
  • Build an onCreate method and setup a contentView:
@Override
public void onCreate(Bundle var0) {
function.onCreate(var0);//use function

View contentView = new View(function);/*function also used as context*/
contentView.setBackgroundColor(Color.RED);

function.setContentView(contentView);

}
  • Create a file
public void createFile() throws IOException {
final File f = new File(function.getFilesDir()+"/MyFile.txt");
function.writeFile(f, "this is my cool file!");
}
  • Read file
public String readFile(){
final File f = new File(function.getFilesDir()+"/MyFile.txt");
return Function.Utils.readFile(f);
}

Step 5: Finish

Building Source.jar:

  • Build your project
  • go to build/intermediates/javac/debug/classes
  • reveal the dir in finder/explorer
  • Compress all these .class files to a .zip file.
  • Merge other .class files (if you need to), maybe from implementations
  • Merge your assets folder into this .zip file.
  • Rename the ending from .zip to .jar.
  • Finish: Source.jar

Building Contents.zip:

Building Focus.zip:

  • There must be an image called FunctionName.jpg/.png. This image is used as better function icon. (should be a square).
  • There can be a few other photos (sized like android default size), that show how your function looks like, or what it does or anything you want. You can compare it to the icons from Apple AppStore.
  • Merge all photos together to a .zip file.
  • Finish: Focus.zip

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

6 smells telling you your software development project is doomed to fail

Implementing Messaging Fanout Exchange for micro-services using AWS Serverless — SNS & SQS

FIFTY SHADES OF SCRUM / SHADE 3

Camera Recogniser with CoreML Model

GitHub service outages continue, no official word on why

A Django Blog In VS Code — Bootstrap, Tailwind CSS, Template Inheritance

Guide to Data Validation with Scala and Cats

3 Benefits Of Having A Forex Rates API At Your Service

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Valentin Ahrend

Valentin Ahrend

Developing

More from Medium

How To Configure and Deploy WebApps with Wildfly Application Server in IntelliJ IDEA

import Json dependency in JAVA

Singleton Design with Multithreading in C++

Install/Manage Multiple JAVA versions — MacOS BigSur