Esempio n. 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            //Window.AddFlags (WindowManagerFlags.NotTouchable);
            //Window.AddFlags (WindowManagerFlags.NotTouchModal);
            //GetSystemService (WindowManager.UpdateViewLayout);
            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);
            _UiVideosList = FindViewById<ListView> (Resource.Id.UiVideosList);

            FakeData data = new FakeData ();
            _VideoDB = new VideoBuyDB ();
            _VideoDB.ConnectToDB ("VideoBuyDB.db3");
            _VideoDB.CreateDB ();
            //_VideoDB.Insert (data.allVideos.ToArray ());
            //_VideoDB.SelectBDItems ();

            _VideosListAdapter = new VideosListAdapter (this, _VideoDB.SelectBDItems ().ToArray ());
            _UiVideosList.Adapter = _VideosListAdapter;
            //Intent i = new Intent (this, typeof(IncomingCallReceiver));
            //StartService (i);

            _telephonyManager = (TelephonyManager)GetSystemService (Context.TelephonyService)  as TelephonyManager;
            PhoneStateListener callListener = new PhoneStateListener ();
            PhoneStateListenerFlags callStateListenerFlags = new PhoneStateListenerFlags();
            _telephonyManager.Listen (callListener, PhoneStateListenerFlags.CallState);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.AcountVideoList);
            _UiVideosList = FindViewById<ListView> (Resource.Id.UiVideosList);

            FakeData data = new FakeData ();
            _VideoDB = new VideoBuyDB ();
            _VideoDB.ConnectToDB ("VideoBuyDB.db3");

            _VideosListAdapter = new VideosListAdapter (this, _VideoDB.SelectBDItems ().ToArray ());
            _UiVideosList.Adapter = _VideosListAdapter;
        }
Esempio n. 3
0
        public bool CreateDB()
        {
            if (_FileExists) {
                if (!TableExists ("VideoBuy", _connection)) {
                    _connection.Open ();
                    // This is the first time the app has run and/or that we need the DB.
                    // Copy a "template" DB from your assets, or programmatically create one like this:
                    var command =" CREATE TABLE IF NOT EXISTS VideoBuy (_VideoId INTEGER PRIMARY KEY NOT NULL, _VideoName ntext, _VideoLink ntext, _VideoPrice DECIMAL, _VideoTiming DECIMAL);";
                    using (var c = _connection.CreateCommand ()) {
                        c.CommandText = command;
                        c.ExecuteNonQuery ();
                    }

                    _connection.Close ();
                    FakeData data = new FakeData ();
                    this.Insert (data.allVideos.ToArray());
                }
            }
            return _FileExists;
        }