RobYost Posted November 8, 2017 Share Posted November 8, 2017 I think I remember a thread that addressed this, but I can not find it. I want to create an iPhone app and an Android app that just goes to my website that runs my UniGui application. Does anyone know the easiest way to accomplish this? I have tried some of the free app builders, with limited success. People want to download an app not navigate to a web page, or add a shortcut to their phone, plus it is another way to advertise. Thanks, Rob Quote Link to comment Share on other sites More sharing options...
adragan Posted November 9, 2017 Share Posted November 9, 2017 Check this , maybe it's what you want. http://chapmanworld.com/2017/08/11/embed-the-chromium-browser-in-your-delphi-projects-using-dcef3/ Quote Link to comment Share on other sites More sharing options...
RobYost Posted November 9, 2017 Author Share Posted November 9, 2017 That seems to make a VCL or FMX application. I need an iPhone App and an Android App. Quote Link to comment Share on other sites More sharing options...
Wicket Posted November 9, 2017 Share Posted November 9, 2017 If this is the route you want to go, the Delphi option would be to create a firemonkey application, with a TBrowser, which loads the URL of your unigui app on create. I've done this with android and it works as you would expect. Sent from my Pixel using Tapatalk Quote Link to comment Share on other sites More sharing options...
mhmda Posted November 9, 2017 Share Posted November 9, 2017 We use Android Studio / Xcode. Quote Link to comment Share on other sites More sharing options...
RobYost Posted November 9, 2017 Author Share Posted November 9, 2017 Mohammad: I've tried Android Studio but I couldn't get it to work. I will look back and see what the problem was, it was a few months ago. Dan: I have XE6 and it won't make an app for the current release of Android. At this point, I can't afford to update to the latest version of Delphi. Quote Link to comment Share on other sites More sharing options...
RobYost Posted November 9, 2017 Author Share Posted November 9, 2017 Mohammad: I went back to my Android Studio and ran it and it worked in the emulator. I don't know much about android apps, so what I did was email the apk file to myself. On my phone, I opened the attachment and clicked install. It added an app on my phone, but when I click on it pops up a message: SimpleLandlord has stopped X Close Any ideas? Quote Link to comment Share on other sites More sharing options...
RobYost Posted November 9, 2017 Author Share Posted November 9, 2017 Got it working...I had uploaded an older apk. I need to figure out how to upload to google store, but I think I am almost there. Hope this helps someone. AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.simple_landlord.simplelandlord"> <uses-permission android:name="android.permission.INTERNET" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppFullScreenTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> styles.xml <resources> <style name="AppFullScreenTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> </style> </resources> activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.simple_landlord.simplelandlord.MainActivity"> <WebView android:id="@+id/activity_main_webview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </android.support.constraint.ConstraintLayout> build.gradle dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.0.0' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' } MainActivity.java package com.simple_landlord.simplelandlord; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.webkit.WebSettings; import android.webkit.WebView; public class MainActivity extends ActionBarActivity { private WebView mWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mWebView = (WebView) findViewById(R.id.activity_main_webview); WebSettings webSettings = mWebView.getSettings(); mWebView.setInitialScale(1); mWebView.getSettings().setLoadWithOverviewMode(true); mWebView.getSettings().setUseWideViewPort(true); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.loadUrl("https://YOUR_URL/m"); } } 1 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.