how to pass data between screens using intent in MIT app inventor - app-inventor

I am a beginner in MIT app inventor tool. I am stuck on passing data between screens. I have searched a lot of time on the internet. I got lots of results using activity starter with intent, but how it is possible in MIT app inventor?
If in android we can pass data like this
Intent i = new Intent(this, ActivityTwo.class);
i.putExtra("Value1", "This value one for ActivityTwo ");
i.putExtra("Value2", "This value two ActivityTwo");
startActivity(i);
by using bundle we get that data, but how it is possible in MIT app inventor?

You have 2 options to pass data between screens:
to use the open another screen with start value blockexample:
as you can see, a value also can be a list...
then in the other screen you can get the data using the get start value block
to use TinyDBfor example in Screen1 just store the data in TinyDB and read it again in Screen2
see also this example

Related

How would I go about getting the orientation of my current screen in Windows using Ruby?

I am using Ruby 3.0 and I would like to know how to check if the users screen is portrait-flipped (or upside down) assuming the user only has 1 screen.
I would say that since Ruby is a server-side language, you will need to rely on a browser-side tech first, such as JavaScript, as getting the size and orientation of a screen would be done browser-side.
There are probably JS libraries for that if you prefer, but here are some docs to detect device orientation on some browsers:
https://developer.mozilla.org/en-US/docs/Web/Events/Detecting_device_orientation
https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation
With the value obtained in JS, you would then do some AJAX call to your ruby code to send the value to the backend. (you would create a API controller that receive orientation data and update your ruby objects, or whatever you want to do with the orientation)
I hope this is helping you go in the right direction!

Xamarin forms - lottie animations

I'm a beginner with Lottie, and I have a basic question:
I have a band which provides my app information about the heart rate of the user in the BPM unit.
I had downloaded from lottiefiles.com a JSON file of heart animation which shows exactly what I want - number BPM.
My problem is that I don't know how to set dynamically values in the animation whenever I get a new BPM value from the band.
Unfortunately, I didn't found how to do so after searching on the internet.
I suspect that maybe the function animationView.SetValue can help, but I don't sure exactly how.
Any help will be appreciated!!

Xamarin - take screenshot in android

I am working on barcode scanner integration which captures the image after barcode is scanned. I am using XZing tool to do it but it doesnt have this functionlity
So what i am trying to do is to take screenshot of the screen after successful scan of barcode. I am following below article (from one of the SO answers)
http://danielhindrikes.se/xamarin/building-a-screenshotmanager-to-capture-the-screen-with-code/
Now the problem is here that it does takes screenshot. But the camera part is coming in total black color (no image). I can see top and bottom frame of my app. I am passing "MainActivity" class in Activity property. Is there a way to solve this problem?
There are other solutions to take a "real screenshot" of what the user can see.
Have a look to MediaProjection and CreateScreenCaptureIntent:
https://github.com/xamarin/monodroid-samples/blob/master/android5.0/ScreenCapture/ScreenCapture/ScreenCaptureFragment.cs
And in Android native to screencap:
Runtime.getRuntime().exec("screencap -p /sdcard/screen.png");
I think they could work for you.

Windows phone 7, code to indicate how many clicks of an image?

So I had a thought -- Say you have pictures streaming to your app from a webpage. Is there any way to put code in the app to find out how many times a person has tapped the image, or how many times they have pressed a button belonging to the image?
Think of the "Like" button for facebook, where people can have +1, and see the total count of how many people also "like" it.
If so, how would one go about coding this?
You question is very vague...
If you want the count of how many time the image was loaded you can count that server side every time the picture is downloaded. If you want to give them a "like" button then you can add that to your WP7 app and call a page server side or a WCF service with some ID value for the picture to track the "likes".
For example:
HTTP Version
You can download the pictures from you webserver using a link such as "http://www.mysite.com/pictures.aspx?ID=Funnyfile.jpg&DeviceID=29393848293".
ID would be the unique ID for your application to know which picture to load
DeviceID would be the Device ID for the WP7 device loading the picture in your app (MSDN doesn't recommend you use the Device ID to identify unique users so you might need to adjust this value).
You could then set the source of an Image Control to that URL to load the image.
Uri uri = new Uri("http://www.mysite.com/pictures.aspx?ID=Funnyfile.jpg&DeviceID=29393848293", UriKind.Absolute);
ImageSource imgSource = new BitmapImage(uri);
ProfileImage.Source = imgSource;
A WCF Service can use a similar manner and would allow you to pull a collection of images back from the server if you need to. The basics of building the service wouldn't be overly complicated, but I am omitting and example to save time.

What's the 2D barcode on Google's new goo.gl URL shortner?

As per an example URL shortened here:
http://goo.gl/info/kW1c#week
What is the displayed 2D barcode for (copied here):
It's actually a 2D barcode, and it is a QR code. It is meant to print on stickers and what not to read with your cell phone camera.
http://en.wikipedia.org/wiki/QR_Code
Takes you to the webpage of the shortened URL (usually for mobile devices that can read a QR code).
bonus:
to get a QR code for a goo.gl URL - append .qr :
http://goo.gl/kW1c.qr
Quick answer: printing these barcodes on a webpage is a common way to let people visit/bookmark that page from their phone (using the phone's camera and barcode reader function).
It is important to understand a barcode is a piece of text data, and not an instruction. For example, the above bar code contains the text "http://goo.gl/info/kW1c".
It is the application reading the barcode which interprets it as an instruction. The data is read by a barcode reading application (for example, on a smart phone), and then an appropriate action is typically launched depending on the type of data. For example, if the text starts with "http://" a browser may be launched with that URL. If the data starts with "phone:" the phone application may be launch with that number.

Resources