javaandroidduckduckgo

Duckduckgo Android search Intent


Anyone knows the intent to search directly through the official Duckduckgo app on Android?

Tried this one so far, i think they dont have a query key in extras

    Intent intent = new Intent(Intent.ACTION_SEARCH);
    intent.setPackage("com.duckduckgo.mobile.android");
    intent.putExtra("query", subject);
    context.startActivity(intent);

Solution

  • It is actually pretty simple than i thought

        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setData(Uri.parse("https://duckduckgo.com/?q=" + subject));
    
        try {
            intent.setPackage("com.duckduckgo.mobile.android");
            context.startActivity(intent);
        } catch (ActivityNotFoundException a) {
            intent.setPackage(null);
            context.startActivity(intent);
        }