Friday, 7 April 2023

how to make first app in flutter?

 To make your first app in Flutter, follow these steps:


1. Open your preferred code editor (e.g., Android Studio, Visual Studio Code) and create a new Flutter project by selecting "New Flutter Project" from the project selection screen.

2. Choose the "Flutter Application" project type, and give your app a name.

3. Once the project is created, open the main.dart file located in the lib directory.

4. Replace the code in main.dart with the following code:

import 'package:flutter/material.dart';


void main() {

  runApp(MyApp());

}


class MyApp extends StatelessWidget {

  @override

  Widget build(BuildContext context) {

    return MaterialApp(

      title: 'My First Flutter App',

      home: Scaffold(

        appBar: AppBar(

          title: Text('My First Flutter App'),

        ),

        body: Center(

          child: Text('Hello World!'),

        ),

      ),

    );

  }

}




This code creates a simple app with an AppBar and a centered Text widget that displays "Hello World!".


5. Save your changes and run the app by clicking on the run button in your code editor.


6. You should see your app running in a simulator or on your connected device.


Congratulations! You have just created your first Flutter app. From here, you can start exploring the Flutter framework and building more complex apps.

How to install flutter window or install flutter window

 To install Flutter on Windows, follow these steps:

1. Download the Flutter SDK from the official website: https://flutter.dev/docs/get-started/install/windows

2. Extract the downloaded zip file and place the flutter folder in your desired location (e.g., C:\src\flutter).

3. Add the Flutter bin directory to your PATH:

a. From the Start search bar, type ‘env’ and select Edit environment variables for your account.

b. Under User variables, scroll down to Path and select Edit.

c. Click New and add the full path to the Flutter bin directory (e.g., C:\src\flutter\bin).

4. Verify that Flutter is installed by opening Command Prompt and running the following command:

flutter doctor

This command will check for any necessary dependencies and provide guidance on how to set up your system for Flutter development.

5. Optionally, you can also install the Flutter plugin for your preferred IDE (e.g., Android Studio or Visual Studio Code) to enhance your development experience.
That's it! You are now ready to start building apps with Flutter on your Windows machine.

How to install flutter in mac or Install flutter in MAC

 To install Flutter on a Mac, follow these steps:

1. Download the Flutter SDK from the official website: https://flutter.dev/docs/get-started/install/macos

2. Unzip the downloaded file and place the flutter folder in your desired location (e.g., /usr/local/flutter).

3. Add the Flutter bin directory to your PATH by opening Terminal and running the following command:

export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin"


Make sure to replace [PATH_TO_FLUTTER_GIT_DIRECTORY] with the path to the directory where you placed the Flutter folder in step 2.

4. Verify that Flutter is installed by running the following command in Terminal:

flutter doctor

This command will check for any necessary dependencies and provide guidance on how to set up your system for Flutter development.


5. Optionally, you can also install the Flutter plugin for your preferred IDE (e.g., Visual Studio Code) to enhance your development experience.

That's it! You are now ready to start building apps with Flutter on your Mac.

how to update android studio?

To update Android Studio to the latest version, follow these steps:

1. Open Android Studio on your computer.

2. Go to the "Help" menu located in the top menu bar.

3. Click on "Check for Updates".

4. A window will appear showing you the available updates. Click on "Download" to start downloading the update.

5. Once the download is complete, click on "Install" to install the update.

6. Follow the prompts to complete the installation process.

7. Once the update is installed, restart Android Studio to start using the latest version.

It's important to keep Android Studio up-to-date to ensure that you have access to the latest features and bug fixes.

 

Thanks & Regards


AkhariPoint 

Friday, 28 May 2021

How to set HTML tags on TextView. How to set HTML tags in TextView How to show TextView as HTML.. How to work TextView as HTML ags

Hello Everyone

First we create a xml file for TextView 

demo.xml file name

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TextView android:id="@+id/textHtmlTags"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="8dp"
            android:text="demo html tags"
            android:textColor="@color/darkGrey"
            android:textSize="@dimen/_12sdp" />
</androidx.constraintlayout.widget.ConstraintLayout>

and now in Kotlin file 

DemoActivity.kt

package com.akharipoint.htmldemo

import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.text.Html
import android.util.Log
import android.view.View
import android.view.Window
import android.view.WindowManager
import com.akharipoint.htmldemo.R

class DemoActivity : AppCompatActivity() {

 override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.demo)
val textHtmlTags:TextView=findViewById(R.id.textHtmlTags)
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            textHtmlTags.text = Html.fromHtml(
                        bodyMessage,
                        Html.FROM_HTML_MODE_COMPACT
                     )
        } else {
            textHtmlTags.text =Html.fromHtml(bodyMessage)
        }
    }

}

Thanks 

AkhariPoint Teams

Sunday, 21 March 2021

How to set bottom navigation bar or how to set bottom tab with fixed name

 how to set bottom tab or navigation bar with fixed tab name or navigation menu name in android


First just create activity with bottom navigation tab bar and layout file also 


<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:app="http://schemas.android.com/apk/res-auto"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"

    android:background="#1E1B1B"

    android:orientation="vertical"

    android:layout_height="match_parent"

    tools:context=".activity.SettingsActivity">


    <LinearLayout

        android:id="@+id/linear_layout_setting"

        android:layout_width="match_parent"

        android:layout_marginTop="10dp"

        android:layout_height="wrap_content"

        android:orientation="horizontal">


    <TextView

        android:id="@+id/text_cancel"

        android:layout_width="0dp"

        android:layout_weight="1"

        android:layout_height="wrap_content"

        android:gravity="start"

        android:layout_marginTop="5dp"

        android:layout_marginBottom="5dp"

        android:layout_marginLeft="10dp"

        android:text="@string/cancel"

        android:textColor="#DFDCDC"

        android:textSize="16sp"/>


    <TextView

        android:layout_width="0dp"

        android:layout_weight="1"

        android:layout_height="wrap_content"

        android:layout_marginTop="5dp"

        android:layout_marginBottom="5dp"

        android:gravity="center"

        android:textStyle="bold"

        android:text="@string/settings"

        android:textColor="@color/colorWhite"

        android:textSize="18sp"/>

    <TextView

        android:id="@+id/text_done"

        android:layout_width="0dp"

        android:layout_weight="1"

        android:layout_height="wrap_content"

        android:layout_marginTop="5dp"

        android:layout_marginBottom="5dp"

        android:textColor="#FF0057"

        android:gravity="end"

        android:layout_marginRight="15dp"

        android:text="@string/done"

        android:textSize="16sp"/>

