Is LiveView suitable for web apps targeted to mobile phones?

I getting ready to start developing a mobile phone targeted web app. I am very tempted to use LiveView since I have good experience using it. The alternative is to tackle some significant learning curves: Flutter, React Native, Supabase, etc.

In another thread (May of 23), Jose voiced his opinion that LV wasn’t yet mobile ready.

I’ve looked ever so briefly at LiveView Native and it doesn’t seem ready for prime time.

So, what are the possible down sides of LV targeted mobile apps?

PS: my app will automate the execution of pool tournaments.

1 Like

If you are building a web app then yes it’s fine, you don’t even need liveview native for that.

If you need an app with offline functionality or similar even liveview native won’t get you there.

The usual downside is that on a mobile browser, the websocket connection often breaks and reconnects. Your users will see some hiccup every once in a while.

1 Like

Can you give me and example or two of what a hiccup might look like?

If instead of a LiveView app, I have a React Native app talking to a JSON server, would I not have similar problems?

Thanks

You can test yourself. get 2 cell phones, and try this app I wrote:

https://gara.fly.dev

It is a chat implemented in Phoenix LiveView, hosted in IAD region on fly.io

Sorry, but it’s not obvious to me what I should do with the app or what effect I am supposed to notice. Can you clarify a bit?

It’s basically a chat app where you can share messages or files. To test if an LV app works on phone, get two phones and join this app and send messages and see how snappy the refresh is on the other phone (I am guessing you will get autogenerated nicks for each phones)

I would like to add that while liveview doesn’t explicitly support offline functionality, you could build your own, using client side rendering, like returning react components from js hooks for example and using all the front end tech you might know. There’s also Electric sql which is new but has a phx integration.

1 Like

I gather that I am supposed to create a chat room on one phone and then join the same chat room on another phone. Problem is, I can’t figure out how to join an existing chat room. It seems I can only create new rooms. What am I missing?

Actually, for my target application, offline functionality isn’t needed. I’m guessing that @josevalim wasn’t referring to offline functionality when I said, in May 2023, that LiveView wasn’t mobile ready. But that was a long time ago. Maybe the issues he referred to are no longer present.

1 Like

One issue to check on mobile is if you open the site on mobile then background your browser and then a while later you switch back to your browser then LiveView may refresh the page which causes the user to lose their place in whatever they were doing. This happens even more frequently if your network connection is not strong.

3 Likes

You can go to the same room URL on the second phone

I thought I tried that and instead just was given the nickname and entered the same room as the first phone. Maybe I did something incorrectly. I’ll try again.

Use the address bar of your browser. Same URL will lead you to the same room. Or you can invent your own URL, so long as no one else is using it (near zero chance)

https://gara.fly.dev/anything/is/possible

There is a readme on github:

If you have suggestion to make it more intuitive, please send me a PR.

I probably just didn’t give it the proper amount of attention or diligence. I was only using it to experiment with a LV app running on a phone. I’ll give it another try. Thanks