Have you ever thought of making your own stuffs and use them?
Like your Own
- Operation System !
- Programming Language !
- Library !
- Framework !
- Apps !
- Games !
I'm that kind of person who was always interested in making applications which are integrated to the system (literally Applications) not business or commercial applications and still i am :3
I have always dreamt about things of my own...
So once I thought to make my own Android Launcher as I'm using Android Phones.
At first I thought it's something very hard and I won't be able to make a launcher.Then I found it supper easy!
Today i am going to discuss about how to nake your Android Launcher !
Let's start!
I am using Flutter which is a Cross Platform Framework of Dart Made by Google.
There is a big community of Flutter to make cross platform applications such as Android,IOS,Desktop and Web applications.
If you haven't installed flutter yet then have a look at their doc which is very user friendly and well decorated.
Note : I am using Visual Studio Code as a Editor or IDE and prefer terminal and command line activities.
Lets create a flutter application
- Command in terminal :
flutter create -i objc -a java custom_launcher
Note : This command will create a application named custom_launcher
and the native code for Android will be java
If you prefer Kotlin then just use -
flutter create custom_launcher
A flutter app will be created with similler file Structure:
We will code in main.dart
file.
First We will need to edit some codes in the AndroidManifest.xml
file. That will make our launcher different from normal Android Applications
Manifest file location :
- Add these lines in
AndroidManifest.xml
file under<intent-filter>
section :
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
Now If you run your app , it will appear as a Launcher.
Or Press Home button of your android phone and it will ask to set it as default launcher.
Congrats You have made your launcher :D
Yup Seriously ! It is that easy !
Now as a Flutter Application developer I hope you are able to do some of your own customizations.
I know you are concert about how can you show the installed applications in your custom Launcher.
Let's do it:
Interact with the Applications installed in Phone
To do so we will use a flutter plugin named device_apps
which will give us a List<application>
where all the necessary informations will be given.
- First import
device_apps
into your dart file :
import 'package:device_apps/device_apps.dart';
- Get the list of apps available in your phone :
List<Application> apps = await DeviceApps.getInstalledApplications();
- You can send some parameters too :
List<Application> apps = await DeviceApps.getInstalledApplications
(
includeAppIcons: true,
includeSystemApps: true,
onlyAppsWithLaunchIntent: true,
)
This will return something like that :
It provides :
App Name (String)
Apk File Path (String)
Package Name (String)
Version Name (String)
Version Code (int)
System App ? (bool)
Install Time (int)
Update Time (int)
Application Catagory (Catagory Type)
It also provides icon
as ApplicationIcon
.
To access icon you have to use that Application
type as ApplicationWithIcon
and check that the app has a icon first.
Note : icon is a Uint8 List type.
Now You have your data so do what ever you want !
Let me show you how you can use them
- Let's traverse all the apps we get before :
for (int i=0;i<apps.length;i++){
Application app = apps[i];
}
- Extract the application name :
Text(app.appName)
- Use Icon :
app is ApplicationWithIcon ? CircleAvatar(
backgroundImage:
MemoryImage(
app.icon,
),
)
Note : If you are not able to access app.icon then use this -
ApplicationWithIcon icon app as ApplicationWithIcon;
icon = icon.icon;
More things you will want to do :
- Check if an application is installed :
bool isInstalled = await DeviceApps.isAppInstalled('packageName');
- Open an Application :
DeviceApps.openApp('packageName');
Apps can be shown like this :
I have made an Android Launcher which is lightweight and Fast.You can have a look and If you like then give me a star :v
Source Code available : Ubuntu Launcher
Apk Release : Install
Happy Coding :D
Contact with | Follow me onΒ : LinkedIn Twitter Facebook GitHub Quora Dev Medium
Top comments (10)
how to make a search engine to search for the application with that packages?
checkout the source code where i have implemented the search apps feature
github.com/jspw/Ubuntu-Launcher/bl...
Nice work, my plan is to rebuild the windows 10 phone UI
great
Is this possible with Javascript using React Native?
I hope it's possible .
What extra you will need to do some native code to get the information about the apps installed in your mobile phone.
I don't know if there is any package available to show the app list in your mobile.
Check latest version here Ubuntu Launcher 2.1.0
here is the latest release apk Ubuntu Launcher 2.0.1
Can we add widgets in this
I think you can, but have to google about it.