Working with Widget

Post your questions and help other users.

Moderator: Martin

rsegoly
Posts: 46
Joined: 14 Jun 2013 15:30

Working with Widget

Post by rsegoly » 01 Oct 2013 08:42

I tried before working with Automagic widget but it looked to complicated.
I have web site which is connected to Database
I can query data by opening URL with PHP screen
I am looking for simple solution whether Automagic widget or other
I need a 2X4 buttons with different text for each one and ability to display some data on top which is result of database such query

So ___________________________________
Temp at home XXXX
Button1 Button2
Button2 Button3
Button4 Button5
Button6 Button7

Any recommendations?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Working with Widget

Post by Martin » 01 Oct 2013 17:22

Hi,

You can show the contents of a global variable in a text element of a widget by setting the text of the element to {global_xyz}.
The content of the global variable can be set from a flow using an action Script:
global_xyz = "test";

Please check out the widget tutorial for an example:
http://automagic4android.com/en/help/cr ... tom-widget

You can also directly modify a widget using a script. The Tips section at the end of the tutorial describes how this can be done.

Regards,
Martin

rsegoly
Posts: 46
Joined: 14 Jun 2013 15:30

Re: Working with Widget

Post by rsegoly » 01 Oct 2013 18:17

Thanks
Can the widget be bigger than 1x1?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Working with Widget

Post by Martin » 01 Oct 2013 20:17

The widget can be resized on most newer Android versions (Android 3.1+).
Long-click the widget and release. The widget border should be marked with a resize border which can be dragged to create bigger widgets.

rsegoly
Posts: 46
Joined: 14 Jun 2013 15:30

Re: Working with Widget

Post by rsegoly » 02 Oct 2013 02:09

I realized after i posted, now i have nice working widget
Thanks

rsegoly
Posts: 46
Joined: 14 Jun 2013 15:30

Re: Working with Widget

Post by rsegoly » 02 Oct 2013 18:50

One more issue I remember being able to create an action to display public transportation on Google map from current location to specific place but can't find this option again.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Working with Widget

Post by Martin » 02 Oct 2013 19:34

There is no built-in action in Automagic to do this.
You can try if following action works on your device (I think it's not officially supported by Android):

Start Activity
Data URI: https://maps.google.com/maps/?daddr=38. ... 7&dirflg=r
Explicit Component: checked
Package Name: com.google.android.apps.maps

URL query parameters:
saddr=source location (coordinates)
daddr=destination location (coordinates)
dirflg=h - Switches on "Avoid Highways" route finding mode.
dirflg=t - Switches on "Avoid Tolls" route finding mode.
dirflg=r - Switches on "Public Transit" - only works in some areas.
dirflg=w - Switches to walking directions - still in beta.
dirflg=d - Switches to driving directions

rsegoly
Posts: 46
Joined: 14 Jun 2013 15:30

Re: Working with Widget

Post by rsegoly » 03 Oct 2013 03:45

I remembered later, it was not on Automagic but rather Map original widget with shortcut on screen

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Working with Widget

Post by Martin » 03 Oct 2013 16:20

I completely forgot about shortcuts :-) You can also use an action Shortcut to launch 'Directions' from Automagic.

rsegoly
Posts: 46
Joined: 14 Jun 2013 15:30

Re: Working with Widget

Post by rsegoly » 03 Oct 2013 16:53

What do mean launch directions?
Map and direction as class?

Post Reply