Results 1 to 5 of 5
  1. #1
    offline Developer
    Join Date
    Apr 2010
    Posts
    407
    Thanks
    20
    Thanked 236 Times in 59 Posts
    Downloads
    7
    Uploads
    0

    REQUEST - small app to send toast message to active window

    I am in need for a very small app i can use to send a "toast"(thats the name in android java SDK) messages from example a shell script using the "am" .. ive tried this using Ash but its simply to complex to utilize for this purpose..

    so if anyone got more java experience and can call the few lines needed in an app and make it possible to be called from a command line (like Ash works) its greatly appreciated..

    the toast lines are just 1 line, but getting the info from a command line with am, i simply dont know how to make. but thats as much i know about this for now..

  2. #2
    offline Of Mice and Modders
    Join Date
    Mar 2010
    Posts
    54
    Thanks
    7
    Thanked 1 Time in 1 Post
    Downloads
    1
    Uploads
    0
    i'm a experienced java programmer, made some small and bigger apk's yet with android sdk ... as you said: bringing a toast is not THAT difficult. but i don't know, what AM means?! you want to start the activity (apk) from commandline, that just popups the toast?

    i think, i know what you mean and what you want to achieve with it. but wtf is am?

    Quote Originally Posted by kniffo80 View Post
    i'm a experienced java programmer, made some small and bigger apk's yet with android sdk ... as you said: bringing a toast is not THAT difficult. but i don't know, what AM means?! you want to start the activity (apk) from commandline, that just popups the toast?

    i think, i know what you mean and what you want to achieve with it. but wtf is am?
    AH. now i know, what am is. so, the following site should help out: Android: Run Android Application from Command Line

    And this should be your point of entry:

    Code:
    Context context = getApplicationContext();
    CharSequence text = "Hello dexter, move your output here ;)";
    int duration = Toast.LENGTH_SHORT;
    
    Toast toast = Toast.makeText(context, text, duration);
    toast.show();
    I may test it out during the day, perhaps i get an apk for you in the meantime ...
    Last edited by kniffo80; 09-03-2010 at 07:05 AM. Reason: Automerged Doublepost

  3. #3
    offline Of Mice and Modders
    Join Date
    Mar 2010
    Posts
    54
    Thanks
    7
    Thanked 1 Time in 1 Post
    Downloads
    1
    Uploads
    0
    here we go dexter.

    extract the attached .zip (containing the apk), install it on your device. if installed correctly, just popup the toast with the following code from shell:
    Code:
    am start -a android.intent.action.MAIN -n org.dexter/org.dexter.DexterToast
    I just tried it with my milestone and better terminal emulator. It works as intended
    Attached Files Attached Files

  4. #4
    offline Developer
    Join Date
    Apr 2010
    Posts
    407
    Thanks
    20
    Thanked 236 Times in 59 Posts
    Downloads
    7
    Uploads
    0
    thanks for help!.. seemed to be a straight forward app to make, so thanks..

    btw, i got something similar on xda forum, but not tested anything yet, as ive been busy with other stuff..

    ill try it out and see how it goes..

  5. #5
    offline Of Mice and Modders
    Join Date
    Mar 2010
    Posts
    54
    Thanks
    7
    Thanked 1 Time in 1 Post
    Downloads
    1
    Uploads
    0
    I know the other app on xda.this was just a 5 minute work so if its helpful ok.if not,also ok.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •