Click here to Skip to main content
15,357,086 members
Home / Discussions / Mobile
   

Mobile

 
QuestionRemoving Delay in Playing Mp3 Files in Windows Phone 8 Pin
Abdul Rahman Hamidy30-Dec-13 0:35
MemberAbdul Rahman Hamidy30-Dec-13 0:35 
AnswerRe: Removing Delay in Playing Mp3 Files in Windows Phone 8 Pin
Hadrich Mohamed31-Dec-13 9:24
professionalHadrich Mohamed31-Dec-13 9:24 
GeneralRe: Removing Delay in Playing Mp3 Files in Windows Phone 8 Pin
Abdul Rahman Hamidy31-Dec-13 17:00
MemberAbdul Rahman Hamidy31-Dec-13 17:00 
GeneralRe: Removing Delay in Playing Mp3 Files in Windows Phone 8 Pin
Hadrich Mohamed1-Jan-14 1:21
professionalHadrich Mohamed1-Jan-14 1:21 
GeneralRe: Removing Delay in Playing Mp3 Files in Windows Phone 8 Pin
Abdul Rahman Hamidy11-Jan-14 20:23
MemberAbdul Rahman Hamidy11-Jan-14 20:23 
GeneralRe: Removing Delay in Playing Mp3 Files in Windows Phone 8 Pin
Hadrich Mohamed12-Jan-14 0:26
professionalHadrich Mohamed12-Jan-14 0:26 
QuestionGoogle map API key sample code bellow but it will display on error Pin
junnubabu.N27-Dec-13 16:39
Memberjunnubabu.N27-Dec-13 16:39 
QuestionHow to speed up the populating of listview + filter Android Pin
Member 947380925-Dec-13 20:23
MemberMember 947380925-Dec-13 20:23 
Hi,
Android (C#) :
I am populating my listview from Sqlite (sometime also from DataTable)
1. when the data is huge its very slow ?
2. how to have filter for this with high speed ?(same as contact list )

Thanks in advanced !
For filtering i have seen this code :

_adapter.Filter.InvokeFilter(_inputSearch.Text);


but just work for one column :
_adapter = new ArrayAdapter<string>(this, Resource.Layout.list_item, Resource.Id.product_name, products);

No USE At ALL !!!!

my code :

protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Create your application here
            SetContentView(Resource.Layout.HesabList);

            progress = ProgressDialog.Show(this, "", "Loading ...");
            progress.SetProgressStyle(ProgressDialogStyle.Spinner);
            progress.Indeterminate = true;
            new Thread(new ThreadStart(delegate
            {
                _btnUpdate = FindViewById<Button>(Resource.Id.UpdateHesabList);
                _btnUpdate.Click += new EventHandler(_btnUpdate_Click);
                gvHesab = FindViewById<ListView>(Resource.Id.gvHesabList);
                gvHesab.ItemClick += new EventHandler<AdapterView.ItemClickEventArgs>(gvHesab_ItemClick);
                isTarafHesab = Intent.GetBooleanExtra("IsTarafHesab", false);
                txtSearchHesabList = (EditText)FindViewById(Resource.Id.txtSearchHesabList);
                txtSearchHesabList.TextChanged += new EventHandler<Android.Text.TextChangedEventArgs>(txtSearchHesabList_TextChanged);
                txtSearchHesabList.Gravity = GravityFlags.Right;

                Looper.Prepare();
                File dbtest = new File(clsBase.SqliteDBPath);
                
                if (!dbtest.Exists() )
                {

                    if (clsBase.HasInternetConnection(this))
                        createDbSqlite();
                    else
                    {
                        MessageBoxAndroid.Show(this, "Connect to Internet First !");
                        Finish();
                    }
                }
                else
                {
                     fillListView();
                 }

                RunOnUiThread(() => progress.Dismiss()); 
           })).Start();
            
        }


