martes, 14 de febrero de 2017

Stoping the Asynctask

These two weeks was really harder. First I discovered that all the project have a bug when the app has suspended this display an error. The error is caused by the async tasks, I needed to stop them before that the program has suspended. Solve the problem was easy from the async task made for me, but the calls with Quickblox was different. On this moment was when started the problems, the first problem was when my computer died, I was too near to cry by the lost. The rest of the week I was working with a computer of Pernix but Android Studio did not ran very well on the computer.



When I could return with the issue of Quickblox, I just only had an example that explains how to stop the thread. The example was 3 files with 700 line for each... WTF Who programmed this s***!?. Immediately  I thought that the best way is asking for help on this time. Then I ask for help to Erick but he was too busy. To not waste my time, I started an Angular tutorial (Probably the next time I will go to write about this topic).



domingo, 29 de enero de 2017

Delay on list view

On this week was some funny, I started the week working on an issue with the display the chat list on Wappo. The issue was a delay to it show the chats. At the beginning, I thought that was the query to quickblox, because to I got all the information I needed make 3 queries (To get the chatList, another to get the contact information and finally the avatar from the user). I tried so hard for several minutes but I could not get the solution Then I immediately ask for help to Macho. He suggested to me that I created a database on the app to save all the information on the phone. Then, when the app started I only needed load first the information from the database and after I load the information from Quickblox.



To I made the database, I used SQLite because was really easy to use and very similar to Hibernate. I did not have troubles on this part. I just only create 3 classes from the implementation: one from the design of the table, another from database creation and the last for the queries. I used this tutorial to learn SQLite. When I finished all the implementation, the app had the same delay again. WTF!? How could be possible?. Now I did not idea the could be. Then I began to run my code part by part until found the issue.


The issue was in the view, exactly on the adapter from the list view. When the app created an item on the Listview, this needed iterate severals time the creation to adjust the components. I found this solution to optimize the view and I used this solution.