1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

App Launcher With Full Source Code

Discussion in 'Delphi Android And IOS' started by AdminDF, Jan 13, 2015.

  1. AdminDF
    Online

    AdminDFAdminDF is a Verified Member Delphifan Staff Member DF Staff

    One problem you can have on Android as a user and/or Delphi XE7 Firemonkey developer is having to swipe through pages and pages of icons to find that app you want to launch because you have so many apps installed on the device. One solution to this problem is demonstrated in this demo app called AppList. Basically it has a filterable list of all of the apps installed on your phone which easily allows you to find and launch the right app. You can type in a few letters and launch the app Instead of swiping through pages and pages of icons to find what you want. It acts similar to how the Start|Run search functionality works on Windows. It cost me $100 to have this app built through oDesk. There are three different pieces of functionality demonstrated in the app. These pieces are reading the list of installed apps on the device, loading and caching the icon for each app, and launching the app itself. The functionality in this app is Android specific so it won’t compile for the other platforms (Windows, IOS, or Mac OSX) because it uses the Android specific JNI. This code should also work in Appmethod. Here is the function for launching an app on Android:


    Code:
    procedure TformMain.OpenApp(PackageName, AppName : JString);
    var
    Intent : JIntent;
    NativeComponent : JComponentName;
    begin
    Intent := TJIntent.Create;
    Intent.setAction(TJIntent.JavaClass.ACTION_MAIN);
    Intent.addCategory(TJIntent.JavaClass.CATEGORY_LAUNCHER);
    NativeComponent := TJComponentName.JavaClass.init(PackageName, AppName);
    Intent.addFlags(TJIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK or TJIntent.JavaClass.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
    Intent.setComponent(NativeComponent);
    SharedActivity.startActivity(Intent);
    end;
    

    Here is the function for listing the apps installed on the device:


    Code:
    function TformMain.GetActivityAppList: JList;
    var
    tempList : JList;
    Intent : JIntent;
    Manager : JPackageManager;
    begin
    Intent := TJIntent.Create;
    Intent.setAction(TJIntent.JavaClass.ACTION_MAIN);
    Intent.addCategory(TJIntent.JavaClass.CATEGORY_LAUNCHER);
    Manager := SharedActivity.getPackageManager;
    tempList := nil;
    tempList := Manager.queryIntentActivities(Intent, 0);
    Result := tempList;
    end;
    

    And you’ll have to download the demo itself to get the code for reading and caching the icon for each app.

    Full Download
    Hidden Content:
    **Hidden Content: You must click 'Like' before you can see the hidden data contained here.**
     
    XoreDev, Mahdi, Proof and 5 others like this.
  2. realist
    Online

    realistrealist is a Verified Member Administrator General Staff Member DF Staff

    Thanks
     
  3. youp911
    Online

    youp911 Guest

    thanks
     
  4. powerbyte
    Online

    powerbyte Guest

    [font='Open Sans', Arial, Tahoma, Verdana, sans-serif]Thanks[/font]
     
  5. dynamo
    Offline

    dynamo DF Expert

    Thank you
     
  6. josemarsena
    Offline

    josemarsena DF Junior

  7. dontbugme
    Online

    dontbugme Guest

    RE:

    thanks (y)
     
  8. fredick2
    Offline

    fredick2 DF Member

    gracias
     
  9. misterQ
    Offline

    misterQ DF Member

    RE:

    Thanks!
     
  10. mato0o
    Offline

    mato0o DF Junior

    Thank you!
     
  11. happyleaman
    Online

    happyleaman Guest

    RE:

    Thank you very much!
     

Share This Page