private void fillGridView()
        {
            try
            {  
                SQLiteDatabase db = OpenOrCreateDatabase("test.db", FileCreationMode.WorldReadable, null);

                ICursor cursors = db.RawQuery("select Moen, Hesab, opab, Coab,(select count(*) from tbl_Hest b  where a._id >= b._id) as _id,Id  from tbl_Hest a", null);
                
                String[] from = Resources.GetStringArray(Resource.Array.gvHesabHeader);

                int[] to = { Resource.Id.txt_HesabListGrid_Heen,
                             Resource.Id.txt_HesabListGrid_Heol ,Resource.Id.txt_HesabListGrid_Heb,
                             Resource.Id.txt_HesabListGrid_Coab,Resource.Id.txt_HesabListGrid_Row,Resource.Id.txt_HesabListGrid_Id};
                RunOnUiThread(() =>
               {
                   SimpleCursorAdapter _HesabGridAdapter = new HesabListGridview(this, Resource.Layout.HesabListGrid, cursors, from, to);
                    
                       gvHesab.Adapter = _HesabGridAdapter;
               });
                
                setListViewHeightBasedOnChildren(gvHesab);//بخورد Scroll برای حالتی که کل صفحه 
                gvHesab.TextFilterEnabled = true;
                
                EditText txtSearchHesabList = (EditText)FindViewById(Resource.Id.txtSearchHesabList);
                txtSearchHesabList.TextChanged += new EventHandler<Android.Text.TextChangedEventArgs>     
                (txtSearchHesabList_TextChanged);
                 
              
            }
            catch (Exception ex)
            {
                
            }
        }



    class HesabListGridview : SimpleCursorAdapter
    {
        ICursor c;
        //MatrixCursor cur;
        Context context;
        Activity activity;
        int idS;
        public HesabListGridview(Context context, int layout, ICursor c, string[] from, int[] to)
            : base(context, layout, c, from, to)
        {
            this.c = c; 
            this.context = context;
            this.activity = (Activity)context;

        }
        bool isFirst = true;
        public static int dtRowCount = 0;
        int CountRepeated = 0;
        public override Filter Filter
        {
            get
            {
                return base.Filter;
            }
        }
        public override IFilterQueryProvider FilterQueryProvider
        {
            get
            {
                return base.FilterQueryProvider;
            }
            set
            {
                base.FilterQueryProvider = value;
            }
        }
        public override View GetView(int position, View convertView, ViewGroup parent)
        {

            if (convertView == null)
                convertView = View.Inflate(context, Resource.Layout.HesabListGrid, null);
            View row = convertView;
            try
            {

                c.MoveToPosition(position);
                TextView txtHesabGrid_Coni = (TextView)convertView.FindViewById(Resource.Id.txt_HesabListGrid_Hesoen);
                TextView txtHesabGrid_Bde = (TextView)convertView.FindViewById(Resource.Id.txt_HesabListGrid_Hesol);
                TextView txtHesabGrid_Nab = (TextView)convertView.FindViewById(Resource.Id.txt_HesabListGrid_Heab);
                TextView txtHesabGrid_Cosab = (TextView)convertView.FindViewById(Resource.Id.txt_HesabListGrid_Coab);
                TextView txtHesabGrid_Row = (TextView)convertView.FindViewById(Resource.Id.txt_HesabListGrid_Row);
                TextView txtHesabGrid_Id = (TextView)convertView.FindViewById(Resource.Id.txt_HesabListGrid_Id);



                txtHesabGrid_Coni.SetText(c.GetString(c.GetColumnIndex("Hen")), TextView.BufferType.Normal);



                txtHesabGrid_Bde.SetText(c.GetString(c.GetColumnIndex("Hl")), TextView.BufferType.Normal);


                txtHesabGrid_Nab.SetText(c.GetString(c.GetColumnIndex("Heb")), TextView.BufferType.Normal);

                txtHesabGrid_Cosab.SetText(c.GetString(c.GetColumnIndex("Coab")), TextView.BufferType.Normal);

                txtHesabGrid_Row.SetText(c.GetInt(c.GetColumnIndex("_id")).ToString(), TextView.BufferType.Normal);

                txtHesabGrid_Id.SetText(c.GetString(c.GetColumnIndex("Id")), TextView.BufferType.Normal);
                txtHesabGrid_Id.Visibility = ViewStates.Gone;
                //txtHesabGrid_Id.Visibility = ViewStates.Invisible;
                if (position % 2 == 0)
                {

                    convertView.SetBackgroundColor(Android.Graphics.Color.ParseColor("#6bcdfb"));
                }
                else
                {
                    convertView.SetBackgroundColor(Android.Graphics.Color.ParseColor("#2cb8de"));
                }
                CountRepeated++;
               // MessageBoxAndroid.Show(context, CountRepeated.ToString()  + "\n" + dtRowCount.ToString());
                if (17 == CountRepeated)
                {
                    isFirst = false;
                }
                if (isFirst)
                {
                    
                    HorizontalScrollView hv = (HorizontalScrollView)activity.FindViewById(Resource.Id.scrollHesabListGrid);
                    hv.FullScroll(FocusSearchDirection.Left);

                }
            }
            catch (Exception ex)
            {
                    }

            //hv.ScrollTo(hv.Right + 80, hv.Top);
            return (row);
        }




    }
}

