Blog Arşivleri

Using Random Function Without Repetation and Lists in App Inventor 2

Hi,

Today i show you how to use “random random integer from” and “make a list” block. The aim of the program is, when i press to button1 i will get a random character from my list.  And these characters will not repeat theirselves.

11

At the top block, i made my variable declarations. Variable bbb is for the maximum value of list’s index. indexno is for the index’s number and datass is my list. Index starts from 1, for example index number of a is 1, and the index number of e is 5.

22

At this section, when i press the button1 it checks the value of bbb is equal to 1? Reason of that when the value of bbb is 1 it means when we press again button1 there won’t be any element at list. So when it equals to 1 , i make it disable to press.

“Remove from list” takes the certain indexed element from list and places its place with the next one. For example if he function takes the element that has the index number as 2, 3rd element will be the new 2nd element and 4 to 3 and also 5 to 4.

33

Now, we have disabled press buton and when we press reset, all values will download to the list. Also the maximum value of index. Because there will be no element of my list at the end of the program.

44

Designer Window

 

Screenshot_2016-04-02-12-04-20

Program Output -1-

Screenshot_2016-04-02-12-04-30

Program Output -2-

Good Luck,

gökhan öztürk

Reklamlar

Making Downcounter at App Inventor 2

Hi everybody,
Now i will try to make downcounter at app inventor2.
At my first post  about app inventor, i made button control.
In this application we will use it and we will create a downcounter.

We will use clock, button and label component.

design

When we push the start button, a counter will start to count from ten to zero..

block

I defined a variable named “value1” that has the value of ten. At the beginning -when screeen initialized- clock is disabled. When we push the button, value of the “value1” will decrease one-by-one until it reaches to zero. When the counter’s value is zero, button’s text will change to “finished”. Then it will wait for another input as pushing.

Best Wishes,

Gökhan Öztürk

Usage of Slider Component at App Inventor 2

Hi, my second post will be about usage of slide component at app inventor 2.

Slider is a component that its value change by the position. We can define the max. and min. value.

I took a label and slider from user interface and put them in to a VerticalArrangement that taken from layout.

design

When we change the slide its value will change and then label will change. If the thumb position is lower than 25 label will be “b” and if the thumb position is higher than 25 label will be “a”

blocks

Program output at screen.

gokhan

best wishes,

gökhan öztürk

Button Control on App Inventor 2

Hi everyone,
Today i hope i will create my first android application. As i said, i never intented to make
an android application before but i always curious about it. I will use app inventor to build.
App inventor created by google and now it is developing by MIT so the programme is called now by MIT App Inventor (2).

Firstly, i worked online but my wi-fi are is restricted so i searched any possibility about working offline, now i am using offline and  application’s emulator to see my programme’s working.

Secondly, i wanna mention about documents on the web. Generally all applications are same, like; barcode application, playing sound, etc. But i think we should learn the basics step by step like;  using buttons,etc.

Finally, we can start my first application. Purpose of this applicaion is to learn the usage of buttons.

Let’s start;

I dragged two buttons and one label from “user interface” at left side and dropped to “Viever”. And also used “Tablearrangement” from “layout”. Layout helps us to keep items on together.

design screen

Then, i switched my screen from “designer” to  “blocks” at right up side. After these i created a variable named “total1”, it keeps the number that will increased/decreased by buttons.

blocks

Later on, i connected the emulator from connect -> Emulator.

Here our emulator screen.

Regards,

gökhan öztürk