MAIN : Tela principal do aplicativo
Exemplo:
Main main entity=AuthInput fields=obra
actions
Boletim
crud Boletim
Sair
exit
Na parte APP do aplicativo estão as configurações gerais de comportamento da aplicação como configurações de timeout de conexão ou tempo entre cada requisição do GPS por exemplo. Também é onde é cadastrada a URL de comunicação com painel, os dados de instalação e a implementação das telas do tipo Custom.
O app é definido da seguinte forma:
App appCode=tipo_do_app diskMinSpaceMB=30 diskToleranceSpaceMB=75 retainLogFilesInDisk=12
id 1
name Nome_do_Aplicativo
version 1.0.0
intVersion 1
install type=fillAuth inputEntity=AuthInput
server
jsonServiceApi url=%jsonServiceApiUrl
sqlDataSource agro
defaultOnlineValidator jsonServiceApi
defaultDataSource jsonServiceApi
defaultReceiver jsonServiceApi
versionControl Crc
timeZoneProvider jsonServiceList path=types.records key=timezone filter=id:obra url=%cmUrlObra
mobileevents types=1,2,3,4,5,6 // linha opcional
Main main entity=AuthInput fields=descricao
actions
Iniciar style=primary margin=0,0,0,0
crud Entidade2
Sair
exit
Reiniciar
restart
vars
_last Entidade1
Constants
agroHost http://comercial.simova.ws
agroWS %agroHost/SimovaResponse
jsonServiceApiUrl %agroWS/x-mova
cmUrlObra %jsonServiceApiUrl/list?json={"appCode":"X","types":[{"name":"Obra"}],"auth":{}}
InstallData
Entidade1
1 10 Entidade1 A
2 20 Entidade1 B
Exemplo:
App syncInterval=5m networkWait=4s networkTimeout=30s appCode=X offlineDate=Device
id 8995
name Sample
version 1.0.158
intVersion 159
install type=fillAuth inputEntity=AuthInput
clearOptionMenu password=123
settingsOptionMenu password=123321
buffer maxFileSizeMB=0.7 maxFilesToKeep=2 saveBinary
beforeUpdate
toast @before_update
Exemplo:
getDeviceName
AuthInput a = selectLast from AuthInput
return a.celular
Exemplo:
CustomScr custom title="Resumo"
views
recordDetail getRecord=_last fields=data,operacao,medicao labels
events
beforeInit
_last = selectLast from Apontamento
beforeClose
_last = null
Exemplo:
CustomScr custom title="Resumo"
views
recordDetail getRecord=_last fields=data,operacao,medicao labels fontssize=10,12,14 titlefontssize=30,20,10
button label="@ActionBarSubtitle" style=primary margins=10,8,10,8
onClick
crud ActionBarSubtitleEntity
events
beforeInit
_last = selectLast from Apontamento
beforeClose
_last = null
Exemplo:
Main main entity=AuthInput fields=obra
actions
Boletim
crud Boletim
Sair
exit
Exemplo:
MessageScr message title=Mensagem entity=MensagemRecebida messageField=texto dateField=data fromField=remetente
actions
ok
INSERT INTO ResumoMensagem (texto,data,remetente,enviada) VALUES (:texto,:data,:remetente,false)
Exemplo:
TableScr tableLayout title="Tabela"
views
recordList getRecords=_table
recordDetail fields=campo1,campo2 labels
events
beforeInit
_table = SELECT * FROM TabelaResumo
beforeClose
_table = null
Exemplo:
TableScr tableLayout title="Tabela"
views
recordList getRecords=_table
recordDetail fields=campo1,campo2 aligments=LEFT,CENTER labels
events
beforeInit
_table = SELECT * FROM TabelaResumo
beforeClose
_table = null
Exemplo:
TableScr tableLayout title="Tabela"
views
recordList getRecords=_table
recordDetail fields=campo1,campo2 fontssize=16,10,11
events
beforeInit
_table = SELECT * FROM TabelaResumo
beforeClose
_table = null
Exemplo:
Web webView fullScreen title="WebView"
loadUrl
return _urlToLoad
postVars
String user
String password
post
user = @"userName"
password = @"userPassword"
onHttpError
if httpStatusCode == 404
toast PAGE NOT FOUND
events
beforeInit
_urlToLoad = @http://www.somepage.com
O elemento mobileevents descritos no App, precisa referenciar os códigos de suporte, a seguir uma tabela descrevendo os eventos suportados e sua funcionalidade:
Código | Descrição |
1 | Battery USB is charging |
2 | Battery AC is charging |
3 | Battery is not charging |
4 | Network is not connected |
5 | Network is connected (Unknown) |
6 | Network is connected in VPN |
7 | Network is connected in Wifi |
8 | Network is connected in Mobile |
9 | Application will call Android System Installer to Update Xmova |