Here you are going to have a how to install Spotify connect on your device and use a webapp to play all music you want from Spotify, only for premium accounts
Step 1: Create a libertine container
First of all we have to create a libertine container, so we are going to Settings > Libertine > Click on plus button on top right
Wait until container be totally created, click on Container > top right on Settings > Container information > Operation details (view) and waint until finnish
Step 2: Install curl on container
First connect over ssh to mobile, for this you have to enable via "Tweak Tools" app (more info) and put you ssh key on it, then: ssh pablet@yourip
See containers name: libertine-container-manager list and connect to container: libertine-container-manager exec -i xenial -c "/bin/bash"
So now we can install curl: apt install curl
Step 3: Install mopidy
We continue connected to container after "Step 2" (and all steps from here to the end are connected in libertine container) so we execute:
wget -q -O - https://apt.mopidy.com/mopidy.gpg | apt-key add -
wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/stretch.list
apt update
apt install mopidy
apt-get install mopidy-spotify
Step 4: Configure mopidy to connect to Spotify
Go to this link https://www.mopidy.com/authenticate/ and at bottom you have the connection to Spotify click on it and get the params client_id and client_secret
Using you favorite shell editor (apt install vim-tiny) edit the file: vim.tiny /etc/mopidy/mopidy.conf
And add at the end this lines with your data
[spotify]
username = ...your username...
password = ...your password...
client_id = ...client_id...
client_secret = ...client_secret...
Step 5: Edit desktop icon
On file /usr/share/applications/mopidy.desktop modify line 8 to this:
Exec=mopidy --config /etc/mopidy/mopidy.conf
Step 6: Install dashboard
Finally we have to install a web dashboard to play our music, for that we need pip so install all with that commands:
apt install python-pip
pip install --upgrade setuptools
pip install Mopidy-Iris
Step 7: Run spotify
Now we have Spotify installed, so how we can play music, it's easy, go to Main Scope on Ubuntu touch, touch from bottom to up to open Desktop applications from libertine, open Mopidy and let it run (it never end loading because runs on backgroung) open Morph and go to http://127.0.0.1:6680 you see something like screenshot so go and select Iris
Note: If you care of battery consumption, don't worry about that, you can clos modipy app and stops running. Even that i was listenning music several ours and i don't detect more battery lose than normally.