Monday, January 24, 2011

ColorDict Intent API for 3rd party developers

-------------- SEARCH API ---------------------
- You can use PopUp dialog style ColorDict result on your app.
- You can specify FrameLayout LayoutParams for dialog.

public static final String SEARCH_ACTION   = "colordict.intent.action.SEARCH";
public static final String EXTRA_QUERY    = "EXTRA_QUERY";
public static final String EXTRA_FULLSCREEN = "EXTRA_FULLSCREEN";
public static final String EXTRA_HEIGHT   = "EXTRA_HEIGHT";
public static final String EXTRA_WIDTH    = "EXTRA_WIDTH";
public static final String EXTRA_GRAVITY   = "EXTRA_GRAVITY";
public static final String EXTRA_MARGIN_LEFT  = "EXTRA_MARGIN_LEFT";
public static final String EXTRA_MARGIN_TOP   = "EXTRA_MARGIN_TOP";
public static final String EXTRA_MARGIN_BOTTOM  = "EXTRA_MARGIN_BOTTOM";
public static final String EXTRA_MARGIN_RIGHT  = "EXTRA_MARGIN_RIGHT";


Intent intent = new Intent(SEARCH_ACTION);
intent.putExtra(EXTRA_QUERY, "hello"); //Search Query
intent.putExtra(EXTRA_FULLSCREEN, false); //
intent.putExtra(EXTRA_HEIGHT, 400); //400pixel, if you don't specify, fill_parent"
intent.putExtra(EXTRA_GRAVITY, Gravity.BOTTOM);
intent.putExtra(EXTRA_MARGIN_LEFT, 100);
startActivity(intent);


- Check intent before using it

public static boolean isIntentAvailable(Context context, Intent intent) {
 final PackageManager packageManager = context.getPackageManager();
 List list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
 return list.size() > 0; 
}


-------------- PICK API ---------------------

[Constant]
public static final String PICK_RESULT_ACTION  = "colordict.intent.action.PICK_RESULT";

[Code]
Intent intent = new Intent(PICK_RESULT_ACTION);
intent.putExtra(EXTRA_QUERY, "hello"); //Search Query
intent.putExtra(EXTRA_FULLSCREEN, false); //
intent.putExtra(EXTRA_HEIGHT, 400); //400pixel, if you don't specify, fill_parent"
intent.putExtra(EXTRA_GRAVITY, Gravity.BOTTOM);
intent.putExtra(EXTRA_MARGIN_LEFT, 100);
startActivityForResult(intent, 5);


[RESULT]
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
 super.onActivityResult(requestCode, resultCode, data);
 if(resultCode == RESULT_OK) {
   Log.d("test", data.getStringExtra(Intent.EXTRA_SUBJECT));
   Log.d("test", data.getStringExtra(Intent.EXTRA_TEXT));
 }
}