</LinearLayout>


    <LinearLayout

        android:id="@+id/linear_layout_myBalance"

        android:layout_below="@+id/linear_layout_setting"

        android:layout_width="match_parent"

        android:layout_marginTop="20dp"

        android:layout_marginLeft="15dp"

        android:layout_marginRight="15dp"

        android:layout_height="wrap_content"

        android:orientation="horizontal">

        <TextView

            android:id="@+id/text_balance"

            android:layout_width="0dp"

            android:layout_weight="1"

            android:layout_height="wrap_content"

            android:layout_marginTop="10dp"

            android:gravity="center|start"

            android:drawablePadding="10dp"

            android:drawableLeft="@drawable/home_icon"

            android:text="@string/home"

            android:textColor="@color/colorWhite"

            android:textSize="14sp"/>

    </LinearLayout>


    <LinearLayout

        android:id="@+id/linear_layout_earn"

        android:layout_below="@+id/linear_layout_myBalance"

        android:layout_width="match_parent"

        android:layout_marginLeft="15dp"

        android:layout_marginRight="15dp"

        android:layout_height="wrap_content"

        android:orientation="horizontal">


        <TextView

            android:id="@+id/text_earn"

            android:layout_width="0dp"

            android:layout_weight="1"

            android:layout_height="wrap_content"

            android:layout_marginTop="10dp"

            android:gravity="center|start"

            android:drawablePadding="10dp"

            android:drawableLeft="@drawable/food_icon"

            android:text="@string/fooding"

            android:textColor="@color/colorWhite"

            android:textSize="14sp"/>


    </LinearLayout>

    <TextView

        android:id="@+id/text_view_find_people"

        android:layout_below="@+id/linear_layout_earn"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_marginTop="10dp"

        android:layout_marginLeft="15dp"

        android:layout_marginRight="15dp"

        android:gravity="center|start"

        android:drawableLeft="@drawable/health_icon"

        android:text="@string/baseline"

        android:drawablePadding="10dp"

        android:textColor="@color/colorWhite"

        android:textSize="14sp"/>

    <TextView

        android:id="@+id/text_view_my_coupon"

        android:layout_below="@+id/text_view_find_people"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:gravity="center|start"

        android:drawablePadding="10dp"

        android:layout_marginTop="10dp"

        android:layout_marginLeft="15dp"

        android:layout_marginRight="15dp"

        android:drawableLeft="@drawable/meal"

        android:text="@string/meal_plan"

        android:textColor="@color/colorWhite"

        android:textSize="14sp"/>

    <View

        android:id="@+id/view_line_one"

        android:layout_below="@+id/text_view_my_coupon"

        android:layout_width="match_parent"

        android:layout_height="1dp"

        android:layout_marginLeft="42dp"

        android:layout_marginRight="14dp"

        android:background="#3A2F33"

        android:layout_marginTop="10dp" />

    <TextView

        android:id="@+id/text_view_fantasy"

        android:layout_below="@+id/view_line_one"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:gravity="center|start"

        android:drawablePadding="10dp"

        android:layout_marginTop="10dp"

        android:layout_marginLeft="15dp"

        android:layout_marginRight="15dp"

        android:drawableLeft="@drawable/order_status"

        android:text="@string/status"

        android:textColor="@color/colorWhite"

        android:textSize="14sp"/>

    <TextView

        android:id="@+id/text_view_leaderBoard"

        android:layout_below="@+id/text_view_fantasy"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:gravity="center|start"

        android:drawablePadding="10dp"

        android:layout_marginTop="10dp"

        android:layout_marginLeft="15dp"

        android:layout_marginRight="15dp"

        android:drawableLeft="@drawable/summary"

        android:text="@string/summary"

        android:textColor="@color/colorWhite"

        android:textSize="14sp"/>

    <View

        android:id="@+id/view_line_two"

        android:layout_below="@+id/text_view_leaderBoard"

        android:layout_width="match_parent"

        android:layout_height="1dp"

        android:layout_marginLeft="42dp"

        android:layout_marginRight="14dp"

        android:background="#3A2F33"

        android:layout_marginTop="10dp" />


    <LinearLayout

        android:id="@+id/linear_layout_info_setting"

        android:layout_below="@+id/view_line_two"

        android:layout_width="match_parent"

        android:layout_marginTop="15dp"

        android:layout_marginLeft="15dp"

        android:layout_marginRight="15dp"

        android:layout_height="wrap_content"

        android:orientation="horizontal">

        <TextView

            android:id="@+id/text_info"

            android:layout_width="0dp"

            android:layout_weight="1"

            android:gravity="center|start"

            android:drawablePadding="10dp"

            android:layout_height="wrap_content"

            android:drawableLeft="@drawable/payment"

            android:text="@string/payment"

            android:textColor="@color/colorWhite"

            android:textSize="14sp"/>

    </LinearLayout>

    <TextView

        android:id="@+id/text_view_terms_condition"

        android:layout_below="@+id/linear_layout_info_setting"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:gravity="center|start"

        android:drawablePadding="10dp"

        android:layout_marginTop="10dp"

        android:layout_marginLeft="15dp"

        android:drawableLeft="@drawable/feedback"

        android:text="@string/feedback"

        android:textColor="@color/colorWhite"

        android:textSize="14sp"/>

    <TextView

        android:id="@+id/text_view_about_us"

        android:layout_below="@+id/text_view_terms_condition"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:gravity="center|start"

        android:drawablePadding="10dp"

        android:layout_marginTop="10dp"

        android:layout_marginLeft="15dp"

        android:drawableLeft="@drawable/about_us"

        android:text="@string/about"

        android:textColor="@color/colorWhite"

        android:textSize="14sp"/>

    <com.google.android.material.bottomnavigation.BottomNavigationView

        android:id="@+id/navigationView"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        app:itemIconTint="@drawable/tab_color"

        app:itemTextColor="@drawable/tab_color"

        app:labelVisibilityMode="labeled"

        android:layout_alignParentBottom="true"

        android:background="?android:attr/windowBackground"

        app:menu="@menu/navigation"/>


</RelativeLayout>


and also create navigation.xml in menu folder 


<?xml version="1.0" encoding="utf-8"?>

<menu xmlns:android="http://schemas.android.com/apk/res/android">


    <item

        android:id="@+id/navigation_home"

        android:icon="@drawable/ic_home_black_24dp"

        android:title="@string/title_home" />


    <item

        android:id="@+id/navigation_about_kumbh"

        android:icon="@drawable/ic_kumbh_icon"

        android:title="@string/title_dashboard" />


    <item

        android:id="@+id/navigation_about_app"

        android:icon="@drawable/ic_about_icon"

        android:title="@string/title_notifications" /> 

</menu>


Thanks

Team AkhariPoint

Friday, 4 December 2020

How to share message or URL or app like with all social media in android programmatically

 How to share a message or any web URL or our android app like with all social media as well as mail and SMS in android app programmatically via help of Intent. check below.


 Intent intent = new Intent();

 intent.setAction(Intent.ACTION_SEND);

 intent.setType("text/plain");

 intent.putExtra(Intent.EXTRA_TEXT, "Hello Friends!");

 startActivity(Intent.createChooser(intent, "Share Message"));


Thanks