Creating views view in your module is really simple.
Source code viewer
// 1. Create your view the regular way. // 2. Define your views api version and path for files that include views hooks. /** * Implements hook_views_api(). */ function HOOK_views_api() { 'api' => 3.0, 'path' => drupal_get_path('module', 'HOOK') ); } // 3. Views export creates code that you have to paste in this function. /** * Implements hook_views_default_views(). */ function HOOK_views_default_views() { // Paste code form views export. $views[$view->name] = $view; return $views; } // 4. Delete your view and clear all caches, view from your code should appear. When you change the view don't forget to add the changes to code.Programming Language: PHP