Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passing text variable from tasker #2

Closed
sagaruday opened this issue Mar 26, 2017 · 3 comments
Closed

passing text variable from tasker #2

sagaruday opened this issue Mar 26, 2017 · 3 comments

Comments

@sagaruday
Copy link

How to send the text variable from tasker via bluetooth ??

@manu-t
Copy link

manu-t commented Sep 4, 2017

Hi, I modified the android app to do that (TaskerPlugin.Setting.setVariableReplaceKeys) :

    // Method that returns the bundle to be saved
    @Override
    public Bundle getResultBundle() {
        String mac = macText.getText().toString();
        String msg = ((EditText) findViewById(R.id.msg)).getText().toString();
        boolean crlf = ((CheckBox) findViewById(R.id.checkbox)).isChecked();

        Bundle bundle = new Bundle();
        bundle = BundleManager.generateBundle(mac, msg, crlf);;

        if (TaskerPlugin.Setting.hostSupportsOnFireVariableReplacement(this))
            TaskerPlugin.Setting.setVariableReplaceKeys(bundle, new String[]{"com.giechaskiel.ilias.bluetoothserialfromtasker.STRING_MSG"});

        //return BundleManager.generateBundle(mac, msg, crlf);
        return bundle;
    }

in the PluginActivity.java file.

You also have to add the TaskerPlugin. java file to the project.
It's my first test with java and android studio, so I hope there is no stupid mistake...

@giech
Copy link
Owner

giech commented Sep 17, 2017

Thank you both for this issue. I have updated the code to allow for variable use in both the Bluetooth MAC field and the message field (but not the CRLF boolean). Both the code and the APK have been updated to reflect this.

@giech giech closed this as completed Sep 17, 2017
@manu-t
Copy link

manu-t commented Sep 17, 2017

You're welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants