View actual code made

Thiscord

New member
Let me start off by saying I absolutely love MacroDroid. It's really mind-blowing when you think about all of the doors this opens for easily building your ideas. Ive used it for about a month or two now and I thoroughly enjoy it. Here's my question and I'm not sure if you can already do this or not? I want to be able to see the actual code created for a finished macro so I can learn how my projects are actually making everything happen. I think this is JavaScript but not sure. And is there a way I can work on my laptop in a code editor then download the final macro to macrodroid? If there's not or there is, either way, you've created something very special and thanks for putting it out there.
 

Endercraft

Moderator (& bug finder :D)
Thiscord said:
Let me start off by saying I absolutely love MacroDroid. It's really mind-blowing when you think about all of the doors this opens for easily building your ideas. Ive used it for about a month or two now and I thoroughly enjoy it. Here's my question and I'm not sure if you can already do this or not? I want to be able to see the actual code created for a finished macro so I can learn how my projects are actually making everything happen. I think this is JavaScript but not sure. And is there a way I can work on my laptop in a code editor then download the final macro to macrodroid? If there's not or there is, either way, you've created something very special and thanks for putting it out there.
Export the macro and open it in text.
It’s in JSON.
 
Last edited:

Thiscord

New member
Export the macro and open it in text.
It’s in JSON.
Yes, was checking that out. But, I mean the scripting that is taking that Json and saying hey, I need to send 'xxxx' command, intent, etc. I spent 6 days trying to figure out how to send an intent so thought this would be awesome to be able to see how these things are actually being done. I'm very familiar with Jason so love that part of the equation for sure.
 

Thiscord

New member
I search the templates and forum daily to learn. There are a lot of things I am unable to find answers for though
 

OscariBot

Active member
Let's not forget the real intention of macrodroid... To help with eazy android automation. Anything more like what you are asking for is beyond the real intended use of macrodroid. It's my opinion anyway.... i think @MacroDroidDev will have something better to say.

I use JSON to view, edit and configure huge macro and then export it to macrodroid.
 

Thiscord

New member
Agreed. I guess my real interest for posting this, initially derives from trying to use intents. I have been fairly unsuccessful with setting these up in macrodroid due to having no experience with them. I am guessing the most solid strategy when creating a new macro, would be to focus on using intents as much as possible. Can anyone point me in the right path to kickstart me in being able to implement these in macrodroid? I've been using a dev app from play store to view my installed apps details. Class, actions, etc. I also have been using shortcut maker where you can set them up that way as well. The main intent I've tried to make work so far are things like add a new phone contact, modify contact field, and these are probably really easy for someone familiar with Android. I come from a stong skill set of Python programming but this is like learning new language and starting over 😂
 
Last edited:

FrameXX

Well-known member
I think MacroDroid is written in Java so it uses Java to perform actual actions in Android enviroment. MacroDroid doesn't use JavaScript for sure. I doubt there is any way you could see how actions actually work, without Jamie releasing parts of source code for these actions.

The macro JSON file just contains all needed informations and data about the macro, but won't tell you much about how actions are executed within Android enviroment.
 
Last edited:

Thiscord

New member
I think MacroDroid is written in Java so it uses Java to perform actual actions in Android enviroment. MacroDroid doesn't use JavaScript for sure. I doubt there is any way you could see how actions actually work, without Jamie releasing parts of source code for these actions.

The macro JSON file just contains all needed informations and data about the macro, but won't tell you much about how actions are executed within Android enviroment.
Yes, actually went down that google wormhole yesterday learning basic java scripts lol. I am well versed in Python but that's not helping me on Android much. Literally starting over and learning from scratch. Totally understandable not to release source details. Someone pointed me in the right direction. I think it was Jamie. Reading up on intents and how to use them properly. Learning these few languages and those intents in conjunction with Macrodroid is really all I am seeking. Love MacroDroid. I think it's the most valuable and useful thing I've ever found on Google play.
 

Endercraft

Moderator (& bug finder :D)
To summarize,
Macros are written in JSON, but
Triggers, Actions and Constraint are written in Java (or maybe Kotlin ?IMG_20221112_163215.jpgwhat's up with the date..?)
 

FrameXX

Well-known member
To summarize,
Macros are written in JSON, but
Triggers, Actions and Constraint are written in Java (or maybe Kotlin ?View attachment 3905what's up with the date..?)

The fact that MacroDroid.apk has a folder named "kotlin" inside doesn't mean it's written all in kotlin. Parts can be written in Java and other parts in Kotlin.

Macros are written in JSON

Note that JSON (JavaScript Object Notation) is just used to save the data needed to execute the macro. Even thought it has JavaScript in it's name, it's syntax is used to save into objects and arrays across many languages. I don't want to play expert here (even thought I am playing one), but say that macros are written in JSON can be a little misleading, even though it's true depending on how you perceive it.
 

Endercraft

Moderator (& bug finder :D)
The fact that MacroDroid.apk has a folder named "kotlin" inside doesn't mean it's written all in kotlin. Parts can be written in Java and other parts in Kotlin.



Note that JSON (JavaScript Object Notation) is just used to save the data needed to execute the macro. Even thought it has JavaScript in it's name, it's syntax is used to save into objects and arrays across many languages. I don't want to play expert here (even thought I am playing one), but say that macros are written in JSON can be a little misleading, even though it's true depending on how you perceive it

Yes, I was a bit unclear when saying that, I did mean to say that there may be parts in kotlin but I forgot to write that ? Also yes I also meant that macros are written in JSON in the sense where the data that composes the macro is in JSON.
 
Top