QuestionEncryption in Portable Classes Pin
Member 1047755319-Dec-13 8:46
MemberMember 1047755319-Dec-13 8:46 
Questionmaps Pin
junnubabu.N13-Dec-13 16:18
Memberjunnubabu.N13-Dec-13 16:18 
AnswerRe: maps Pin
Tom Marvolo Riddle30-Dec-13 2:24
professionalTom Marvolo Riddle30-Dec-13 2:24 
QuestionPush notifications to IsolatedStore Pin
Alex C. Duma10-Dec-13 20:29
MemberAlex C. Duma10-Dec-13 20:29 
QuestionCopying and Playing of an mp3 from a URL in Windows Phone 8 Pin
Vimalsoft(Pty) Ltd8-Nov-13 23:10
professionalVimalsoft(Pty) Ltd8-Nov-13 23:10 
SuggestionRe: Copying and Playing of an mp3 from a URL in Windows Phone 8 Pin
Richard MacCutchan8-Nov-13 23:41
mveRichard MacCutchan8-Nov-13 23:41 
GeneralRe: Copying and Playing of an mp3 from a URL in Windows Phone 8 Pin
Vimalsoft(Pty) Ltd8-Nov-13 23:45
professionalVimalsoft(Pty) Ltd8-Nov-13 23:45 
QuestionHow to Download the a Video,Audio, PDF, etc into a Local Storage Pin
Vimalsoft(Pty) Ltd8-Nov-13 20:55
professionalVimalsoft(Pty) Ltd8-Nov-13 20:55 
QuestionXML contents to Model in C# Windows Phone Pin
Vimalsoft(Pty) Ltd8-Nov-13 6:49
professionalVimalsoft(Pty) Ltd8-Nov-13 6:49 
AnswerRe: XML contents to Model in C# Windows Phone Pin
Vimalsoft(Pty) Ltd8-Nov-13 7:23
professionalVimalsoft(Pty) Ltd8-Nov-13 7:23 
QuestionAjax Navigation in Windows Phone 8 Pin
santhosh_init6-Nov-13 21:10
Membersanthosh_init6-Nov-13 21:10 
AnswerRe: Ajax Navigation in Windows Phone 8 Pin
Hadrich Mohamed31-Dec-13 9:15
professionalHadrich Mohamed31-Dec-13 9:15 
Questioneclipse Pin
Member 103849266-Nov-13 12:38
MemberMember 103849266-Nov-13 12:38 
AnswerRe: eclipse Pin
Richard MacCutchan6-Nov-13 23:02
mveRichard MacCutchan6-Nov-13 23:02 
QuestionLooking for cross platform development/framework feedback Pin
Joe Woodbury30-Oct-13 5:53
professionalJoe Woodbury30-Oct-13 5:53 
AnswerRe: Looking for cross platform development/framework feedback Pin
Jeremy Hutchinson30-Oct-13 7:05
professionalJeremy Hutchinson30-Oct-13 7:05 
AnswerRe: Looking for cross platform development/framework feedback Pin
A_WoodApple30-Oct-13 8:39
MemberA_WoodApple30-Oct-13 8:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.