Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Using String Variable with Kotlin Programming Language |Part-2|

String Variable with Kotlin

Greetings!

Hello Everyone here, Creating another video to demonstrate how to use String Variables in Android Studio using Kotlin Programming language.



 

Environment

Software: Android Studio
Programming Language: Kotlin

Summary

Its a beginner example and Part two of my Kotlin Programming Guide.

To declare any variable in Kotlin, you can simply use two keywords.

Var and Val

First, we are going to use Var Variables is the General variable that can be changed anytime throughout the Kotlin programming.

However, the Val variables are the constraint variables and can be declared only once.

Practice tasks

1. Open Android Studio and go to your project > Java > <com.folder> and edit the Kotlin file to create the variable:

fun main()
{
var name = "James"
val lname = "McDonald"
println(name)
println(lname)
}

Result: Run the compilation and see what happens, Check for error and update it here in comments.

2. Try to reassign a new value to the "var" variable name and the "val" variable lname and see if we can change the value at the later point during our program.

Result: Share the error, if any.

3.  Assign null values to the variables and check out for the outcome. Check for error.
Assign null String declaration to the available by using

:String? Next to the variable name.

Result: Share the error, if any.

We can also assign variables outside the function as well using this method variable will be easily accessible to the other Functions throughout the program.

While declaring the string variable, you may think about how the program decides what kind of variable it. Kotlin chooses the type of variable with very first user input. Like when you mentioned string value to the variable with the quotes that time it assigned, they string type to the variable, and that variable name will remain String Variable throughout the program.
Similarly, if we are going to assign Integer or Float value to the variable for the very first time, it will take is as the Float/Integer variable. We will discuss other types of variables in another post in more detail.

Kotlin - Control Statements |Part - 3|

Control Statements Part-3

In Kotlin Programming language, the Control Statements are similar as in most of the programing language.
Control Statements are the conditional statements that let us create a set of options to make a decision to produce the choice of output if a different type of input supplied to the program.




The Conditional Statements are 
  • if Statement
  • if-else Statement
  • if-else as expression
  • when Statement

if Statement: 

In an, if Statement, program checks for the Condition to match with the given option if matches then perform the activity following it

Syntax

if(<condition>)

{
    <Set of activity>
}

Example 1:

val name: String? = "James"
val lname = "McDonald"
var newVar: String? = null 
 
fun main()
{
if (name == "James")newVar = "Yes the name is " + name 
println(newVar)
}

Example 2:

var newVar: String? = null
var y = 20 
var x = 10
 
fun main() {
if (x > y) newVar = "x is greater number " + x
if (x < y) newVar = "Y is greater number " + y
println(newVar)
}


if-else Statement:

In an if-else statement, program checks for the Condition to match with the given option if matches then perform the activity follows it, if not matches the Condition, then conducts the other event.  

The syntax used for if the Statement is as below: 

if(<condition>) <Set of activity>
else <set of activity>

Example 1:

var newVar: String? = null
var y = 20 
var x = 10
 
fun main()
{
if (x > y) newVar = "x is greater number " + y
else newVar = "Y is greater number " + y
println(newVar)
}

Example2:

val name: String? = "James"
val lname = "McDonald"
var newVar: String? = null
fun main()
{
    if (name == "James")newVar = "Yes it is " + name
    else newVar == "No it is the Something else"

println(newVar)
}

if-else Statement as an expression:

In an if-else statement, it is just like the usual if-else Statement, but in this one, we use curly braces to supply multiple expressions instead of a single line of expression.

Syntax:

if(<condition>)
{
    <Set of activity>
}
else{
    <Set of activity>
}

Example 1:

val name: String? = "James" 
val lname = "McDonald"
var newVar: String? = null
fun main() { if (name == "James") { newVar = "Yes it is " + nameprintln(newVar) } else { newVar == "No it is the Something else"println(newVar) } }

Example 2:

var newVar: String? = null
var y = 20 
var x = 10
fun main() {
 
if (x > y)
{
newVar = "x is greater number " + y 
println(newVar)
}
 
else
{
newVar = "Y is greater number " + y 
println(newVar)
}
}

when Statement:

In a when Statement, program checks for the Condition to match with the multiple options to make a choice, when it matches one of the options, then it performs the activity following the decision.  

Syntax:

when(<variable>)
{
    <variable condition> -> <output>
    <variable condition> -> <output>
    <variable condition> -> <output>
    <variable condition> -> <output>
    else -> <output>
}

