Creating new apps
Here you will find a lot of information on creating new apps on our phone!
With our phone you can create your own apps with some HTML/JS/CSS/LUA development experience!
Step 1
Open html/js/config.js
file located in the resource folder and find this line in it:
And depending on how you want to have the apps ordered in the home screen, paste this code snippet after the app you want it to be after in the home screen
Everything is commented and should be understandable.
Step 2
Open html/index.html
file located in the resource folder with your editor [Notepad++, Visual Studio Code, etc]
Find this huge comment in the index.html
file
And under it, paste this example app template
Step 3
Now open html/js
directory located in the resource folder and create a new .js
file named however you like, do the same in html/css
but this time create a .css
file.
Then again open html/index.html
file located in the resource folder and inside the <head>
tag paste this line in
Now locate this line that should be on the very bottom of the <body>
:
And paste this line under the comment
You can find our very advanced Javascript API here!
Step 4
Open the .css
file that you've created in html/css
directory with your editor [Notepad++, Visual Studio Code, etc] and paste this template in
Do not change anything besides the background
property on the .myapp
css element, only add modify the inner HTML of the app. Do not remove the bottomline
DIV element as well.
Always use viewport [vw] units or percent [%] for children of elements that have their size set with viewport [vw] units! Not px/vh/em!
That way the phone will be fully responsive for any screen size, and will remain the same size for all monitor sizes.
Step 5
Now open client
directory located in the resource folder and create a new .lua
file named however you like. You do not need to add the file in fxmanifest.lua, as all the files in the directory are automatically registered.
If you need a server file too, open the server
directory located in the resource folder and create a new .lua
file named however you like. You do not need to add the file in fxmanifest.lua, as all the files in the directory are automatically registered.
In these lua files you can register NUI callbacks, events, and do everything you need for the app to function correctly!
Last updated