I an building and Android application store for my academic project. I would like to implement a feature that would allow the user to browse on their PC and remotely initiate downloads (and preferably installs of APK too) onto their android device - this service is already available with Google Play. Which android functions do I need to implement this?
You can use Google Cloud Messaging to create an interface using which you can talk to your app from the server. So basically send a simple message from the server which maybe tells the url of the hosted apk file (or any other relevant info). You can then download it to your android device.
After downloading maybe this could help you out : Android: install .apk programmatically
Or :
Intent promptInstall = new Intent(Intent.ACTION_VIEW)
.setDataAndType(Uri.parse("file:///path/to/your.apk"),
"application/vnd.android.package-archive");
startActivity(promptInstall);
The user will still have to give permissions explicitly to install.
You can install .apk files using android intents.
Intent promptInstall = new Intent(Intent.ACTION_VIEW)
.setDataAndType(Uri.parse("file:///path/to/your.apk"),
"application/vnd.android.package-archive");
startActivity(promptInstall);
So you would have to develop and application that listens to your php webservice and downloads and installs application accordingly.
Good luck!
Related
I wrote a simple Application in HTML with a form. I submit the form into a PHP file and insert the data into a database.
I created an App Service on Azure Portal + MySQL database
It took me a while to get the git Pipeline going (So Git - Azure Portal - deploying into a Webservice)
If I submit my form, the data will go to the database just fine.
Now I wanted to extend everything with a monitoring tool. So I tried Application Insights. But unfortunately, that doesn't work. If I understand it correctly it's because of the PHP file or to be exact the Php Stackruntime on Azure.
Is it possible to the monitoring anyway somehow? I only have experience in Php and Html a little bit of Java and Javascript.
Thanks.
I have deployed sample PHP App to Azure App Service.
So I tried Application Insights. But unfortunately, that doesn't work.
I have checked with both PHP 8.0 and 8.1 runtime version. The Application Insights option is disabled for PHP.
Thanks #Dmitry-Matveev for the Application Insights SDK.
Is it possible to the monitoring anyway somehow?
Check the below steps to Monitor Azure PHP App Service.
Way 1:
Check the Logs under Monitoring.
Way 2:
Enable Application logging (File System).
Navigate to the Log stream to check the Live metrics.
Also, we can check the metrics section to monitor the App.
Hope you can help with, we are building a new customer portal and would like to use Azure B2C for various reasons including the need to interface with MS Dynamics CE. However, our tech stack is PHP, Slim to be precise.
Does anyone have experience of delivering a fully functioning production app with this configuration?
Would love to hear from you and have your assistance.
Please get in touch.
Thanks, Duong.
To deploy the PHP Web Application using Azure AD B2C,follow the below steps :
Install PHP, Laravel (it's web framework).
Create a Web App in Azure Portal B2C blade by noting the ClientID and Client Secret from the Application.
Clone and customize the source code from github: git clone https://github.com/Azure-Samples/active-directory-b2c-php-webapp-openidconnect.git
Download the latest version of the php security library in your repo.
To deploy into Azure, you need to set-up the Deployment settings by selecting Local Git Repository and setting up the username and password for deployment.
git init and git remote add azure [deployment url] commands are used to set up deployment to azure.
git push azure master to deploy online.
Instead of depending on their own code, developers can rely on B2C for consumer sign up and sign in.
Using OpenID Connect, we can validate the authentication token of the users connected with the Azure B2C of the PHP Web Application.
Please refer this GitHub article for code and more information.
I've implemented B2C integration on Azure with a Slim 4 application, what is it you need to know?
In short:
Set up B2C in Azure
Set up Client ID en Secret in external provider and store in Azure Key Vault
Create a middleware service that looks for the client token in requests for the routes you want to protect
I haven't written a blog about it yet, but expect one in March at www.azurephp.dev with a working example using Slim 4. In the mean time, I hope this short answer works for you. If not, ping me.
Can we upload image files to a GCP running compute engine directly using PHP?
I know that it can be done using the backend ssh on GCP.
I have a solution that works in my local system to upload files but does not work on GCP.
Based on initial research it appears that GCP does not allow file upload directly.
Need confirmation though or if there is a way in which file upload can work, please enlighten.
I do not think it can be done directly through php, through ssh yes.
You can upload files with PHP.
If you want to upload to the server local disk, things become a bit simpler. Just ensure you have PHP configured for upload: PHP File Upload
If you want to upload to Google Storage, say to a bucket, you'd need to authenticate and get access there. Google Cloud SDK can provide this. Then you can install API Client Libraries for PHP and optional Cloud SDK components. That way you might call gcloud shell command or use API. Cloud SDK will provide transparent connection and authentication for you so that you can upload to the Google Storage.
Please see:
Cloud SDK
Google API Client Libraries
I've created a project using openshift and php (i use fillezila for server transfers etc.. not git)
As part of my project i want to upload files to my google drive,
google API state that i should install the Google Client Library with composer.
I couldn't find a simple beginners guide on how to use the composer in openshift and what should i do with it. I am a complete beginner in php and composer use.
Bottom line i want a simple way to upload file to google drive without authentication every time. (for example PHPMailer let you send mail without authentication every time my PHPMailer script sends email to gmail, my password and user name are part of the script).
If I must use google drive API.
Please explain how to use composer on openshift for google drive to install the library using composer and upload a file to the drive.
I have somewhat successfully followed this tutorial:
http://blogs.msdn.com/b/silverlining/archive/2012/06/21/creating-a-php-web-role-in-windows-azure.aspx
However I am stuck. I am not entirely sure how to create an instance in the azure management portal, after I have set up the web role on my local machine.
There are currently no instances set up. When I try to set them up, it asks me to upload a package and configuration file. Where can I find these.
Thanks
This should be a comment on your question but I can't make comments yet.
When creating a new cloud service do not check the box "Deploy a cloud service package."
If you use + -> Compute -> Cloud Service -> Quick Create it won't ask for a package either.
Once it's done being created you can open it up to download the credential file for Power Shell.