Example:

fun main() {
    when(x)
    {
        1 -> println("You selected  1")
        2 -> println("You selected  2")
        3 -> println("You selected  3")
        4 -> println("You selected  4")
        else -> println("Invalid range outside 1 to 4")
    }
}

Kotlin Program "Hello World" codded using Android Studio |Part-1|

Kotlin- Part 1

Introduction: 

 This article describes how to compline Kotlin programming inside the Android Studio for beginners tutorial.

Environment:

OS: Windows 10
Application: Android Studio

Description:

Kotlin is an alternative JVM programing language to create Android Application.

Most of the learners start learning Kotlin with IntelliJ and later start to work on Android Studio.

However, the learners can, from the beginning, learn this on Android studio.

In a small series of tutorials on Kotlin Programming, we introduced the tutorial to do a Kotlin Programming directly on Android Studio. In Part-1, we have a quick demonstration of running a "Hello World" program in the Android Studio application.

Kotlin Programming using Android Studio:




We welcome all our viewers to watch the video of the easy to use Kotlin programming to print "Hello World" into the Android Studio Terminal.

Some related questions:


What is IntelliJ?
Answer: IntelliJ is an Integrated Development Environment(IDE) software written in Java for making software. It was developed by Jetbrains(formally known as IntelliJ) in 2001 to Develop Java-based software with more sophistication; to learn more about IntelliJ history, please visit the Wiki link for IntelliJ.
What is Android Studio?

Android Studio is another IDE that is based upon IntelliJ and is specifically designed to create Android-based applications.
Wiki link to Android Studio.

What is Kotlin?

Java is a language that we still use to create as a preferred language to make Android applications. However, Jetbrains developed the programming language as an alternative to Java named it as Kotline, a new language buddle with more sophistication, ease, and it supports multiple platforms.
Wiki Link to Kotlin

 

How to watch movies from Video Hosting Websites on Android TV?

Unable to play Video from Video Hosting Sites on Android TV.

Environment

Platform: Smart Television
Operating System: Android TV, any version. 

Problem

Unable to play videos from video hosting websites on android TV because you don't have any TV app for the video hosting website.

For Example Unable to play video from YouTube.com without installing its app.
Summary


Some video hosting sites don't have dedicated apps for Android TVs, luckily Youtube has apps for Android TV but it is not the same case for another website.
So, what to do for such hosting sites?

Here in this tutorial, we are going to share an easy trick to get through this trouble.

Reason

Why are we not able to play Video directly from the website?
 
The Browsers on the TV are not capable of playing Video Contents. I tried the Puffin browser, which is available on TV's Playstore, and also tried the Native Browser available with Sony Bravia TV, but both of them are not able to run the playback content. 

Workaround

So for such sites which do not have any apps at present for the Android TV, below is the suggested workaround to make it work:


1. Install the Firefox Mozilla Browser on your Android TV from the link: https://github.com/mozilla-mobile/firefox-tv/releases
  1. On the Television, you will not be able to download the Firefox Browser Application Pack APK directly, and this APK is available on the above link from GitHub. To install it, you need to First use your mobile or computer to download this application and save on Google Drive. 
  2. Once downloaded, upload it on the Google Drive folder and remember the location. 
  3. Now on the TV, use the ES File Explorer app and go to Network>Cloud>Google Drive and install the downloaded Firefox APK from here. 
2. The Firefox app for TV is installed, Now open the hosting website.

3. Now enjoy all the videos with Firefox Browser on your Television screen. 

Conclusion


Installing the Firefox TV APK provided the full-fledged browser feature to the Android Television. Whereas earlier, the native browser and the browser options available on Playstore had limited functionality and were unable to play the video contents. 
Firefox TV-Browser Application removed the limitations and provided with a powerpack feature to play Flash Video Contents & also download them. Now we can watch the movies directly from the browser and do not need a unique App to do that.


Related Article: 

How to play AirtelTV on Android Smart TV?

Android P the Pie is Android 9 |Android|

Android  P the 9th Edition of the Android Operating System is Android Pie.
The first look was issued and this new OS by Google is ready to rock the mobility market.
Android and the Pie were spotted in Google's California Based Headquarter on 7th of August 2018.

The much awaited Android Pie is focused on simplicity, intelligence, and well-being. The on-air updated has been released for Eligible Google Pixel Phones and Essential PH 1.

A lot of amazing features are said to be included in this version of Android 9, but what caught my interest are:

