Page 1 of 1

Problem creating my first Widget

Posted: 25 Sep 2016 12:38
by AliShibaz
I recently bought Automagic for my Samsung Galaxy Tablet (SM-T560NU). I went to the Automagic site to try to learn how to use it. I tried "Creating a Custom Widget" in the Help section.
automagic4android.com/en/help/creating-a-custom-widget

I got to Step 4 - Adding actions to the widget. The following is somewhat abbreviated: Near the bottom of the page, it says: Add the action: "Launch app com.android.settings.deskclock". I tried that. But, when I touched the widget, I got the following error: "Action not executed successfully. Could not get launch intent for package com.google.android.deskclock. Please define a class."

I'd guess the meaning of "class" in this context is that an app like the Clock may have several components such as: Alarm, Stopwatch, Timer, etc. and I'd guess each of these is considered a class. So the class enables you to launch that component directly. I have a Galaxy S4 smart phone running Android v5.0.1. My tablet runs Android v6.0.1. But I've never heard of any app called "Deskclock". I tried to search my tablet using "My Files". I searched for the file "com.android.settings.deskclock" but couldn't find it. It appears "Deskclock" is the same as "Clock". But I can't find that file anywhere on my tablet.

I have a feeling my problem has something to do with the following statement from "Step 4": "The package of the clock app can be different on different versions of Android". Is that my problem?
In any case, before asking for help in this user forum, I tried learn a little more. I added "Timer" to the class section of the action: "Launch app com.android.settings.deskclock". That produced the following error:

"Action not successfully executed. Unable to find explicit activity class {com.google.android.deskclock/Timer} have you declared this activity in your AndroidManifest.xml?"

I have no idea what that means. But, was I on the right track? I did try other actions such as turning WiFi on/off and they worked fine. So I think my problem is limited to "Class Name".
All in all, I'm really enjoying Automagic and looking forward to doing more. Can anyone tell me what I'm doing wrong?

Re: Problem creating my first Widget

Posted: 25 Sep 2016 17:40
by Martin
Hi,

When you define the action Launch App, you can click on the [...]-button at the right side of the package name. Automagic should show a list with all available apps on your device. Selecting the clock app should set the package name field to the proper value for your device (on a Samsung device it might be something like com.sec.android.app.clockpackage, but it could also be something else on your device).
While still editing the action, you can also press the menu button and use Execute to see if the action works properly and the clock app can be started.

Regards,
Martin

Re: Problem creating my first Widget

Posted: 25 Sep 2016 20:18
by AliShibaz
Hello Martin,

My widget is now working perfectly. You were correct about the name of the package. Thank you so much.

P.S. For anyone else who may experience this same sort of problem, I'd like to add the following: When you click on [...]. it may show a great number of different names (maybe hundreds of them). But it also shows a magnifying glass (the icon for "search") and I entered the word "clock" and it then showed me just four apps that had the string "clock" in the name. That may greatly simplify any future work for me and perhaps other users may find it to be of help to them. Thanks again Martin. Your information simplifies the entire process for me. I'm so happy to be using Automagic. I bought Tasker before buying Automagic because so many of the user reviews I read said that AM was much, much easier to understand. I can certainly agree with that. I'm very happy to have discovered Automagic.

Re: Problem creating my first Widget

Posted: 01 Oct 2016 07:23
by AliShibaz
Hello Martin,

I tried to send you a Private Message but I'm unable to send PMs. The software told me I may not have participated in the board enough to be able to use this feature.

I wanted to send you a PM to tell you that I wrote some Supplementary Info that I found helpful (or maybe necessary) for people who are beginners with Automagic to help them complete two of the examples in the Help section - (Creating the First Flow and Creating a Custom Widget). I'd like to send you this small document to see if you'd like to put it somewhere on this forum. I think it would be better to hear from you first before I just post it somewhere as that may not be appropriate for this forum. Since I'm a newcomer here, I really don't know if it would be OK to just post it or to wait and hear back from you first.

Thank you.

Re: Problem creating my first Widget

Posted: 01 Oct 2016 09:18
by Martin
Hi,

Sounds great! I don't have a strict policy about the content posted on the forum as long as it's somehow related to Automagic or automation in general so feel free to post it directly in the forum if you like. You can also send it to my support mail address info@automagic4android.com if you would like me to read it first.

Regards,
Martin