Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

1st Android App

Comments

  • Registered Users, Registered Users 2 Posts: 159 ✭✭TeaServer


    It's fine for a first attempt. A couple of notes (I'm only a hobbyist developer - so take my advise with a pinch of salt!)

    Adding a progress dialog would be a welcome addition to indicate that the app was working in the background.

    It didn't crash on me, but I got the 'wait/force close prompt' when searching with longer words. You probably should do the processing/query in another thread to keep the GUI thread responsive.

    HTC Desire CM7.1 Android 2.3.7

    /T


  • Registered Users, Registered Users 2 Posts: 58 ✭✭adigilani


    Thanks a lot for feedback.
    I am using async class to read dictionaries and want to display a loading message but obviously there is something wrong...

    if I will put the code up on dropbox... Would you be able to go through it. please.

    TeaServer wrote: »
    It's fine for a first attempt. A couple of notes (I'm only a hobbyist developer - so take my advise with a pinch of salt!)

    Adding a progress dialog would be a welcome addition to indicate that the app was working in the background.

    It didn't crash on me, but I got the 'wait/force close prompt' when searching with longer words. You probably should do the processing/query in another thread to keep the GUI thread responsive.

    HTC Desire CM7.1 Android 2.3.7

    /T


  • Registered Users, Registered Users 2 Posts: 5,246 ✭✭✭conor.hogan.2


    Post it up I am sure somebody will look through it and comment. A lot more than if you don't post it.


  • Registered Users, Registered Users 2 Posts: 58 ✭✭adigilani


    https://www.dropbox.com/s/iu75jekldqzd619/AnagramSolverApp.zip

    is the link... please have a look.
    Post it up I am sure somebody will look through it and comment. A lot more than if you don't post it.


  • Registered Users, Registered Users 2 Posts: 1,235 ✭✭✭Odaise Gaelach


    I had a quick look.

    AndroidAnagramSolverActivity.java, line 228:
    try {
       resultFileLoading = new ReadDictionary().execute(lastOperatedKey.toString())[B].get();[/B]
    }
    


    You are reading in your dictionary in an asynchronous thread. However, the .get() call is causing the UI thread to wait until the ReadDictionary thread is finished, which is why you don't see your ProgressDialog appear and it's why people are getting "force close" messages. Unfortunately it makes the multiple threading meaningless. :)


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 58 ✭✭adigilani


    Thanks for your valued input... Much appreciated...
    I would be much thankful if you could tell a work around it too...

    Thanks again...
    I had a quick look.

    AndroidAnagramSolverActivity.java, line 228:
    try {
       resultFileLoading = new ReadDictionary().execute(lastOperatedKey.toString())[B].get();[/B]
    }
    


    You are reading in your dictionary in an asynchronous thread. However, the .get() call is causing the UI thread to wait until the ReadDictionary thread is finished, which is why you don't see your ProgressDialog appear and it's why people are getting "force close" messages. Unfortunately it makes the multiple threading meaningless. :)


  • Registered Users, Registered Users 2 Posts: 1,235 ✭✭✭Odaise Gaelach


    Everything from this point on is subjective. ;)

    I'd put all the code for loading the dictionary and determining any anagrams in the doInBackground method of your AsyncTask. When you tap on the button call the ReadDictionary.execute() and pass the word that you're searching for an anagram for in with the parameters. When you're finished searching for an anagram update the UI in the onPostExecute() method - this method runs on the UI thread so you won't have any illegal cross-thread access Exceptions.

    The Android API has a good entry for AsyncTask:
    http://developer.android.com/reference/android/os/AsyncTask.html


  • Registered Users, Registered Users 2 Posts: 58 ✭✭adigilani


    Just published the updated version...
    As advised now doing processing in AsyncTask...
    Two question

    What is ANR.....

    how i can determine the size of the file interms of no of lines there i am going to read.... it is for progressbar

    i have uploaded the whole thing again on the dropbox...

    https://www.dropbox.com/s/iu75jekldqzd619/AnagramSolverApp.zip

    please have a look...


    Everything from this point on is subjective. ;)

    I'd put all the code for loading the dictionary and determining any anagrams in the doInBackground method of your AsyncTask. When you tap on the button call the ReadDictionary.execute() and pass the word that you're searching for an anagram for in with the parameters. When you're finished searching for an anagram update the UI in the onPostExecute() method - this method runs on the UI thread so you won't have any illegal cross-thread access Exceptions.

    The Android API has a good entry for AsyncTask:
    http://developer.android.com/reference/android/os/AsyncTask.html


  • Closed Accounts Posts: 5,482 ✭✭✭Kidchameleon


    Works fine on my Samsung Galaxy mini


  • Registered Users, Registered Users 2 Posts: 58 ✭✭adigilani


    Thanks for your feedback...
    I would love more downloads on different devices to see the end result..
    Please recommend the app to any friend you know have an android phone. please.
    Works fine on my Samsung Galaxy mini


  • Advertisement
  • Closed Accounts Posts: 115 ✭✭FullRetard


    I'll download it tommorrow to my sony experia.Left the usb cable in work.Will get back to you


Advertisement