The new Slice Feature of the Android Pie is said to be very powerful as it enables the partial function of the app to be active without even opening an App, for example, like you can book your UBER cab without even opening an App.

Another feature Digital Wellbeing is something which will track your habit how you use your phone, how many time you unlock the phone which app you use the most, how many notifications you received from where and also let you take the control like how you want to do things. Digital Wellbeing represents the Dashboard where you can see all these traced activities. Another feature is you can set the timer for the App you want to use, You can utilize Do not disturb mode now and also add a time to remind you it's time to go to bed and make you practise healthy routine.

Now we will talk about simplicity that means this version of Android is very easy to use, you may find it is even easier to navigate through the apps and running apps on this version of android then ever.
So we know this Android version is Android Pie which is also known as Android 9 or Android P and their earlier names of Android Operating system are as below:
  1. Android Donut (v1.6), The beginning of a new era of mobile computing.
  2. Android Eclair (v2.0)
  3. Android Froyo (v2.2)
  4. Android Gingerbread (v2.3), A big milestone, excellent graphics and high-end gaming. Remember Dell Streak.
  5. Android Honeycomb (v3.0)
  6. Android Ice Cream Sandwich (v4.0)
  7. Android Jelly Bean (v4.1). Another milestone with changed GUI.
  8. Android KitKat (v4.4)
  9. Android Lollipop (v5.0)
  10. Android Marshmallow (v6.0)
  11. Android Nougat (v7.0)
  12. Android Oreo (v8.0)
  13. Android Pie (v9.0), The present.
As you can see all the above naming given to Android Operating Systems are based upon the name of Sweets, so the latest one is based on the name of sweet American Pecan Pie. 

NFC - Near Field Communication

NFC is really old technology now but people still want to encourage it for giving quick commands through NFC sticker, making faster payments by just a swipe of cell phone near the payment machine at the stores making faster regular files transfer.
Samsung really tried hard to encourage this technology and was some kind of boom in 2014 to share files with just touching the phones or shaking them in the radius of 10cm.
But now its usage is low for file sharing as there are more alternate better options available like share it and others.
So why still some people want to use it, either they want to make use of the technology or for payment gateway machine to make the faster transaction. Just a few lazy people.
So I found one like them who has NFC enable PC and trying to transfer the file from phone to PC using NFC and he was touching it to the desired place but the computer was giving prompt for google photo?
But it really comes handy when you use NFC to enable camera and easily transfers photos from your camera to your mobile device.
NFC stickers are also a hand ways of using preset commands for your smartphone in day to day life like while you are getting into the car to start navigation you can just move your cell phone around the destination sticker and it will open google map with navigation information. But really don't see anyone really using it but in reality, the NFC Stickers are very cheap and easy to programmed. 
Big crazy question that person was looking out for the option that computer will give him option to receive or not !!!
Computers, in general, I found an issue sharing images and videos with mobile devices(Android) don’t know about other devices at least the one I was using Samsung. found it working great between windows devices. 
I was comfortably able to transfer the web pages and files but when transferring the images and videos in a cross-platform environment they were just getting transferred in incorrect format and I ended up unable to use it.
How to use NFC?
First, you have to check whether your phone/computer supports NFC or not, to check that go to settings and on search type in NFC if you have that it will come up enable it from there.
If you want to send the file from your Windows 8/10 mobile device or PC just open charm bar and select Tap to Send so whatever app will be open on top will if has supported app installed on the mobile device will send the files/like a/app to the receiving device. Ensure that even the Bluetooth is on the device.
For PC select the option TAP and Send for Charm bar.
For mobile hold the file and click on share and select NFC following it.
It works best if it is between windows devices but has some problem with cross platforms as discussed earlier like the Android to windows device. 

Top 3 Guitar apps for Guitarists

Just to help my guitar enthusiast friends across the globe here, I must list of guitar apps that will help you always to keep tuned - keep learning.
image_guitar.jpg
Friends just to let you know that even I am a guitar enthusiast, just begun my intermediate level, so whatever I am going to present here in this post is as per my experience.

Guitar Tuna
Guitar Tuner App
This is the App that has replaced traditional Guitar Tuner and metronome.

Yes, now you don't have to carry multiple pieces of small electronic devices with you, your smartphone is just enough.

So as you already knew it has replaced Guitar Tuner & Metronome by reading my first line, I just want to add more about this App. 

