SlideShare a Scribd company logo
1 of 10
Download to read offline
Ring Documentation, Release 1.10
77.9 Building the Cards Game for Mobile using RingQt
For a better example, consider building an Android package for the Cards game that comes with the
Ring language in this folder : ring/application/cards
The Cards game folder contains three ļ¬les
cards.ring : The Game source code
cards.jpg : The image ļ¬le used by the game
project.qrc : Resource ļ¬le to be used with the Qt project
The resource ļ¬le contains the next content
<RCC>
<qresource>
<file>cards.ringo</file>
<file>cards.jpg</file>
</qresource>
</RCC>
We have two ļ¬les in the resource ļ¬le
The ļ¬rst ļ¬le is cards.ringo (The Ring Object File) and the second ļ¬le is cards.jpg (The image ļ¬le)
As a start, Ring2EXE will generate this resource ļ¬le in target/mobile/qtproject/project.qrc
But this ļ¬le will contains only cards.ringo (That Ring2EXE will generate by calling Ring compiler)
We need to update this resource ļ¬le to add the image ļ¬le : cards.jpg
After this update, we copy the resource ļ¬le to the main application folder
So when we use Ring2EXE again, Our updated resource ļ¬le will be used!
Now to build the cards game for Mobile
1. Run the next command
ring2exe cards.ring -dist -mobileqt
2. Open target/mobile/qtproject/project.pro using Qt creator
3. Build and Run using Qt Creator
How the Cards game will ļ¬nd the image ļ¬le ?
RingQt comes with a simple function : AppFile() that we can use to determine the ļ¬les that we may
access on Desktop or Mobile platforms
The next code from cards.ring
mypic = new QPixmap(AppFile("cards.jpg"))
So all what you need is using AppFile() function around your image ļ¬les!
77.10 Building the Weight History Application for Mobile using
RingQt
Another example to distribute your application for Mobile Devices using Ring2EXE and Qt
77.9. Building the Cards Game for Mobile using RingQt 868
Ring Documentation, Release 1.10
consider building an Android package for the Weight History application that comes with the
Ring language in this folder : ring/application/weighthistory
The Weight History application folder contains four ļ¬les
weighthistory.ring : The application source code
weighthistory.db : The SQLite database
project.qrc : The resource ļ¬le for the Qt project
main.cpp : The main C++ source ļ¬le for the Qt project
To build the Weight History application for Mobile
1. Run the next command
ring2exe weighthistory.ring -dist -mobileqt
2. Open target/mobile/qtproject/project.pro using Qt creator
3. Build and Run using Qt Creator
The resource ļ¬le (project.qrc) contains two ļ¬les
<RCC>
<qresource>
<file>weighthistory.ringo</file>
<file>weighthistory.db</file>
</qresource>
</RCC>
The ļ¬rst ļ¬le is weighthistory.ringo (Ring Object File - Generated by Ring2EXE by calling Ring compiler)
The database ļ¬le : weighthistory.db
The main.cpp contains the next little update, To copy the database ļ¬le from resources to a writable location
on the mobile device
QString path3 ;
path3 = path+"/weighthistory.db";
QFile::copy(":/weighthistory.db",path3);
You will need to do this with database ļ¬les only!
When we use Ring2EXE, the tool will check for project.qrc and main.cpp, if they exist then your updated
ļ¬les will be used in target/mobile/qtproject instead of the default version generated by Ring2EXE
So Use Ring2EXE to generate these ļ¬les, Then copy them to your application folder when you update them.
77.11 Building the Form Designer for Mobile using RingQt
To build the Form Designer application (ring/applications/formdesigner) for Mobile
1. Run the next command
ring2exe formdesigner.ring -dist -mobileqt
2. Open target/mobile/qtproject/project.pro using Qt creator
3. Build and Run using Qt Creator
77.11. Building the Form Designer for Mobile using RingQt 869
Ring Documentation, Release 1.10
in the folder ring/application/formdesigner You will ļ¬nd the resource ļ¬le : project.qrc
It will be used automatically by Ring2EXE
<RCC>
<qresource>
<file>formdesigner.ringo</file>
<file>image/allevents.png</file>
<file>image/checkbox.png</file>
<file>image/close.png</file>
<file>image/combobox.bmp</file>
<file>image/datepicker.bmp</file>
<file>image/dial.png</file>
<file>image/formdesigner.png</file>
<file>image/frame.png</file>
<file>image/grid.bmp</file>
<file>image/hyperlink.png</file>
<file>image/image.png</file>
<file>image/label.png</file>
<file>image/layout.png</file>
<file>image/lcdnumber.png</file>
<file>image/listview.png</file>
<file>image/lock.png</file>
<file>image/new.png</file>
<file>image/open.png</file>
<file>image/progressbar.png</file>
<file>image/project.png</file>
<file>image/pushbutton.png</file>
<file>image/radiobutton.png</file>
<file>image/save.png</file>
<file>image/saveas.png</file>
<file>image/select.png</file>
<file>image/slider.png</file>
<file>image/spinner.bmp</file>
<file>image/statusbar.png</file>
<file>image/tab.png</file>
<file>image/textarea.png</file>
<file>image/textfield.png</file>
<file>image/timer.png</file>
<file>image/toolbar.png</file>
<file>image/tree.bmp</file>
<file>image/videowidget.png</file>
<file>image/webview.png</file>
</qresource>
</RCC>
As we did in the Cards game, The Form Designer will use the AppFile() function to determine the name of the Image
ļ¬les.
The next code from ring/applications/formdesigner/mainwindow/formdesignerview.ring
func CreateToolBar
aBtns = [
new qtoolbutton(win) {
setbtnimage(self,AppFile("image/new.png"))
setclickevent(Method(:NewAction))
settooltip("New File")
} ,
new qtoolbutton(win) {
setbtnimage(self,AppFile("image/open.png"))
77.11. Building the Form Designer for Mobile using RingQt 870
Ring Documentation, Release 1.10
setclickevent(Method(:OpenAction))
settooltip("Open File")
} ,
new qtoolbutton(win) {
setbtnimage(self,AppFile("image/save.png"))
setclickevent(Method(:SaveAction))
settooltip("Save")
} ,
new qtoolbutton(win) {
setbtnimage(self,AppFile("image/saveas.png"))
setclickevent(Method(:SaveAsAction))
settooltip("Save As")
} ,
new qtoolbutton(win) {
setbtnimage(self,AppFile("image/close.png"))
setclickevent(Method(:ExitAction))
settooltip("Exit")
}
]
tool1 = win.addtoolbar("files") {
for x in aBtns { addwidget(x) addseparator() }
}
From this example, We know that we can use sub folders for images.
77.12 Creating the Qt resource ļ¬le using Folder2qrc
When we have large RingQt project that contains a lot of images and ļ¬les, We need to add these ļ¬les to the resource
ļ¬le ( *.qrc ) when distributing applications for Mobile devices.
Instead of adding these ļ¬les one by one, Ring 1.6 comes with a simple tool that save our time, Itā€™s called Folder2qrc.
Example:
folder2qrc formdesigner.ring
We determine the main source ļ¬le while we are in the application folder, and Folder2qrc will check all of the ļ¬les in
the current folder and sub folders, Then add them to the resource ļ¬le after the mainļ¬le.ringo (In our example this will
be formdesigner.ringo)
The output ļ¬le will be : project.qrc
You can open it and remove the ļ¬les that you donā€™t need in the resources!
77.13 Important Information about Ring2EXE
ā€¢ Using Ring2EXE to prepare distribution will delete all of the ļ¬les in the old distribution
for example, if you have target/windows folder then used
ring2exe test3.ring -dist -allruntime
The ļ¬les in target/windows will be deleted before adding the ļ¬les again
This is important when you prepare a distribution for Mobile devices
77.12. Creating the Qt resource ļ¬le using Folder2qrc 871
Ring Documentation, Release 1.10
ring2exe test3.ring -dist -mobileqt
If you modiļ¬ed the resource ļ¬le : project.qrc or the main ļ¬le : main.cpp
Donā€™t forget to copy them to the application folder!
So Ring2EXE can use the updated version if you tried the previous command again!
ā€¢ Ring2EXE is written in Ring, and you can read the source code from
https://github.com/ring-lang/ring/blob/master/ring2exe/ring2exe.ring
ā€¢ The libraries information are stored in a separated ļ¬les, So these ļ¬les can be updated in the future
automatically to support new libraries
https://github.com/ring-lang/ring/blob/master/ring2exe/libs
77.13. Important Information about Ring2EXE 872
CHAPTER
SEVENTYEIGHT
THE RING PACKAGE MANAGER (RINGPM)
In this chapter we will learn about using the Ring Package Manager (RingPM)
RingPM is a tool for discovering, installing and updating Ring packages.
78.1 Features
The Package Manager uses Semantic Versioning to check compatibility between packages
The Package Manager comes with the next options
Usage : ringpm [command]
Command : search [keywords...]
Command : refresh : Update the Registry (Packages List)
Command : install [ <packagename> [from <UserName>] [branch <branchname>] ]
Command : list [-u : check updates]
Command : run [packagename]
Command : update <packagename>
Command : remove <packagename>
Command : format : Delete All Packages
Command : new <packagename>
Command : package : Create package in the current folder
78.2 Discovering Packages
We can discover new packages using the Search command
Using this command we can search in the RingPM Registry (Packages Index)
The RingPM Registry is a local copy of all registred packages.
ringpm search [keywords...]
Example:
ringpm search notepad
Output:
Package : ringnotepad (Ring Notepad)
Package : notepadppeditorextension (Notepad++ Editor Extension package)
873
Ring Documentation, Release 1.10
To print all packages in the RingPM Registry, use the search command without keywords.
Example:
ringpm search
78.3 Updating the RingPM Registry
The RingPM Registry is a local copy of all registred packages.
We can update the local copy using the Refresh command
Example:
ringpm refresh
Output:
No updates to the Registry, Nothing to do!
Or
The Registry is updated from revision 110 (2019/01/13) to revision 112 (2019/01/15)
78.4 Installing Packages
We can install new packages using the Install command
ringpm install [ <packagename> [from <UserName>] [branch <branchname>] ]
We can type only the package name to get the package information from the RingPM Registry or we can determine
the user name (GitHub) and the branch name of the github project (optional).
If the current folder is a package folder then we donā€™t need to write the package name.
Example (1) :
ringpm install ringnotepad
Example (2) :
ringpm install goldmagic800
Example (3) :
ringpm install gameoflife
If the package is not added to the RingPM Registry, We can install it directly from the GitHub user
Example (4) :
ringpm install firstpackage from mahmoudfayed
To run the package after installation
ringpm run firstpackage
78.3. Updating the RingPM Registry 874
Ring Documentation, Release 1.10
To install a package in the current folder
Example (5) :
ringpm install
78.5 Printing List of Installed Packages
We can know the installed packages using the List command
ringpm list [-u : check updates]
Example
ringpm list
Output
(analogclock) : The AnalogClock Package [master] -- (1.0.0)
(androidringlibsdl) : The AndroidRingLibSDL Package [master] -- (1.0.0)
(androidringqt) : The AndroidRingQt Package [master] -- (1.0.0)
(atomeditorextension) : The AtomEditorExtension Package [master] -- (1.0.0)
(bignumber) : The BigNumber Package [master] -- (1.0.0)
(calculator) : The Calculator Package [master] -- (1.0.0)
(cards) : The Cards Package [master] -- (1.0.0)
(checkers) : The Checkers Package [master] -- (1.0.0)
(chess) : The Chess Package [master] -- (1.0.0)
....
To check for new updates
ringpm list -u
78.6 Run Package
After installing a package, we can run it using the Run command.
ringpm run [packagename]
Example(1):
ringpm run ringnotepad
Example(2):
ringpm run goldmagic800
Example(3):
ringpm run gameoflife
To run a package in the current folder
Example(4):
ringpm run
78.5. Printing List of Installed Packages 875
Ring Documentation, Release 1.10
78.7 Update Package
We can update a package using the Update command
ringpm update <packagename>
Example:
ringpm update ringnotepad
78.8 Remove Package
We can remove a package using the Remove command
ringpm remove <packagename>
Example:
ringpm remove ringnotepad
78.9 Deleting All Packages
We can delete all packages using the Format command
Example:
ringpm format
78.10 Creating New Package
We can create new package using the New command
ringpm new <packagename>
Example:
ringpm new myapp
This will create new folder called my myapp
The new folder will contains the next ļ¬le
ā€¢ package.ring : The package description and ļ¬les
ā€¢ main.ring : main program (used by the Run command)
ā€¢ lib.ring : library ļ¬le for the package
File : main.ring
# The Main File
load "lib.ring"
78.7. Update Package 876
Ring Documentation, Release 1.10
func main
? "Hello, World!"
File : lib.ring
# The Library File
File : package.ring
aPackageInfo = [
:name = "The myapp Package",
:description = "Our myapp package using the Ring programming language",
:folder = "myapp",
:developer = "",
:email = "",
:license = "MIT License",
:version = "1.0.0",
:ringversion = "1.10",
:versions = [
[
:version = "1.0.0",
:branch = "master"
]
],
:libs = [
[
:name = "",
:version = "",
:providerusername = ""
]
],
:files = [
"lib.ring",
"main.ring"
],
:ringfolderfiles = [
],
:windowsfiles = [
],
:linuxfiles = [
],
:ubuntufiles = [
],
:fedorafiles = [
],
:macosfiles = [
],
:windowsringfolderfiles = [
],
:linuxringfolderfiles = [
78.10. Creating New Package 877

More Related Content

Similar to Build Mobile Apps with RingQt and Ring2EXE

The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.10 book - Part 13 of 212The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.10 book - Part 13 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.10 book - Part 83 of 212The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.10 book - Part 83 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.8 book - Part 77 of 202
The Ring programming language version 1.8 book - Part 77 of 202The Ring programming language version 1.8 book - Part 77 of 202
The Ring programming language version 1.8 book - Part 77 of 202Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.9 book - Part 12 of 210
The Ring programming language version 1.9 book - Part 12 of 210The Ring programming language version 1.9 book - Part 12 of 210
The Ring programming language version 1.9 book - Part 12 of 210Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.7 book - Part 75 of 196
The Ring programming language version 1.7 book - Part 75 of 196The Ring programming language version 1.7 book - Part 75 of 196
The Ring programming language version 1.7 book - Part 75 of 196Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.5.1 book - Part 14 of 180
The Ring programming language version 1.5.1 book - Part 14 of 180The Ring programming language version 1.5.1 book - Part 14 of 180
The Ring programming language version 1.5.1 book - Part 14 of 180Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 90 of 212
The Ring programming language version 1.10 book - Part 90 of 212The Ring programming language version 1.10 book - Part 90 of 212
The Ring programming language version 1.10 book - Part 90 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.8 book - Part 10 of 202
The Ring programming language version 1.8 book - Part 10 of 202The Ring programming language version 1.8 book - Part 10 of 202
The Ring programming language version 1.8 book - Part 10 of 202Mahmoud Samir Fayed
Ā 
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)Alexandre Gouaillard
Ā 
DevTools Package Development
 DevTools Package Development DevTools Package Development
DevTools Package DevelopmentSagar Deogirkar
Ā 
The Ring programming language version 1.3 book - Part 8 of 88
The Ring programming language version 1.3 book - Part 8 of 88The Ring programming language version 1.3 book - Part 8 of 88
The Ring programming language version 1.3 book - Part 8 of 88Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.3 book - Part 10 of 88
The Ring programming language version 1.3 book - Part 10 of 88The Ring programming language version 1.3 book - Part 10 of 88
The Ring programming language version 1.3 book - Part 10 of 88Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.5.2 book - Part 15 of 181
The Ring programming language version 1.5.2 book - Part 15 of 181The Ring programming language version 1.5.2 book - Part 15 of 181
The Ring programming language version 1.5.2 book - Part 15 of 181Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 21 of 212
The Ring programming language version 1.10 book - Part 21 of 212The Ring programming language version 1.10 book - Part 21 of 212
The Ring programming language version 1.10 book - Part 21 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.9 book - Part 81 of 210
The Ring programming language version 1.9 book - Part 81 of 210The Ring programming language version 1.9 book - Part 81 of 210
The Ring programming language version 1.9 book - Part 81 of 210Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.5.4 book - Part 14 of 185
The Ring programming language version 1.5.4 book - Part 14 of 185The Ring programming language version 1.5.4 book - Part 14 of 185
The Ring programming language version 1.5.4 book - Part 14 of 185Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 23 of 212
The Ring programming language version 1.10 book - Part 23 of 212The Ring programming language version 1.10 book - Part 23 of 212
The Ring programming language version 1.10 book - Part 23 of 212Mahmoud Samir Fayed
Ā 
Dgeni documentation generator
Dgeni   documentation generatorDgeni   documentation generator
Dgeni documentation generatorPeter Darwin
Ā 
The Ring programming language version 1.9 book - Part 90 of 210
The Ring programming language version 1.9 book - Part 90 of 210The Ring programming language version 1.9 book - Part 90 of 210
The Ring programming language version 1.9 book - Part 90 of 210Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.6 book - Part 17 of 189
The Ring programming language version 1.6 book - Part 17 of 189The Ring programming language version 1.6 book - Part 17 of 189
The Ring programming language version 1.6 book - Part 17 of 189Mahmoud Samir Fayed
Ā 

Similar to Build Mobile Apps with RingQt and Ring2EXE (20)

The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.10 book - Part 13 of 212The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.10 book - Part 13 of 212
Ā 
The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.10 book - Part 83 of 212The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.10 book - Part 83 of 212
Ā 
The Ring programming language version 1.8 book - Part 77 of 202
The Ring programming language version 1.8 book - Part 77 of 202The Ring programming language version 1.8 book - Part 77 of 202
The Ring programming language version 1.8 book - Part 77 of 202
Ā 
The Ring programming language version 1.9 book - Part 12 of 210
The Ring programming language version 1.9 book - Part 12 of 210The Ring programming language version 1.9 book - Part 12 of 210
The Ring programming language version 1.9 book - Part 12 of 210
Ā 
The Ring programming language version 1.7 book - Part 75 of 196
The Ring programming language version 1.7 book - Part 75 of 196The Ring programming language version 1.7 book - Part 75 of 196
The Ring programming language version 1.7 book - Part 75 of 196
Ā 
The Ring programming language version 1.5.1 book - Part 14 of 180
The Ring programming language version 1.5.1 book - Part 14 of 180The Ring programming language version 1.5.1 book - Part 14 of 180
The Ring programming language version 1.5.1 book - Part 14 of 180
Ā 
The Ring programming language version 1.10 book - Part 90 of 212
The Ring programming language version 1.10 book - Part 90 of 212The Ring programming language version 1.10 book - Part 90 of 212
The Ring programming language version 1.10 book - Part 90 of 212
Ā 
The Ring programming language version 1.8 book - Part 10 of 202
The Ring programming language version 1.8 book - Part 10 of 202The Ring programming language version 1.8 book - Part 10 of 202
The Ring programming language version 1.8 book - Part 10 of 202
Ā 
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
Ā 
DevTools Package Development
 DevTools Package Development DevTools Package Development
DevTools Package Development
Ā 
The Ring programming language version 1.3 book - Part 8 of 88
The Ring programming language version 1.3 book - Part 8 of 88The Ring programming language version 1.3 book - Part 8 of 88
The Ring programming language version 1.3 book - Part 8 of 88
Ā 
The Ring programming language version 1.3 book - Part 10 of 88
The Ring programming language version 1.3 book - Part 10 of 88The Ring programming language version 1.3 book - Part 10 of 88
The Ring programming language version 1.3 book - Part 10 of 88
Ā 
The Ring programming language version 1.5.2 book - Part 15 of 181
The Ring programming language version 1.5.2 book - Part 15 of 181The Ring programming language version 1.5.2 book - Part 15 of 181
The Ring programming language version 1.5.2 book - Part 15 of 181
Ā 
The Ring programming language version 1.10 book - Part 21 of 212
The Ring programming language version 1.10 book - Part 21 of 212The Ring programming language version 1.10 book - Part 21 of 212
The Ring programming language version 1.10 book - Part 21 of 212
Ā 
The Ring programming language version 1.9 book - Part 81 of 210
The Ring programming language version 1.9 book - Part 81 of 210The Ring programming language version 1.9 book - Part 81 of 210
The Ring programming language version 1.9 book - Part 81 of 210
Ā 
The Ring programming language version 1.5.4 book - Part 14 of 185
The Ring programming language version 1.5.4 book - Part 14 of 185The Ring programming language version 1.5.4 book - Part 14 of 185
The Ring programming language version 1.5.4 book - Part 14 of 185
Ā 
The Ring programming language version 1.10 book - Part 23 of 212
The Ring programming language version 1.10 book - Part 23 of 212The Ring programming language version 1.10 book - Part 23 of 212
The Ring programming language version 1.10 book - Part 23 of 212
Ā 
Dgeni documentation generator
Dgeni   documentation generatorDgeni   documentation generator
Dgeni documentation generator
Ā 
The Ring programming language version 1.9 book - Part 90 of 210
The Ring programming language version 1.9 book - Part 90 of 210The Ring programming language version 1.9 book - Part 90 of 210
The Ring programming language version 1.9 book - Part 90 of 210
Ā 
The Ring programming language version 1.6 book - Part 17 of 189
The Ring programming language version 1.6 book - Part 17 of 189The Ring programming language version 1.6 book - Part 17 of 189
The Ring programming language version 1.6 book - Part 17 of 189
Ā 

More from Mahmoud Samir Fayed

The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212Mahmoud Samir Fayed
Ā 
The Ring programming language version 1.10 book - Part 191 of 212
The Ring programming language version 1.10 book - Part 191 of 212The Ring programming language version 1.10 book - Part 191 of 212
The Ring programming language version 1.10 book - Part 191 of 212Mahmoud Samir Fayed
Ā 

More from Mahmoud Samir Fayed (20)

The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212
Ā 
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212
Ā 
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212
Ā 
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212
Ā 
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212
Ā 
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212
Ā 
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212
Ā 
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212
Ā 
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212
Ā 
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212
Ā 
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212
Ā 
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212
Ā 
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212
Ā 
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212
Ā 
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212
Ā 
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212
Ā 
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212
Ā 
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212
Ā 
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212
Ā 
The Ring programming language version 1.10 book - Part 191 of 212
The Ring programming language version 1.10 book - Part 191 of 212The Ring programming language version 1.10 book - Part 191 of 212
The Ring programming language version 1.10 book - Part 191 of 212
Ā 

Recently uploaded

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
Ā 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
Ā 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
Ā 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
Ā 
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøDelhi Call girls
Ā 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
Ā 
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
Ā 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
Ā 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfWilly Marroquin (WillyDevNET)
Ā 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
Ā 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
Ā 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...OnePlan Solutions
Ā 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
Ā 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
Ā 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
Ā 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
Ā 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
Ā 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Ā 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
Ā 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
Ā 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Ā 
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
Ā 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
Ā 
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
Ā 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
Ā 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
Ā 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
Ā 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
Ā 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
Ā 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Ā 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Ā 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
Ā 
Call Girls In Mukherjee Nagar šŸ“± 9999965857 šŸ¤© Delhi šŸ«¦ HOT AND SEXY VVIP šŸŽ SE...
Call Girls In Mukherjee Nagar šŸ“±  9999965857  šŸ¤© Delhi šŸ«¦ HOT AND SEXY VVIP šŸŽ SE...Call Girls In Mukherjee Nagar šŸ“±  9999965857  šŸ¤© Delhi šŸ«¦ HOT AND SEXY VVIP šŸŽ SE...
Call Girls In Mukherjee Nagar šŸ“± 9999965857 šŸ¤© Delhi šŸ«¦ HOT AND SEXY VVIP šŸŽ SE...
Ā 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
Ā 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
Ā 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
Ā 
Vip Call Girls Noida āž”ļø Delhi āž”ļø 9999965857 No Advance 24HRS Live
Vip Call Girls Noida āž”ļø Delhi āž”ļø 9999965857 No Advance 24HRS LiveVip Call Girls Noida āž”ļø Delhi āž”ļø 9999965857 No Advance 24HRS Live
Vip Call Girls Noida āž”ļø Delhi āž”ļø 9999965857 No Advance 24HRS Live
Ā 

Build Mobile Apps with RingQt and Ring2EXE

  • 1. Ring Documentation, Release 1.10 77.9 Building the Cards Game for Mobile using RingQt For a better example, consider building an Android package for the Cards game that comes with the Ring language in this folder : ring/application/cards The Cards game folder contains three ļ¬les cards.ring : The Game source code cards.jpg : The image ļ¬le used by the game project.qrc : Resource ļ¬le to be used with the Qt project The resource ļ¬le contains the next content <RCC> <qresource> <file>cards.ringo</file> <file>cards.jpg</file> </qresource> </RCC> We have two ļ¬les in the resource ļ¬le The ļ¬rst ļ¬le is cards.ringo (The Ring Object File) and the second ļ¬le is cards.jpg (The image ļ¬le) As a start, Ring2EXE will generate this resource ļ¬le in target/mobile/qtproject/project.qrc But this ļ¬le will contains only cards.ringo (That Ring2EXE will generate by calling Ring compiler) We need to update this resource ļ¬le to add the image ļ¬le : cards.jpg After this update, we copy the resource ļ¬le to the main application folder So when we use Ring2EXE again, Our updated resource ļ¬le will be used! Now to build the cards game for Mobile 1. Run the next command ring2exe cards.ring -dist -mobileqt 2. Open target/mobile/qtproject/project.pro using Qt creator 3. Build and Run using Qt Creator How the Cards game will ļ¬nd the image ļ¬le ? RingQt comes with a simple function : AppFile() that we can use to determine the ļ¬les that we may access on Desktop or Mobile platforms The next code from cards.ring mypic = new QPixmap(AppFile("cards.jpg")) So all what you need is using AppFile() function around your image ļ¬les! 77.10 Building the Weight History Application for Mobile using RingQt Another example to distribute your application for Mobile Devices using Ring2EXE and Qt 77.9. Building the Cards Game for Mobile using RingQt 868
  • 2. Ring Documentation, Release 1.10 consider building an Android package for the Weight History application that comes with the Ring language in this folder : ring/application/weighthistory The Weight History application folder contains four ļ¬les weighthistory.ring : The application source code weighthistory.db : The SQLite database project.qrc : The resource ļ¬le for the Qt project main.cpp : The main C++ source ļ¬le for the Qt project To build the Weight History application for Mobile 1. Run the next command ring2exe weighthistory.ring -dist -mobileqt 2. Open target/mobile/qtproject/project.pro using Qt creator 3. Build and Run using Qt Creator The resource ļ¬le (project.qrc) contains two ļ¬les <RCC> <qresource> <file>weighthistory.ringo</file> <file>weighthistory.db</file> </qresource> </RCC> The ļ¬rst ļ¬le is weighthistory.ringo (Ring Object File - Generated by Ring2EXE by calling Ring compiler) The database ļ¬le : weighthistory.db The main.cpp contains the next little update, To copy the database ļ¬le from resources to a writable location on the mobile device QString path3 ; path3 = path+"/weighthistory.db"; QFile::copy(":/weighthistory.db",path3); You will need to do this with database ļ¬les only! When we use Ring2EXE, the tool will check for project.qrc and main.cpp, if they exist then your updated ļ¬les will be used in target/mobile/qtproject instead of the default version generated by Ring2EXE So Use Ring2EXE to generate these ļ¬les, Then copy them to your application folder when you update them. 77.11 Building the Form Designer for Mobile using RingQt To build the Form Designer application (ring/applications/formdesigner) for Mobile 1. Run the next command ring2exe formdesigner.ring -dist -mobileqt 2. Open target/mobile/qtproject/project.pro using Qt creator 3. Build and Run using Qt Creator 77.11. Building the Form Designer for Mobile using RingQt 869
  • 3. Ring Documentation, Release 1.10 in the folder ring/application/formdesigner You will ļ¬nd the resource ļ¬le : project.qrc It will be used automatically by Ring2EXE <RCC> <qresource> <file>formdesigner.ringo</file> <file>image/allevents.png</file> <file>image/checkbox.png</file> <file>image/close.png</file> <file>image/combobox.bmp</file> <file>image/datepicker.bmp</file> <file>image/dial.png</file> <file>image/formdesigner.png</file> <file>image/frame.png</file> <file>image/grid.bmp</file> <file>image/hyperlink.png</file> <file>image/image.png</file> <file>image/label.png</file> <file>image/layout.png</file> <file>image/lcdnumber.png</file> <file>image/listview.png</file> <file>image/lock.png</file> <file>image/new.png</file> <file>image/open.png</file> <file>image/progressbar.png</file> <file>image/project.png</file> <file>image/pushbutton.png</file> <file>image/radiobutton.png</file> <file>image/save.png</file> <file>image/saveas.png</file> <file>image/select.png</file> <file>image/slider.png</file> <file>image/spinner.bmp</file> <file>image/statusbar.png</file> <file>image/tab.png</file> <file>image/textarea.png</file> <file>image/textfield.png</file> <file>image/timer.png</file> <file>image/toolbar.png</file> <file>image/tree.bmp</file> <file>image/videowidget.png</file> <file>image/webview.png</file> </qresource> </RCC> As we did in the Cards game, The Form Designer will use the AppFile() function to determine the name of the Image ļ¬les. The next code from ring/applications/formdesigner/mainwindow/formdesignerview.ring func CreateToolBar aBtns = [ new qtoolbutton(win) { setbtnimage(self,AppFile("image/new.png")) setclickevent(Method(:NewAction)) settooltip("New File") } , new qtoolbutton(win) { setbtnimage(self,AppFile("image/open.png")) 77.11. Building the Form Designer for Mobile using RingQt 870
  • 4. Ring Documentation, Release 1.10 setclickevent(Method(:OpenAction)) settooltip("Open File") } , new qtoolbutton(win) { setbtnimage(self,AppFile("image/save.png")) setclickevent(Method(:SaveAction)) settooltip("Save") } , new qtoolbutton(win) { setbtnimage(self,AppFile("image/saveas.png")) setclickevent(Method(:SaveAsAction)) settooltip("Save As") } , new qtoolbutton(win) { setbtnimage(self,AppFile("image/close.png")) setclickevent(Method(:ExitAction)) settooltip("Exit") } ] tool1 = win.addtoolbar("files") { for x in aBtns { addwidget(x) addseparator() } } From this example, We know that we can use sub folders for images. 77.12 Creating the Qt resource ļ¬le using Folder2qrc When we have large RingQt project that contains a lot of images and ļ¬les, We need to add these ļ¬les to the resource ļ¬le ( *.qrc ) when distributing applications for Mobile devices. Instead of adding these ļ¬les one by one, Ring 1.6 comes with a simple tool that save our time, Itā€™s called Folder2qrc. Example: folder2qrc formdesigner.ring We determine the main source ļ¬le while we are in the application folder, and Folder2qrc will check all of the ļ¬les in the current folder and sub folders, Then add them to the resource ļ¬le after the mainļ¬le.ringo (In our example this will be formdesigner.ringo) The output ļ¬le will be : project.qrc You can open it and remove the ļ¬les that you donā€™t need in the resources! 77.13 Important Information about Ring2EXE ā€¢ Using Ring2EXE to prepare distribution will delete all of the ļ¬les in the old distribution for example, if you have target/windows folder then used ring2exe test3.ring -dist -allruntime The ļ¬les in target/windows will be deleted before adding the ļ¬les again This is important when you prepare a distribution for Mobile devices 77.12. Creating the Qt resource ļ¬le using Folder2qrc 871
  • 5. Ring Documentation, Release 1.10 ring2exe test3.ring -dist -mobileqt If you modiļ¬ed the resource ļ¬le : project.qrc or the main ļ¬le : main.cpp Donā€™t forget to copy them to the application folder! So Ring2EXE can use the updated version if you tried the previous command again! ā€¢ Ring2EXE is written in Ring, and you can read the source code from https://github.com/ring-lang/ring/blob/master/ring2exe/ring2exe.ring ā€¢ The libraries information are stored in a separated ļ¬les, So these ļ¬les can be updated in the future automatically to support new libraries https://github.com/ring-lang/ring/blob/master/ring2exe/libs 77.13. Important Information about Ring2EXE 872
  • 6. CHAPTER SEVENTYEIGHT THE RING PACKAGE MANAGER (RINGPM) In this chapter we will learn about using the Ring Package Manager (RingPM) RingPM is a tool for discovering, installing and updating Ring packages. 78.1 Features The Package Manager uses Semantic Versioning to check compatibility between packages The Package Manager comes with the next options Usage : ringpm [command] Command : search [keywords...] Command : refresh : Update the Registry (Packages List) Command : install [ <packagename> [from <UserName>] [branch <branchname>] ] Command : list [-u : check updates] Command : run [packagename] Command : update <packagename> Command : remove <packagename> Command : format : Delete All Packages Command : new <packagename> Command : package : Create package in the current folder 78.2 Discovering Packages We can discover new packages using the Search command Using this command we can search in the RingPM Registry (Packages Index) The RingPM Registry is a local copy of all registred packages. ringpm search [keywords...] Example: ringpm search notepad Output: Package : ringnotepad (Ring Notepad) Package : notepadppeditorextension (Notepad++ Editor Extension package) 873
  • 7. Ring Documentation, Release 1.10 To print all packages in the RingPM Registry, use the search command without keywords. Example: ringpm search 78.3 Updating the RingPM Registry The RingPM Registry is a local copy of all registred packages. We can update the local copy using the Refresh command Example: ringpm refresh Output: No updates to the Registry, Nothing to do! Or The Registry is updated from revision 110 (2019/01/13) to revision 112 (2019/01/15) 78.4 Installing Packages We can install new packages using the Install command ringpm install [ <packagename> [from <UserName>] [branch <branchname>] ] We can type only the package name to get the package information from the RingPM Registry or we can determine the user name (GitHub) and the branch name of the github project (optional). If the current folder is a package folder then we donā€™t need to write the package name. Example (1) : ringpm install ringnotepad Example (2) : ringpm install goldmagic800 Example (3) : ringpm install gameoflife If the package is not added to the RingPM Registry, We can install it directly from the GitHub user Example (4) : ringpm install firstpackage from mahmoudfayed To run the package after installation ringpm run firstpackage 78.3. Updating the RingPM Registry 874
  • 8. Ring Documentation, Release 1.10 To install a package in the current folder Example (5) : ringpm install 78.5 Printing List of Installed Packages We can know the installed packages using the List command ringpm list [-u : check updates] Example ringpm list Output (analogclock) : The AnalogClock Package [master] -- (1.0.0) (androidringlibsdl) : The AndroidRingLibSDL Package [master] -- (1.0.0) (androidringqt) : The AndroidRingQt Package [master] -- (1.0.0) (atomeditorextension) : The AtomEditorExtension Package [master] -- (1.0.0) (bignumber) : The BigNumber Package [master] -- (1.0.0) (calculator) : The Calculator Package [master] -- (1.0.0) (cards) : The Cards Package [master] -- (1.0.0) (checkers) : The Checkers Package [master] -- (1.0.0) (chess) : The Chess Package [master] -- (1.0.0) .... To check for new updates ringpm list -u 78.6 Run Package After installing a package, we can run it using the Run command. ringpm run [packagename] Example(1): ringpm run ringnotepad Example(2): ringpm run goldmagic800 Example(3): ringpm run gameoflife To run a package in the current folder Example(4): ringpm run 78.5. Printing List of Installed Packages 875
  • 9. Ring Documentation, Release 1.10 78.7 Update Package We can update a package using the Update command ringpm update <packagename> Example: ringpm update ringnotepad 78.8 Remove Package We can remove a package using the Remove command ringpm remove <packagename> Example: ringpm remove ringnotepad 78.9 Deleting All Packages We can delete all packages using the Format command Example: ringpm format 78.10 Creating New Package We can create new package using the New command ringpm new <packagename> Example: ringpm new myapp This will create new folder called my myapp The new folder will contains the next ļ¬le ā€¢ package.ring : The package description and ļ¬les ā€¢ main.ring : main program (used by the Run command) ā€¢ lib.ring : library ļ¬le for the package File : main.ring # The Main File load "lib.ring" 78.7. Update Package 876
  • 10. Ring Documentation, Release 1.10 func main ? "Hello, World!" File : lib.ring # The Library File File : package.ring aPackageInfo = [ :name = "The myapp Package", :description = "Our myapp package using the Ring programming language", :folder = "myapp", :developer = "", :email = "", :license = "MIT License", :version = "1.0.0", :ringversion = "1.10", :versions = [ [ :version = "1.0.0", :branch = "master" ] ], :libs = [ [ :name = "", :version = "", :providerusername = "" ] ], :files = [ "lib.ring", "main.ring" ], :ringfolderfiles = [ ], :windowsfiles = [ ], :linuxfiles = [ ], :ubuntufiles = [ ], :fedorafiles = [ ], :macosfiles = [ ], :windowsringfolderfiles = [ ], :linuxringfolderfiles = [ 78.10. Creating New Package 877