|   FORUM      |     Tutoriales    |     KIO4 |      
   Start B4A (Basic4Android) App inventor 2 Arduino
   Elastix - VoIP Things of Windows Interesting Webs  Telecomunications

 


Nuevo concurso para España, Argentina, Brasil, Chile, Colombia, Ecuador, México, Perú y Portugal.

App Inventor 2
Programming mobi
le phones with Android 
by App Inventor 2 - Juan Antonio Villalpando

- Initiation Tutorial App Inventor 2 -

Return to tutorial index

____________________________

50.- ActivityStarter.

ip50_activity_starter

- Presentation.

- ActivityStater is used to start another activity, that is, to run another program, either those already on the phone or those who have done us.

- To start such programs is necessary to know some of your data, for example:

Action: android.intent.action.MAIN
ActivityPackage: com.google.android.camera
ActivityClass: com.android.camera.Camera

- This data can obtain them if we have your installation file .apk
- We open your .apk with Winrar, we look for the file youngandroidproject/project.properties

and then we can copy them.

- Here's the tutorial in about ActivityStarter

- Depending on the application they more or less parameters needed for starting.

_________________
Design

_________________
Blocks

 

Google maps can also be put:

Action: android.intent.action.VIEW

Class: com.google.android.maps.MapsActivity

Package: com.google.android.apps.maps

DataUri: geo: geo:latitud,longitud?z=20

____________________________________
____________________________________
____________________________________

Another example of ActivityStarter

50B.- Read a pdf file.

ip50B_activity_starter_pdf

PDF files are a minor quibble for Android, we need to have a PDF viewer installed on your mobile phone to view these files.

You can download the Adobe Acrobat Reader, for example: https://play.google.com/store/apps/details?id=com.adobe.reader&hl=es

In this example we will see how to read a pdf file by Activity Starter.

We upload file acueducto.pdf our application. It will be saved in file:///mnt/sdcard/AppInventor/assets/acueducto.pdf

http://kio4.com/appinventor/imagenes/acueducto.pdf

Another way to view pdf file is uploading the file to a website and then by Google viewer, view the file, this test will do with the file sanctipedri.pdf found in:

http://kio4.com/appinventor/imagenes/sanctipetri.pdf

_________________
Design

_________________
Blocks

By Google viewer https://docs.google.com/viewer?url = we can read a pdf file

https://docs.google.com/viewer?url=http://kio4.com/appinventor/imagenes/sanctipetri.pdf

-------------------------------------------------- ----

The assets folder is a folder that each Android application where you can save certain file types: .txt, .htm, mp3, wav, gif, png, jpg.

In the assets folder you can save .pdf files, but can not be read directly from that folder, first you have to copy them to another folder.

- To copy files from one folder to another can be used extensions like this that indicated, experimental:

http://puravidaapps.com/file.php

- It is better to have a folder and the pdf file in that folder:

file:///mnt/sdcard/mi_carpeta/acueducto.pdf

- To create folder App inventor can use this trick based on Canvas (Canvas):

https://lh4.googleusercontent.com/-1pFqAnGRRz8/VEPqWfbzn0I/AAAAAAAAATM/rjG5WRxbclM/s1600/folder_trick3.jpg

_________________
Comments

In this example we visualize two PDF files using two methods.

- The first is to keep our file acueducto.pdf in the same directory as the application and then read through the pdf viewer you have installed on our mobile.

- The other way to save the file on a web server and read by Google viewer.

If you want the viewer is the Adobe Acrobat Reader, writes this in the Activity Starter:

Action: android.intent.action.VIEW
ActivityClass: com.adobe.reader.AdobeReader
ActivityPackage: com.adobe.reader

_________________
File location acueducto.pdf on mobile

- It may happen that the file acueducto.pdf not in the direction of the mobile indicated: file:///mnt/sdcard/AppInventor/assets/acueducto.pdf

- Let's try to fix it.

- Generates the file ip50B_activity_starter_pdf.apk and install it on your mobile.

Installed on the mobile a file browser, for example Astro:

https://play.google.com/store/apps/details?id=com.metago.astro&hl=es

Locate the file acueducto.pdf , in my case it is on file:///mnt/sdcard/AppInventor/assets/acueducto.pdf

That is the direction we must put on the block DataUri. Case-sensitive.

-------------------------------------------------- -

- Another way to locate the file acueducto.pdf

Install the application on your mobile: Web PC Suite:

https://play.google.com/store/apps/details?id=com.geeksoft.wps&hl=es

- This application and saw in the tutorial: Moving files from mobile phone to computer and vice versa .

- Read this tutorial. Connect your computer to the same wireless network where you have mobile. Using this application connects mobile and computer using a web browser, knowing the IP mobile.

- Using your computer you can explore the various folders and files on the sdcard mobile. Locate the file acueducto.pdf

In my case is in file:///mnt/sdcard/AppInventor/assets/acueducto.pdf

____________________________________
____________________________________
____________________________________

Go down to your Mobile "App Inventor ActivityStarter"

To study the ActivityStarter it is advisable to download to your mobile an application from the Google Play called "App Inventor ActivityStarter ".

The install, choose an application, you click the button demo Load and then Start Activity.

You will see the necessary parameters for many of the applications you have on your mobile.

Some of the choices will not work, since it seems that the parameters are made for mobile application author, but many do work and is a good learning element.

Check Calculator and House for example.

____________________________________
Consultation document ...

AppInventor_ActivityStarter_and_IntentsTracker

Look for it on the internet.

____________________________________
Down to your mobile "ASTRO"

You can get the parameters of your mobile directly.

- You download a file browser, such as ASTRO

- You press the Up icon repeatedly until you reach the mount point, indicated by /

- The mount point for the people of Windows, is like the root directory.

- We move vertically on the screen and enter the directory system (/ system)

- Inside / system entered app (/ system / app)

- That we will see applications that have the system default.

- We enter Calculator (or calculator)

- We will get two buttons, one called "File Browser" to browse files corresponding to this application and another called "Open App Manager" to see application data.

- Click on "Open App Manager"

- Top out two tabs, click on "Details"

- There see PackageName data, depending on the application will also see Classes, ...

com.android.calculator2.Calculator

com.android.calculator2

- What we see is not the action , this is the start window.

- Try putting:

android.intent.action.MAIN

android.intent.action.VIEW

android.intent.action.LAUNCHER android.intent.action.LAUNCH

android.intent.action.SCREEN1 (This is usually the input window of our applications with App Inventor, ie the SCREEN1 window)

In the previous program "App Inventor ActivityStarter" on part of Help Help, you can find several programs that perform system log, using filters can see the addresses of the applications that interest us.

_________________
Reviews.

 

Among the "App Inventor Starter Activity" and "ASTRO" program you can study the application and start the "ActivityStarter" element

Internet searches which is the parameter that you put in the Action.

__________________________________

 

- My e-mail:
juana1991@yahoo.com
- Who I am. - Cookies. Texts and images propierty autor:
© Juan A. Villalpando
Not copy texts neither images.
We use our own cookies and third-party cookies on our websites to maintain the session and your preferences, customize your user experience and obtain website use statistics.
Si continúa navegando consideramos que acepta su uso. OK    Más información