26 comments:

  1. Hello,
    thank you for the great work you have done.
    Concerning Colordict 2.4.0, I want to raise that it's not working with some dicts (russian, LDaF.pdb.tab.utf.dict, bulgarian). I use 1.67.405.6 android in french.

    ReplyDelete
  2. Social & Mobile, please check your email and the comments on your post about ColorNote! A lot of us are having probs accessing our backup data.

    ReplyDelete
  3. WONDERFUL application! Thank you! I had to reinstall ColorNote. When I open the app and go to "Backup" in the menu, the only option I have is to "Backup Notes. The menu on this screen give me the option to "clear saved data" but nothing else. There is a bar that says "Saved backup data" but will not allow me to select it. I can see the backup data I want on my computer in the files list when I mount the phone. How do I restore the notes to my phone givin these parameters???

    ReplyDelete
  4. I like ColorDict very much! Thank you for this exciting application!

    The only thing, which is some kind of disturb for me is that dictionaries are saved unpacked. It will be much more convenient to use original compressed .dict.dz files. And it's not so difficult! I've found all libraries needed in jdictserver project (http://code.google.com/p/jdictserver/). I've even created a little demo application to demonstrate possibility of using this classes for random access of compressed dictionaries. This application could be downloaded from http://ul.to/eks66v

    It will be great if you could integrate this into ColorDict! This improvement should save up to 80% of space needed for dictionaries.

    If you prefer, I could integrate this improvements by myself just let me know where to find ColorDict source code and I'll send you a patch.

    You can contact me via e-mail: mr_july@mail.ru

    Best regards,
    Igor

    ReplyDelete
  5. Does anyone know how to reach the developer of this application? I have been trying to contact the developer but I can't seem to find an email link anywhere.

    ReplyDelete
  6. Is it possible to have ColorDict install to the phone instead of transferring all the data to the SD card?

    (Sorry, I relaise it's an unusual request.)

    Yours faithfully

    Ben

    ReplyDelete
  7. Simple but fantastically useful app!

    But is there any way to select a different notification tone for reminders, instead of only the phone's default notification tone?

    If this isn't possible, could it be added as a future enhancement please?

    Thanks,
    Si

    (HTC Desire, 2.2 Froyo)

    ReplyDelete
  8. fantastic thank you for your app been using it for a year so i can tell you a lot about it I have some improvements/ideas to give!
    1. First i think you should reinvent the dictionary organization, i am a dictionary maniac and it it is very hard to organize the dictionaries with up and down when you have more than a hundread of them..
    To do so you should/can implemente Dictionary Groups, group name set by the user of course
    for example creates group for "English Language" will let colordict search only in the dictionaries in the english language and you can do that also for the other langauges French or any as user like Spanish Chinese Indian Russian and so on..
    2. Then you could add some switch button in the home of colordict to switch easily between groups of dict! or some checks (Search in Selected group only (Checkbox))
    3.Plus you could use the volume buttons to move from dictionary to dictionary in the home search ...the screen indeed might be small while the dictionary many and the entry large! if you want to move to next dictionary in search results you have to scroll manually and it takes a loooot of time!
    4.than you could decrease the dimension of "Search" "History" and "Dicts" to save screen space
    5.You could also add something to Hide/Unhide the small window of a dictionary in the Search results like a minimize that will remain in the screen... Right now when you click the dictionary you can keep pressed to "Select a word" "Copy to clipboard" etc.. you could say that a double click hides/unhides your choice!
    6. Text To speech functionalities using various TTS available in android a small icon and then calling android system would be easy wouldn't be?
    7. A bit more annoying... WebKit support? You use online dictionaries such as Wikipedia, what if there is an online dictionary www.somewebsite.com/search?=%ColorDictWord% :)
    8. Could you add history by date? and make it last longer (set up by user) never delete history etc.. keep in sd card
    9. Option to disable dictionary from the search results when keep pressed(Yellow highlighting)
    10. just to reach ten :))

    take a look at fora dictionary http://ng-comp.com/fora/android.htm to understand more of what i said before ;)

    ReplyDelete
  9. Please include a font that supports IPA-characters! Droid-Fonts are so damn bad. I would love such a feature :)

    ReplyDelete
  10. My favorite dict app on android. Here I would like to ask for some enhancements:

    1. While exporting data by "share", can we have a check box for "making this choice default"? It would be great to have one, so that I won't choose the same app from time to time.

    2. TTS. I see that we have a loudspeaker icon when using google translate, how can I integrate this function to my homebrew dict file?

    ReplyDelete
  11. Thanks for the app! Its so usefull while reading books with FBreader :P

    Could you please provide public API and knowledge how to create Addons/external directories for ColorDict? just like google translate and wikipedia

    Thx bye

    ReplyDelete
  12. I noticed the ColorNote application on the Android Market. We would like to make your application available on our upcoming Android device. Will you provide us permission to do so?

    Thanks,
    Mark Hollingsworth
    mhollingsworth@esi-estech.com

    ReplyDelete
  13. Hi there. I must say that I really enjoy having this program. I teach English in Japan and it really helps me with my students. There is one request I have. I own a tablet Android device that has a 1280x768 resolution. Even on the largest font setting, the text is TINY. Would it be possible to add something to the next version that would allow for even larger font sizes? REALLY big ones? Thank you for all that you have done. I appreciate it.

    ReplyDelete
  14. ColorDict is great but....

    It uses over 5% of my phone's CPU in the background when it's doing nothing.

    ZTE Blade, Froyo.
    Please address this quite serious issue.

    ReplyDelete
  15. I use this fantastic app with fbreader... thank you.
    ¿Is there a way to export the history to a txt file, with: original=translation?

    ReplyDelete
  16. I use WordNet english dictionary, and usually I see two little speakers images (american and british), that i assume that is for listening the sound of the word, but when i push over them, it shows an error alert.
    What do I need to do for this works properly and hear the sound?
    (offline option preferably)

    ReplyDelete
  17. (for the previous comment about sound, I use android 2.2 froyo)

    ReplyDelete
  18. Hello, Great app. Any plans to add moving to SD card?
    Also could you kindly give more info on the password lock such as how is the data locked/encrypted or??

    Thanks,

    Michael...

    ReplyDelete
  19. Is there a website where I can access the notes I have synced using the online sync via google utility? The ColorNote app says I have synced data online when I press the right button - but where does it go to?!

    ReplyDelete
  20. This is one of the well defined post.Your blog is creating a good blog posting Environment.
    Android app developers

    ReplyDelete
  21. Hi, ive noted some infos using the app but i formated the cel phone and installed a new ROM. Now i have the ROM backup and id like to find the notes with the infos, where can i find it in the cel? Is it in the sd card?

    ReplyDelete
  22. w0o0 great article and the expression way of describing your services is cool, i like that and wish you all the best , God bless you, thank for sharing this great information with us

    small business outsourcing

    ReplyDelete
  23. This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post.

    Mobile Application Development Company

    ReplyDelete
  24. The article posted was very informative and useful. You people are doing a great job. Keep going.

    Web Designing Services

    ReplyDelete
  25. Dear ColorDict and 3rd developers,

    we are trying to get the result from a query by means of the code above (the part with "colordict.intent.action.PICK_RESULT"). However, we have not been able to get the result in the onActivityResult function. Instead, the variable data is always set to null, so if we try to invoke method getStringExtra(Intent.EXTRA_SUBJECT), we get an exception.

    Should we use a different code?
    Thank you.

    ReplyDelete
    Replies
    1. I am standing before the road on which you were stepping about one and half years ago, esp. underestimated of resources of my 1st app and even zero promotion. 1 million thanks for sharing your data, thoughts, and advices!!!!!

      HIPPA Certified Software

      Delete