Ad-free Free Guitar Tuner & Metronome.
More paid optional features such as getting songs cord and practice along are there, which I haven't tried yet. But it may be possible you may like them. Click here to get it.

Justin Guitar App
Justin! For Guitar enthusiasts, he is a great teacher. He is my teacher and black belt guitar master. I have been honored to have access to his lessons. Thanks to the Internet for making people together across the globe.

If you want to learn Guitar and looking for a proper school, you can trust Justin, the excellent teacher who will cost you  '0' ₹/$/€/£/¢ or whatever currency you know yes his teaching is over the top for .00 cent.

This App is ad-free, and you can donate if you wish.

You can also find Justin's free lessons on his website Justinguitar.com & if you are learning it from scratch, then use the website instead of App. To Get App click here.

Another handy app that I believe you must already have on your device is YouTube.

YouTube
Playing Guitar and learning new stuff in different languages and different experts is possible using YouTube you can find a lot of Youtubers posting songs which you may want to learn, in fact, you will find excellent coaching from this guitarists. They are very interactive, helpful, and refreshing.

You can enjoy YouTube videos on their website YouTube.com and watch the video, or you can download their App YouTube from the app store.

My advice is to use App because when you are learning something, you tend to see the same video again and again at the different time which will unnecessarily eat your data, instead of doing like that you can use YouTube app and save videos offline which will also show your personal collection.

Mi HRX Band - How to pair |Android| - ReAndroid

Redmi Mi Band: How to Pair
Mi Band HRX
Are you not getting your fitness band connected with your Android Smartphone, or are you facing difficulties finding the right instructions to pair your fitness device?
Do not worry here are the easy steps which will walk you through:
  • Download Mi Band App from the Google Play Store, or you can find the relevant App mentioned on the packaging.
    Install it.
  • Turn on Bluetooth try to pair it through the App.
  • If the found issue turns on your Android Smartphone GPS and now try.
Issue resolved.
If you still find any issues or difficulties, you can contact us for free help and support through the below comment box or contact us page.
We will try to provide you the best of our knowledge.
Regards,
GFP (SME)

Mixed Reality.

What is Mixed Reality?
ReAndroid
Mixing Real with Virtual?

Mixing Real with a virtual?

-What-that-thing- X
Mixed Reality is a mixture of digital world object with the physical object. Physical objects are part of the Real-world you can call them real things. So when you see or do something with the real thing and when it makes a difference or show something into the unreal world of digital objects encompassing through Virtual Reality and Augmented Reality technology and developed a simulation of mixed content is called mixed Reality.

Virtual Reality uses VR gears to simulate real-world objects into the virtual world, And the using virtual world object into the real world for Display for different purposes. Like having multiple screen castings of the monitor, having aircraft simulation, house simulation, watching movies on the bigger screen, playing games all this with a feeling of having real-life experience.

Before Windows 10 Fall creator update, I don't think anyone was ever knew anything about Mixed Reality.

But since the time Windows 10 Fall creator update came into picture lots and lots of people are trolling over the net to find what is Mixed Reality is?

The answer is pure feeling real-world kind of an experience that is virtual indeed but makes you feel real, and you can interact with them through your Motions and motion controller devices, such as the Oculus Rift controller, Tobii eye-tracking camera, VR Head Mount Display and many more to come.

You can use Windows 10 Mixed reality and enjoy your personal virtual domain where you can settle your things as you want.

Android users are also can enjoy the same benefits with lined up a new release of apps with similar ideas.

Try ZapBox for Android and enjoy virtual Reality in Android devices.

Android phone is having the ultimate advantage whenever it comes to Virtual Reality as they provide high-end feature without losing your money with a lot of devices and at the same time saves your money on unnecessary equipment.

On the other hand, windows have expensive in terms of HW and need a lot of cabling, but its content and objectives are apparent and very professional as backed up by Microsoft.
"
Mixed Reality is Virtual Content Mixed with the Real-world content in order to get desired system input and output using Augmented Technology and Virtual Technology equipment.
-Ashish Jiwa
"

Geotagging Images.

Augmented Reality
Augmented Reality is mixing and relaying real-world objects with digital information inputs and outputs.
For example, GPS, Video, Audio, and Images.
AR layers digital information on top of real-world objects, and it is a part of VR. For the example above image can be Geotagged to be layered with its location information at the time of capture.
Watching Video 360°
Virtual Reality
Virtual Reality uses VR gears to simulate real-world objects into the virtual world, And the using virtual world object into the real world for Display for different purposes. Like having multiple screen castings of the monitor, having aircraft simulation, house simulation, watching movies on the bigger screen, playing games all this with the feel of having real-life experience with 360° videos and gaming.

