NativeScript App - fetch from DB



Hello, Im new in Native script only done tutorial so maybe it gonna be trival ask.

Im making app in nativescript something like Youtube app but a lot simpler.

I got website with images and videos and that things are stored in MySQL DB.

So i wanted to make app in nativescript to fetch(show) the same videos and images.

How to achieve that?


Does your website expose a REST API?


Dont have but I can implement


If you can then, that should be enough to use in your app. You can retrieve post content from the REST API and show the data the way you like.


Be sure you are aware of layouts in NativeScript in order to build a nice UI. Here is a very good material that helps newbies to learn layouts easily.

Decide which flavor you are going to use for development. If you are using NativeScript Core then just use the http module to fetch data. Load them in a view model and bind same to your view template, learn more about data binding here.

Probably you might want to use a ListView / Repeater to populate your UI with list of videos / images with their thumbnails and description.

Use plugins like image swipe / zoom / video player to show your image / video content in a detail page.

Take a look at NativeScript Code Samples for more ideas. Try SideKick for starter templates.