-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
155 lines (98 loc) · 5.34 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
TeaCup Music Widget
Contact: Matthew Hague (matthewhague@zoho.com)
(Or use the issue tracker on github -- please send any errors, players you want
supporting, working configurations for other players, and so on and so forth.)
A desktop music widget for Android works with stock player by default but allows
configuration for (hopefully) any player. Can interact with Last FM: getting
album art and scrobbling (choose when to connect, can cache when offline).
Play, prev, next buttons. Press album art to open the music player.
Configurable album art options: get embedded art, images in the same directory
as the music file, or fetch album art from Last FM. Can also pre-fetch album
art from Last FM.
Scrobbling to Last FM: when on wifi and/or phone network. Can store scrobbles
in a cache when no connection (will be sent when connection returns).
Written and tested for Android 2.3.3 (Android 10) on a Samsung Galaxy Mini 2,
but seems to compile and work in emulators for 4.2 (Android 17).
CHANGES
v1.7
Changed layout to meet recommended standards for 4x1 widgets.
v1.6:
Added support for CyanogenMod's Eleven player.
v1.5:
Replaced some inefficient scrobbling code.
v1.4:
Re-orders incorrectly ordered SSL Certificates (code borrowed from
Chariot Solutions:
http://blog.chariotsolutions.com/2013/01/https-with-client-certificates-on.html)
When storing album art in a separate directory, .nomedia is created to
keep the gallery clean.
v1.3:
Bug fix when fetching album art.
v1.2:
Last FM pays attention to track ID now, not just name (as e.g. Bjork's
Bastards album is 12 tracks with the same name...)
v1.1:
Better concurrency handling, buttons don't stop working after changing
language. Basically less crashy...
Test Last FM authentication button.
PERMISSIONS:
The widget needs permission to know when your phone has just booted up.
This is so it can start a service (if there's a widget on the home screen)
that listens for changes to the media state and does the updating
asynchronously.
It also needs network access for downloading from Last FM (if enabled) and
to be able to write files (to store cached album art).
CONFIGURATION:
The configuration utility starts when adding a widget and can also be
accessed via an icon in the launcher menu. Note, all instances of widgets
share a configuration.
If you want to customise the widget to work with any media player, press
"choose player" then select "custom player". You'll get a long list of
options.
To launch the player, the package name is needed. The default is
"com.android.music". I think HTC use a different stock player, so you'll
need to find out the config options to use this with HTC... (on my todo
list).
To keep up-to-date with the player, TeaCup needs to know what to listen for.
You can specify the "metachanged" action, that is fired when the track changes,
and the "playstatechanged" action, that is fired when the player changes
between play and pause. From the metachanged action, TeaCup needs to know
how to get the android media "id" of the song playing. In the stock player,
this is the "id" field of the "com.android.music.metadatachanged" action.
Similarly, TeaCup needs to know how to tell whether the current song is
playing or paused. This is the "playing" field of the
"com.android.music.playstatechanged" action.
Next, to control the player, TeaCup needs to know what requests to send to
the player and how. E.g. to jump to the next track, it must send a
"com.android.music.musicservicecommand" action, with the field "command" set
to "next". Hence, for the default player we set
Jump next action: com.android.music.musicservicecommand
Jump next command field: command
Jump next command: next
And similarly for play/pause and jump previous.
ICONS:
Teacup Logo is free clipart:
http://www.wpclipart.com/food/beverages/tea/teacup.png.html
Last FM Logo came from them: www.last.fm (uh, powered by AudioScrobbler).
Everything else i self-gimped.
BUILDING:
Hopefully all the files you need to compile are here...
... except a build system...
Linux-wise, you should be able to run
android update project --path . --target android-10
assuming you've set-up the android-sdk with android-10 (probably compiles for
other targets). (Run simply "android" to start setting up targets.)
And that will generate build.xml and local.properties, then you should be able
to do
ant debug
and an .apk will be built and put in bin/.
I've included build.xml.generated and local.properties.generated which are the
files generated on my machine. Rename to build.xml and local.properties, maybe
they'll work for you (if you edit local properties to tell it where the android
sdk is installed).
For more on building, see here
https://developer.android.com/tools/building/building-cmdline.html
and here
http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html
Then, once it's built, copy the .apk to your phone, open it up and let it
install. (Or use adb or whatever you prefer.)