Featured Post

How to capture long screenshot of apps and website on Android?

Image
Usually, you can take screenshot of only visible area on your display. But what if you could capture screenshot of the app by scrolling up and it will automatically keep capturing the long screenshot until you scroll up. Well, it's easy. In some devices, there is built-in feature called Super Screenshot or Long Screenshot which can capture long screenshot by scrolling up. If your device don't have these features, don't worry, I am going to share best trick to take long screenshot on any Android device. In this tutorial, I am going to share a useful Android app which can be used to take long screenshot of any apps or stitch multiple screenshots into one. The name of the app is LongShot for long screenshot . This is my favorite app to take long screenshot on Android phone. For taking long screenshot, the view must be scrollable. Example, you can take long screenshots on Facebook, Messages, Twitter and any apps which can be scrolled vertically. You can also take the s...

How to install Dart and run Dart Programs offline on Android?

Run Dart Programs On Android

Dart is a object-oriented, open source and general purpose Programming Language developed by Google. It is used to build applications for multiple platforms like Mobile, Desktop, Server and Web Application. The main purpose of Dart Programming Language is to create awesome User Interface for Mobile, Desktop and Web Applications using Flutter Framework.

In this tutorial, we will focus on how you can Install and Run Dart programs on your Android Device. You will be able to run your Dart programs offline in your Android after following the below steps.


Installing Dart on your Android Device.

  1. In order to run Dart programs on your Android, you need an app called Termux. Install the app from the Play Store.
    Termux App on Play Store
  2. After installation is complete, open the app and wait till the app configuration is complete.
    You need to turn on the internet to download necessary files for Termux during the first launch after app installation or clearing its data.
  3. After the app's initial configuration is complete, you will see this window.
    Termux App Home
  4. To run Dart programs, you should install Dart package on Termux. Type the following commands in the terminal to install Dart on Termux.
    $ pkg install dart
  5. It may take about a minute for installation depending on your internet speed. After installation completes successfully, you can run Dart programs on your Android.

Installing Dart Code Editor in Termux.

To write Dart program, you need to install an Editor. In this tutorial, we will use Micro text editor. It is a good text editor for Termux which has many cool features. It also supports the shortcut keys that are used in PC like CTRL + V to Paste the Copied Text, CTRL + S to Save File, CTRL + Q to Exit/Quit the Editor, etc.

  1. To install Micro Editor on Termux, use the following command.
    $ pkg install micro
  2. Once you successfully install the Micro Editor, type the following command to create a new Dart Program.
    $ micro main.dartHere, main.dart is the name of the Dart Program. You can use any name for your code in place of main.
  3. After you run the command, you can see an editor where you can write your Dart programs.
    Micro Text Editor on Termux
  4. Write the Dart program on the Editor and press CTRL + S to Save your program.
    Dart Code In Micro Editor

Executing the Dart Programs.

Once you write the Dart program, you need to run it to see its output.
To run your Dart code, follow these steps.

  1. Run the following command on the terminal.
    $ dart main.dartHere, main.dart is the name of the Dart program you have created.
  2. Once after running the command, you can see its output on the terminal.
    Output Of the Dart Program

Writing Dart Programs on External code editor.

Instead of using the Termux Editors, you can also write Dart programs on any one of your favorite Code Editor app and execute them. I am using Acode code editor in this tutorial which is my favorite code editor with many cool features.

To write your Dart programs on code editor, follow these steps:

  1. Download and install any one of your favourite code editor app and create a new file.
  2. Write your Dart program on the editor as in the image below.
    Writing Dart Program on Code Editor
  3. Save the file as <filename>.dart.
    You can use your desired name for your Dart program in place of <filename>.
    You should save your file in the root of your sdcard or where you can easily get its location because you need to provide the file location to run your code.
  4. You are now ready to run your Dart Program.

Executing Dart programs from external file.

After writing your program, you can run it to see the output. To run your Dart code, follow these steps:

  1. First of all, you need to provide permission to read and write files from your Internal or External Storage if your Android is Android 6.0(Marshmallow) or later. To provide storage permission to Termux, run the following command in the terminal and click Allow to allow the permission.
    $ termux-setup-storage
  2. To run the program, you need to get the path of your program file. You can use your file manager and see the details/ properties of the file to see the path.
  3. Once you have the file path, open Termux app.
  4. Type the following command to run your code.
    $ dart /path/filename.dart
  5. If your program exist on the given path, it will show output accordingly as shown in the given image.
    Executing Dart Program From External File

Conclusion

Following this tutorial, you have successfully installed Dart on your Android, and now you can run your Dart programs offline on your Android Device.

Comments

Popular posts from this blog

How to capture long screenshot of apps and website on Android?

How to capture long screenshot of apps and website on Android?

How to run VB.NET programs offline on your Android?