[Free] Install app. Notify to user of a new version has come out


#1

Hi friends,

with this extension we can install easy an application, .apk file.

We do not need ActivityStarter component.
instalar8

Example 1: Download an .apk file of a web server and install.

instalar7

  • Download file from: http://kio4.com/appinventor/p_sumar.apk

  • This file is stored in:
    fileName = /mnt/sdcard/My Documents/Downloads/app_inventor_15678912345.tmp

  • Then Install by extension.

  • Look, end in .tmp (not .apk) but install.

  • Mediante esta extensión podemos instalar facilmente un archivo .apk sin necesidad de utilizar el componente ActivityStarter.

  • Simplemente suministramos la dirección en donde se encuentra el archivo, consulta los ejemplos:

http://kio4.com/appinventor/244_extension_instalar_app.htm
com.KIO4_Install.aix (5.5 KB)


#2

Example 2: Notify the user of a new version has come out

In this example:

  • Every time the user starts the application…

  • Download number of version new.

  • Comparte version_actual with version_new

  • If is equal, then continue app: It is the sum of two numbers

  • If not equal, open other screen.

  • When user Click in Upload Button1.

  • Download file from: http://kio4.com/…/p_sumar.apk

  • To /mnt/sdcard/My Documents/app_inventor_15671234.tmp

  • Install by this extension.

  • Run new version of app.

  • Here the explanation in Spanish:

http://kio4.com/appinventor/129C_actualizar_instalar.htm

p_sumar6.aia (10.0 KB)
p_sumar7.aia (10.1 KB)

You can try this process download p_sumar6.apk by this QR
p_sumar6


#3

This would be very useful for those people, because for some reason the app can not be uploaded to the Play Store.


#4

As I wrote, this is other way to install, by QR
Other way to install an app is by QR: this is a tutorial in Spanish: http://kio4.com/appinventor/index.htm#publicar


#5

Long and boring method to check the new version available.

I have much simpler practice to check new version available in playstore

I did this with firebase and a label


#6

For those who don’t use and does not need Google Play, it’s excellent!!! I’m one of them!!! Thanks, @Juan_Antonio.


#7

OK @indian, but I do not use your methods because I do not like them or they interest me


#8

Nice and great Extension Bro. keep it up. there are people who never like to update even if the app is updated on playstore. They prefare to keep older versions and this extension will come in handy for that.


#9

Look at the White colour and Green Colur Icon of Android button at the Bottom Left Corner of these both images.

I used just a label to compare with the value stored in Firebase.

If Update is available the Android Icon will turn into green colour. Its that simple!

I created myself an master app, Look ate the screenshots hereunder

When ever I uodate the app, i change an invisible label with the new version and compare with the firebase value

when i change the value in the Firebase master app, The Android icon turns into Green!


#10

@indian

You do not show the code of blocks of your application, but I think it is longer than the one that I have put in the example. I also consider it boring, but that is everyone’s opinion.
In your case you use Firebase, but I think it can be done without Firebase.


#11

How come you say that it is everyone’s opinion? @Juan_Antonio


#13

@Shivendra_Kr_Sahu, Hi, you have read the previous posts?
I am referring to indian user, not the natives of the Indian country.
And I just said that each person has an opinion, it was a response to ‘indian user’.


#14

Does the installation work in background?


#15

Hi @Jerin_Jacob
I have only tried it in small files and I have not consulted if it works in background.

The java code of install is ‘classic’

	////////////////////// FUNCION ////////////////////////////////////////////////////////////////////// 
    // Funcion de la instalacion.
    @SimpleFunction(description = "Install app. Set app path. Example: /mnt/sdcard/Download/my_app.apk")
    public void Install(String pathApp) {
	 String path = "file://" + pathApp;
		
Intent instalacion = new Intent(android.content.Intent.ACTION_VIEW);
instalacion.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
instalacion.setDataAndType(Uri.parse(path), "application/vnd.android.package-archive" );
context.startActivity(instalacion);
    }

#16

and why not complete source:

package com.KIO4_Install;
//  © Juan Antonio Villalpando 
// kio4.com
// Instalar una aplicacion. Febrero 2018.

// You can eliminate some lines
import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.DesignerProperty;
import com.google.appinventor.components.annotations.PropertyCategory;
import com.google.appinventor.components.annotations.SimpleEvent;
import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.annotations.SimpleProperty;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.common.PropertyTypeConstants;
import com.google.appinventor.components.runtime.util.MediaUtil;
import com.google.appinventor.components.runtime.*;

import android.app.Activity;
import android.content.Intent;
import android.content.Context;
import android.net.Uri;

@DesignerComponent(version = KIO4_Install.VERSION,
    description = "Install an app. Set path. Example: /mnt/sdcard/My Documents/Downloads/my_app.apk. " 
	+ "Juan Antonio Villalpando - KIO4.COM ",
    category = ComponentCategory.EXTENSION,
    nonVisible = true,
    iconName = "http://juanant91.byethost3.com/bajar2.png") 
@SimpleObject(external = true)
public class KIO4_Install extends AndroidNonvisibleComponent implements Component {

    public static final int VERSION = 1;
    private ComponentContainer container;
    private Context context;

    public KIO4_Install(ComponentContainer container) {
        super(container.$form());
        this.container = container;	
        context = (Context) container.$context();
    }

	////////////////////// FUNCION ////////////////////////////////////////////////////////////////////// 
    // Funcion de la instalacion.
    @SimpleFunction(description = "Install app. Set app path. Example: /mnt/sdcard/Download/my_app.apk")
    public void Install(String pathApp) {
	 String path = "file://" + pathApp;
		
Intent instalacion = new Intent(android.content.Intent.ACTION_VIEW);
instalacion.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
instalacion.setDataAndType(Uri.parse(path), "application/vnd.android.package-archive" );
context.startActivity(instalacion);
    }

}	// ==> FIN

#18

you can use firebase to notifer users without any extensions
when firebase data changed
if get tag = UPDATE
if get value NOT= global(version)
then call notifer show choose dialog
when nofifer after choosing do…


#19

@Issam_GHIZLAN

This extension is to install an application.

instalar8

It is not to notify a new version.
I have simply used simple examples of use.


#20

right bro i talking about notifer users
your extension great for apps not in google paly


#21

Nice icon


#22

can you share the link where you explained?