abahety / LearnAndroid

This repository is for all projects I do as a part of learning android development
0 stars 1 forks source link

eBay android-codepath prework #2

Closed abahety closed 8 years ago

abahety commented 9 years ago

Hi, I have finished initial requirements mentioned in prework. /cc @codepathreview @codepath . I am working in optional functionalities and will update here the ones I finish.

Thanks -Anand

nesquena commented 8 years ago

Anand,

Looks good, this exercise is intended in part to give you an introduction to the general rhythm of this course. The course is entirely project-based with an app being assigned each week and then due the following week. Each project builds on the last to help each engineer to learn all practical Android development and best practices as quickly as possible. We also do a code review for each submitted project once the program begins.

Since there have been over 60 applications and we can only accept 15 people into the pilot course, the next step is to work on one or two extensions to your todo app. This course is project-based and the optional extensions on each project are often the most valuable learnings since they dive deeper into common Android use cases.

Once you submit 1-2 extensions, your application will be passed along to the organizers for final enrollment. Let me know if you have any questions, in the meantime.

abahety commented 8 years ago

Hi Nathan, I have finished 1 extension (using dialogfragment) so far. Please check it here. https://github.com/abahety/LearnAndroid/blob/extensions/SimpleTodo/README.md There is one issue here : I am unable to auto-hide the soft keyboard when save button is clicked in the dialogue. I am able to show it on dialog show however.

I am implementing others and will update as I finish them.

nesquena commented 8 years ago

See http://guides.codepath.com/android/Working-with-the-Soft-Keyboard for the keyboard. Ping me again when you've added at least one more extension.

abahety commented 8 years ago

Hi Nathan, I have tried implementing sqlite usage to store data. I have pushed the changes here https://github.com/abahety/LearnAndroid/tree/extensions I am able to store the data in DB by adding items, get handle to it but unable to get a cursor as mentioned in the reading sections : http://guides.codepath.com/android/Populating-a-ListView-with-a-CursorAdapter

I logged into sqlite console and am able to see the data. I tried all possible things but cursor just comes empty with no results. tried couple of raw queries : select * from items, select rowid _id,* from items but nothing seems to work. Hence list view is not displaying any added items.

Thanks -Anand

nesquena commented 8 years ago

If you are having issues with SQLite, you should use http://guides.codepath.com/android/ActiveAndroid-Guide to make it easier. I notice you have both right now? If you use ActiveAndroid, you don't need to use raw SQL queries directly. I see you added that here: https://github.com/abahety/LearnAndroid/blob/extensions/SimpleTodo/SimpleTodo/app/src/main/java/com/abahety/simpletodo/storage/ToDoItem.java

Are you still having issues getting it to work with ActiveAndroid?

abahety commented 8 years ago

Hi Nathan, Thanks for the input. Let me try without using SQLite raw queries. When I just used active android, it did not insert any items saying table did not exist in logcat logs. May be I was doing something wrong there. I am not sure how to get table created with just using active android. So I tried using create table syntax explained here : http://guides.codepath.com/android/Local-Databases-with-SQLiteOpenHelper Then for fetching cursor got followed the guide here.

Let me just try using active android and get back to you.

nesquena commented 8 years ago

Try uninstalling and reinstalling the app on the emulator. Table is created automatically. See https://guides.codepath.com/android/activeandroid-guide#common-questions for more troubleshooting.

abahety commented 8 years ago

Hi Nathan, Thanks for the pointer. Now its working. Issue was :

  1. Database was not created because package name for Model class in the metadata tag in the manifest was wrong.

Also I have now a working demo for add, modify, delete with active android ORM usage.I have checked in the code for the same.

One enhancement I added : toast message for items deleted via long click.

nesquena commented 8 years ago

Great to see you were able to augment your app with a few extension tasks now. As mentioned earlier, the extension tasks available on each project are often the most valuable learnings since they dive deeper into common real-world Android use cases.

Your application will be passed along to the organizers for final admissions. You should hear back again soon. Let me know if you have any questions in the meantime.

abahety commented 8 years ago

thanks for the help so far.