Click here to Skip to main content
15,880,608 members
Home / Discussions / Mobile
   

Mobile

 
GeneralRe: Flash Banner in Mobile Pin
Sunasara Imdadhusen23-May-14 0:20
professionalSunasara Imdadhusen23-May-14 0:20 
QuestionWindow mobile development Pin
ravikhoda3-Feb-14 19:12
professionalravikhoda3-Feb-14 19:12 
AnswerRe: Window mobile development Pin
thatraja3-Feb-14 20:18
professionalthatraja3-Feb-14 20:18 
GeneralRe: Window mobile development Pin
ravikhoda3-Feb-14 20:20
professionalravikhoda3-Feb-14 20:20 
GeneralRe: Window mobile development Pin
Sunasara Imdadhusen26-Apr-14 0:56
professionalSunasara Imdadhusen26-Apr-14 0:56 
QuestionHow to merge mp3 files into one in windows phone 8 Pin
Abdul Rahman Hamidy3-Feb-14 4:28
Abdul Rahman Hamidy3-Feb-14 4:28 
QuestionHow to add pivot item to wp8 Pin
Abdul Rahman Hamidy28-Jan-14 20:10
Abdul Rahman Hamidy28-Jan-14 20:10 
QuestionHow to draw a straight line 3 cm?( windows phone) Pin
chinakknd11-Jan-14 14:39
chinakknd11-Jan-14 14:39 
AnswerRe: How to draw a straight line 3 cm?( windows phone) Pin
Richard MacCutchan11-Jan-14 22:17
mveRichard MacCutchan11-Jan-14 22:17 
QuestionTextBlock does not display all Text (Windows Phone 8) Pin
Abdul Rahman Hamidy3-Jan-14 19:12
Abdul Rahman Hamidy3-Jan-14 19:12 
AnswerRe: TextBlock does not display all Text (Windows Phone 8) Pin
PavanPareta9-Jan-14 19:29
PavanPareta9-Jan-14 19:29 
Questionsystem.data version conflict? Pin
murali_utr3-Jan-14 3:46
murali_utr3-Jan-14 3:46 
Questionnot enough space on disk Pin
murali_utr3-Jan-14 3:43
murali_utr3-Jan-14 3:43 
QuestionRemoving Delay in Playing Mp3 Files in Windows Phone 8 Pin
Abdul Rahman Hamidy30-Dec-13 0:35
Abdul 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
Abdul 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
Abdul 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
junnubabu.N27-Dec-13 16:39 
QuestionHow to speed up the populating of listview + filter Android Pin
Member 947380925-Dec-13 20:23
Member 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
Member 1047755319-Dec-13 8:46 
Questionmaps Pin
junnubabu.N13-Dec-13 16:18
junnubabu.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
Alex C. Duma10-Dec-13 20:29 

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.