Before Windows 10 Fall creator update, I don't think anyone was ever eager to know anything about Mixed Reality.

But since the time Windows 10 Fall creator update came into picture lots, and lots of people are trolling over the internet to find what Mixed Reality is?

The answer is a pure feeling real-world kind of an experience which is virtual indeed but makes you feel real, and you can interact with them through your Motions and motion controller devices, such as the Oculus Rift controller, Tobii eye-tracking camera, VR Head Mount Display and many more to come.

You can use Windows 10 Mixed reality and enjoy your personal virtual domain where you can settle your things as you want.

Android users were the first and are enjoying the same benefits with lined up a new release of apps with similar ideas.

Try ZapBox for Android and enjoy the feel of mixed Reality in Android devices.

Android phone is having ultimate advantage whenever it comes to Virtual Reality as they provide high-end feature without losing your money with a lot of devices and at the same time saves your money on unnecessary equipment.

On the other hand, windows have expensive in terms of HW and need a lot of cabling, but its content and objectives are apparent and very professionally backed up by MS.


Jarvis & all IronMan kinds of stuff are coming alive.

Using Logitech K480 Keyboard Multi-Device Keyboard with your Android |ReAndroid|

ReAndroid
Logitech K480 Wireless Keyboard
September 29, 2017


Android the technical blog

Logitech K480 keyboard on Android

by Ashish J

Logitech K480 Keyboard Experience

Today I am going to share my experience of Logitech K480 Multi-Device Keyboard.
As most of my readers know that all my blog postings are and blog design is done through a very basic Android Smartphone, and my passion for technology is an element that drives me to write blogs.

Just to improve my writing experience with mobile, I ordered the K480 Multi-Device Keyboard.

AND I AM HAPPY With it, five stars to it.

I ordered it through Amazon, got it in 4 days. My pre-delivery concern was how product quality would be. But it came in good shape(Thank god) & Logitech kept its promise of a quality product.

Pairing this device was way too easy.

Just took it out of the box, and batteries were preinstalled in it; just removed security paper strip on top of the battery tun on the switch on the back of the keyboard.

Now kept the keyboard straight up facing its front.

On top we have all the instructions given, just followed it.

Turned on Bluetooth pairing on the Android smartphone, and then I hold down the "Android Windows Chrome OS" Button for 3 seconds it starts to blink and then my smartphone gave me pop up that need to enter the numbers and hit enter. Did it on the keyboard and got it paired.

Now, what is the difference it makes with your regular typing experience with Android touch keyboard is as follow:

Comfortable typing: Writing this page just took me around 3-4 minutes. Yes, I am writing this post using the same Keyboard, and it's very user friendly.
Fantastic stuff that no Android Keyboard eating my screen space anymore.
My mobile is sitting straight up, as you can see in the picture below, and if I want, I can make it flip horizontal enough space for docking it.
So far, I have not been to the website as the instruction given on top of the keys.

Let's check it out what it says on www.logitech.com/k480
Don't find anything extra in there so you can skip going to Logitech's page.

  • Pros:
    • Speed: found typing speed amazing while composing this post, I already started to feel excellent.
    • The excellent keyboard is a little heavy but beautiful.
    • Great Design.
    • You can pair up to three devices.
    • Supports: Android, Windows, Chrome OS, iOS, and Mac OS.
    • Very simple to use & Magnificent keyboard.
    • Useful for bloggers and content writers.
  • Cons:
    • You may miss Number keys.
    • If you are desktop style typist, then you may take some time to adjust as its Keyboard layout is kind of similar to laptops.

Read more on our website
FAQ:
Where is the HOME, END, PAGE UP, and PAGE DOWN Key on the keyboard?
Answer: These keys are FN + Left Arrow, Right Arrow, up arrow and down arrow keys respectively for all four buttons.
Why some of the features or keys are not working after the operating system upgrade?
Answer: Issue with Bluetooth sync and loss of feature happen after OS upgrade, to rebuild/repair the configuration makes the system forget the Bluetooth keyboard from Bluetooth settings once it is removed and forgotten to fix it and it will work.
If still not working, try replacing the battery it should work.

You may also like to Read:
Best keyboard for Android  Bloggers


© Reandroid.net

Enter your email address:

Delivered by FeedBurner