jahlxx Posted September 26, 2022 Share Posted September 26, 2022 Hi. Some easy way to create an apk as a url of an unigui application? Any recommended tool? I need generate app for android and for ios if possible. Thanks. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 26, 2022 Share Posted September 26, 2022 32 minutes ago, jahlxx said: Hi. Some easy way to create an apk as a url of an unigui application? Any recommended tool? I need generate app for android and for ios if possible. Thanks. maybe here @Hayri ASLAN will help : I hope all these topics will point you in the right direction for your work. In my practice I use Android Studio + WebView + uniGui Quote Link to comment Share on other sites More sharing options...
jahlxx Posted September 27, 2022 Author Share Posted September 27, 2022 Ok. I'll try. Thanks. And other question. I have 2 versions of an delphi + unigui application, one for desktop, and one for mobile (touch). Is there any way to run the correct one depending the client device? For example: When go to the url "www.mydomain.com/myapp" in the web browser, if the client is a computer, go to that url as it is, but if the client is a mobile, go to the url "www.mydomain.com/myapp/m". Is there any option to do that? In the server? in the application? ?? I hope I have been clear enough. Thanks. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 27, 2022 Share Posted September 27, 2022 19 minutes ago, jahlxx said: Ok. I'll try. Thanks. And other question. I have 2 versions of an delphi + unigui application, one for desktop, and one for mobile (touch). Is there any way to run the correct one depending the client device? For example: When go to the url "www.mydomain.com/myapp" in the web browser, if the client is a computer, go to that url as it is, but if the client is a mobile, go to the url "www.mydomain.com/myapp/m". Is there any option to do that? In the server? in the application? ?? I hope I have been clear enough. Thanks. Hello, Yes You can ! 1. first check when session is created what device is calling you app If (UniApplication.UniPlatform <> [upDesktop]) 2. then if is mobile device redirect to www.mydomain.com/myapp/m procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject); begin URLRedirected := False; end; procedure TUniMainModule.UniGUIMainModuleHandleRequest(ASession: TObject; var Handled: Boolean); begin If (not URLRedirected) AND (UniApplication.UniPlatform <> [upDesktop]) then begin if (UniSession.ARequest.URI = '/HandleEvent') AND (TRIM (UniSession.ARequest.Referer) <> '') then begin mobileURL := StringReplace (UniSession.ARequest.Referer,'www.mydomain.com/myapp','www.mydomain.com/myapp/m',[rfReplaceAll,rfIgnoreCase]); UniSession.AddJS('function redirect() {' //clear hash - a from url + ' var url = ' + mobileURL+ ';' + ' var hash = window.location.hash' + 'endss' + ';' + ' var index_of_hash = url.indexOf(hash) || url.length;' + ' var hashless_url = url.substr(0, index_of_hash);' + ' location.href = hashless_url;' + '}' ); //redirect to www.mydomain.com/myapp/m Handled := True; UniSession.AResponse.ResponseNo := 308; UniSession.AResponse.ResponseText := 'redirected'; UniSession.TerminateAfterSecs(1); URLRedirected := True; sleep (2); UniSession.UrlRedirect (mobileURL); end; end; end; Quote Link to comment Share on other sites More sharing options...
irigsoft Posted October 1, 2022 Share Posted October 1, 2022 @jahlxx, hi were you able to try my code? Quote Link to comment Share on other sites More sharing options...
jahlxx Posted October 1, 2022 Author Share Posted October 1, 2022 Hi friend. The solucion was hybrid application. Thanks. 1 Quote Link to comment Share on other sites More sharing options...
Aleena Posted April 20, 2023 Share Posted April 20, 2023 Hi guys I am a new member of this forum site ! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 20, 2023 Share Posted April 20, 2023 I don't understand why are you doing this !? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.