Hi,
>what is benefit of local views in apps? how much necessary ?
Local views have a number of situation where they can be used, but they aren't a replacement for manual SQL. Some reasons to use local views are:
- If you plan to migrate to a backend using remote view, you can easily switch between local data and remote data by either using a database with local views or a different database using remote views.
- Local views keep the SQL definition in one place. If you change the definition once, all code that uses the view benefits from that.
- Local views are updatable. If you use manual SQL commands you have to handcode all UPDATE, DELETE and INSERT statements yourself.
- You can easily refresh data by using the REQUERY() function. Unlike issuing a SELECT statement a second time, REQUERY() works together with grids.
If you plan to access remote data, you also might want to check out the CursorAdapter class which is a more flexible way to switch the backend compared to local and remote views.
--
Christof