AndroidJetPack v3.0 released

clock August 24, 2015 03:14 by author Administrator

It is with great excitement that we are announcing a new version of our Android DataGrid product. We have been hard at work over the past few weeks adding features, fixing bugs, and making changes to the product to fit your business requirements better.

 In this release, we have added three major features and a number of smaller enhancements, bug fixes and performance improvements:

 Major features:

 1)     Added support for Row Drag and Drop / Reorder operations

2)     Added support for column drag and drop rearrangement

3)     Added support for column drag and resize

 Here is a full blog post that explains the usage of the first feature :http://blog.androidjetpack.com/post/New-feature-added-Drag-and-Drop.aspx

 For the other two features, they are quite straightforward to use, you don’t have to do anything, just get a new library version, and it will work! If you don’t want the columns to be draggable, just set draggable = false. If you don’t want them to be resizable, just set resizable = false.

 We are looking for feedback on this feature, so please feel free to chime in!

 In addition to the above, we have numerous other smaller enhancements/big fixes:

 1)     Enhancement: Added support for fontSize for all cells : The following properties were added : headerStyleName, footerStyleName, columnGroupStyleName

2)     Bug Fix:  In certain circumstances, cells were disappearing

3)     Enhancement: Added support for custom date picker dialog

4)     Enhancement: Added the itemLongClick event

5)     Enhancement: Added columnWidthMode=fixed

6)     Bug Fix: for multi picker, if everything  is selected, behave as if nothing is selected.

7)     Bug Fix: useLabelFunctionForFilterCompare was not working

8)     Bug Fix: LastWeek/ThisWeek/NextWeek date range was not calculating the right date.

9)     Enhancement: Support for custom Date ranges and border drawing mechanism. Custom Date Range Example added.

10) Bug Fix: Label Function 2 was ignored and footer formatter precision was being ignored.

11) Enhancement: Added filler section lines.

12) Bug Fix: Fix for page size checkbox not showing even if no paging enabled

13) Bug Fix: Fix for thickness of vertical and horizontal gridlines not working + fix for excludeFromSettings not working

14) Bug Fix: Fix for the background cells not using the border color assigned

15) Bug Fix: Fix for headerAlign not having an impact.

16) Enhancement: Added support for moving columns in settings popup. Fix bug with dynamic levels. Fix bug with expand collapse icon showing up where it should not.

17) Enhancement: Support for filter watermark and filter autocomplete

18) Enhancement: Added support for filter textinput icon and icon click filter clear.

19) Enhancement: Added support for Xamarin

20) Enhancement: Added resizeLisntenerPaused, support for cellTextColors (font), removed unused properties from FlexDataGrid, Added styleName,

 As you can see, we have been hard at work enhancing the product for your needs. Please feel free to reach out in case you need help evaluating the product!



Enabling proguard causes application to crash

clock July 1, 2015 02:52 by author Administrator

When you use our library, please make sure you exclude it from proguard.  

 http://stackoverflow.com/questions/7721397/how-to-make-proguard-ignore-external-libraries 

http://stackoverflow.com/questions/4475074/how-can-i-exclude-external-jar-from-obfuscation-by-proguard-android-project

 If you don't want to edit the Ant script, you can add -keep options to proguard.cfg for the classes in those external jars. For instance:

-keep class com.flexicious.** { *; }

Or with a regular expression containing a negator:

-keep class !com.yournamespace.** { *; }

 

Once you do this, you might have issues with function callbacks like this :

2015-06-29 12:47:50,662 - [Crash_Report] : java.lang.RuntimeException: NoSuchMethodException.Method dataGridChangeColorFunction does not exist on com.yournamespace.yourfile is a list of methods found:

This is because proguard will rename methods on your class - but the XML configuration is still referring to those names. So you need to do the same thing with the configuration - that is add a keep configuration to the proguard script


 

 



New feature added - Drag and Drop

clock May 6, 2015 03:07 by author Administrator

For our upcoming release, we have added an exciting new feature, drag and drop... The way it works is quite simple actually:

<grid

    enableExport="true"

    enableFilters="true"

    enableFooters="true"

    enablePreferencePersistence="true"

    enablePrint="true"

    forcePagerRow="true"

    pageSize="50"

    enablePaging="true"

    enableDrag="true"

    enableDrop="true"

    dragDropCompleteFunction="onDragComplete"

    >

 

This will enable the drag and drop operation on the grid. And here is the drag complete function

 

      //perform our action as a result of  drag drop.

      public void onDragComplete(IFlexDataGridDataCell target,FlexDataGrid targetGrid){           

            FlexDataGrid dragTriggerGrid=target.getLevel().getGrid();
            FlexDataGrid dropGrid=dragTriggerGrid;           

            Object dragItem= dragTriggerGrid.getDragRowData();//the object that we began the drag on
            Object dropItem=target!=null?target.getRowInfo().getData():null; //the object that we dropped on            

            List destArr =targetGrid.getDataProvider () ;
            List srcArr =dragTriggerGrid.getDataProvider() ;           

            srcArr.remove(srcArr.indexOf(dragItem)); //drop it into target

            destArr.add(dropItem!=null?destArr.indexOf(dropItem)+1:destArr.size()>0?destArr.size()-1:0,dragItem); //remove it from source           

            dragTriggerGrid.clearSelection();
            dropGrid.clearSelection();           

            Float pos = dropGrid.getVerticalScrollPosition();

            dragTriggerGrid.rebuild();    //rebuild
            dropGrid.rebuild();           

            dropGrid.validateNow();
            dropGrid.gotoVerticalPosition(pos);           

 

      }

This is what it will look like:


 

And here is the code:

MySampleApp.zip (157.58 kb)



Using Custom Widgets in during editing the Android DataGrid

clock April 13, 2015 22:19 by author Administrator

As we saw in the previous blog post, each cell in the DataGrid can be customized to render a custom widget within it. This also holds true for the edit mode version of each cell. When the grid is put into edit mode, we draw a row of editors on top of the grid and place editors for each editable column in place of the cell. So this looks like:

 

 

In this example, we are going to replace the editor for one of the columns with a Spinner. The default editor is a Text Input. Using a spinner means we have to do the following things:

 

1) Make sure we specify the itemEditor in the markup:

                itemEditor="com.flexicious.mysampleapp.SpinnerEditor"

 2) MAke sure we tell the grid that we are using a custom editor, so we will take care of populating it from the data, and populating the data back from it: 

                itemEditorManagesPersistence="true"

 

 3) Implement the itemEditorInitialize and Commit Functions

            //because we have a custom spinner as an editor, we need to write code to

            //populate it when the spinner loads, and then take the value from the spinner

            //when the user clicks ok button. The following two functions will accomplish this task

            grid.rowEditBehavior.itemEditorsInitializeFunction= new Function(this,"initializeEditors");

            grid.rowEditBehavior.itemEditorsCommitFunction= new Function(this,"commitEditors");

 

       /**

       * This method is responsible for taking the values from the editors, and making sure

       * that the values are applied to the row data on click OK of the editor row.

       * @param editors A Map of the unique identifier of the column the editor belongs to, and the editor

       */

      public void commitEditors(HashMap<String,Object> editors){

            FlexDataGrid grid = (FlexDataGrid) findViewById(R.id.flexDataGrid);

            Object itemBeingEdited = grid.getCurrentEditingCell().getRowInfo().getData();

            for(String key : editors.keySet()){

                  View editor = (View) editors.get(key);

                  if(editor instanceof SpinnerEditor){

                        FlexDataGridColumn column = grid.getColumnByUniqueIdentifier(key);

                        SpinnerEditor spinnerEditor = (SpinnerEditor) editor;

                        UIUtils.setPropertyValue(itemBeingEdited, column.getDataField(), spinnerEditor.getSelectedItem());

                  }

            }

      }

      /**

       * This method is responsible for taking the values from the item being edited, and making sure

       * that the values are applied to the editors on load.

       * @param editors A Map of the unique identifier of the column the editor belongs to, and the editor

       */

      public void initializeEditors(HashMap<String,Object> editors){

            FlexDataGrid grid = (FlexDataGrid) findViewById(R.id.flexDataGrid);

            Object itemBeingEdited = grid.getCurrentEditingCell().getRowInfo().getData();

            for(String key : editors.keySet()){

                  View editor = (View) editors.get(key);

                  if(editor instanceof SpinnerEditor){

                        //is this our spinner editr?

                        FlexDataGridColumn column = grid.getColumnByUniqueIdentifier(key);

                        SpinnerEditor spinnerEditor = (SpinnerEditor) editor;

                    Object compareValue = UIUtils.resolveExpression(itemBeingEdited, column.getDataField());

                    //get the value from the item being edited

                    if(compareValue!=null)

                    {

                        //apply this value.

                          ArrayAdapter<String> adapter = (ArrayAdapter<String>) spinnerEditor.getAdapter();

                              int spinnerPostion = adapter.getPosition((String) compareValue);

                          spinnerEditor.setSelection(spinnerPostion);

                    }

                  }

            }

      }

 

Thats it! This gives you a lot of control over the kind of item editors you can use. and the logic you want to associate with them!. Full code attached.

 

 

project.zip (153.87 kb)



Android DataGrid Vertical Header Text

clock April 12, 2015 04:58 by author Administrator

One of the most powerful features of the Android DataGrid product is the ability to control the content of each cell that sits inside the grid. 

 Inside each cells is the actual component that renders the content of the cell. These are represented by the following properties on the column or the level

  •  
    • itemRenderer
    • headerRenderer
    • footerRenderer
    • pagerRenderer
    • filterRender
    • nextLevelRenderer


       The above properties point to class factories for item renderer instances that display the data for each item in the column. You can specify a ClassFactory custom item renderer component as the value of these properties. The default item renderer is a Label class, which displays the item data as text.


If specifying custom label text is not enough for your needs, you can use itemRenderers, which is a very powerful concept. Item Renderers are basically UIComponents that sit inside the various cells of the grid.  

In this example, we are going to specify a custom header renderer that renders the text vertically. This is what it will look like:

 



 

How do we do this? Just look at the code in red:

<?xml version="1.0" encoding="UTF-8"?>

<grid

    enableExport="true"

    enableFilters="true"

    enableFooters="true"

    enablePreferencePersistence="true"

    enablePrint="true"

    forcePagerRow="true"

    pageSize="50"

    enablePaging="true">

 

    <level>

        <columns>

            <column

                dataField="label"

                headerText="Name"

                filterControl="TextInput"

                filterOperation="Contains"

                headerRenderer="com.flexicious.mysampleapp.ItemRenderers_VerticalTextRenderer"

                footerLabel="Count: " footerOperation="count" footerOperationPrecision="3"/>

            <column

                dataField="data"

                headerText="Type"

                filterControl="TextInput"

                headerRenderer="com.flexicious.mysampleapp.ItemRenderers_VerticalTextRenderer"

                filterOperation="Contains"

                footerLabelFunction="customFooterFunction"

                />

        </columns>

    </level>

 

</grid>

 

 And the renderer:

package com.flexicious.mysampleapp;

 

public class ItemRenderers_VerticalTextRenderer extends TextView {

     

      final boolean topDown = false;

       

     

      public Object getData() {

            return data;

      }

 

      public void setData(Object data) {

      }

       

 

         @Override

         protected void onDraw(Canvas canvas){

            TextPaint textPaint = getPaint();

            textPaint.setColor(getCurrentTextColor());

            textPaint.drawableState = getDrawableState();

 

            canvas.save();

 

            if(topDown){

               canvas.translate(getWidth(), 0);

               canvas.rotate(90);

            }else {

               canvas.translate(0, getHeight());

               canvas.rotate(-90);

            }

 

 

            canvas.translate(getCompoundPaddingLeft(), getExtendedPaddingTop());

 

            getLayout().draw(canvas);

            canvas.restore();

        }

     

      private Object data;

 

}

 

 Full sample code:

MySampleApp.zip (157.35 kb)



Using JSON data with Xamarin

clock April 8, 2015 01:32 by author Administrator

As most of you are aware, our Android DataGrid has built in support for rendering JSON data. For example, you can use the following code in Java to show JSON 

/**
* Takes a grid, and an XML configuration, loads the XML configuration into the Grid.
* @param grid
* @param resource
*/
public void buildGrid(FlexDataGrid grid, Integer resource) {
            grid.delegate = this;
            BufferedReader reader = new BufferedReader(new InputStreamReader(this.getResources().openRawResource(resource)));
            StringBuilder builder = new StringBuilder();
            String aux = "";
            try {
                  while ((aux = reader.readLine()) != null) {
                        builder.append(aux);
                  }
            } catch (IOException e) {
                  throw new RuntimeException(e);
            } 

            String text = builder.toString();
            flexDataGrid.buildFromXml(text);
      }

 

      /**
       * Parses json data and passes it to the grid to display
       * @param grid
       * @param resource
       */
      public void loadJsonData(FlexDataGrid grid, Integer resource) {
            BufferedReader jsonReader = new BufferedReader(new InputStreamReader(
                        this.getResources().openRawResource(resource)));
            StringBuilder jsonBuilder = new StringBuilder();
            try {
                  for (String line = null; (line = jsonReader.readLine()) != null;) {
                       jsonBuilder.append(line).append("\n");
                  }
            } catch (IOException e) {
                  throw new RuntimeException(e);
            }

 

            // Parse Json
            this.flexDataGrid.setDataProviderJson(jsonBuilder.toString());
      }

 

How would you do the same in c# Xamarin? Well, code is surprising similar:

[Activity (Label = "AndroidApp", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {
        int count = 1;
        FlexDataGrid flexDataGrid;

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

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button> (Resource.Id.myButton);
            
            button.Click += delegate {
                button.Text = string.Format ("{0} clicks!", count++);
            };

            flexDataGrid = FindViewById<FlexDataGrid> (Resource.Id.flexDataGrid1);

            LoadJsonData(flexDataGrid, Resource.Raw.flxsdatamocknesteddata);
        
        } 
        public void LoadJsonData(FlexDataGrid grid, int resource)
        {
            BufferedReader reader = new BufferedReader(new InputStreamReader(this
                .Resources.OpenRawResource(resource)));
            StringBuilder builder = new StringBuilder();
            string aux = "";
            try {
                while ((aux = reader.ReadLine()) != null) {
                    builder.Append(aux);
                }
            } catch (IOException e) {
                throw new RuntimeException(e);
            }

            string text = builder.ToString();
            grid.SetDataProviderJson (builder.ToString ());
        }
    }

 

Attached is a sample (you will need to place your copy of the bindings dll in it).

AndroidApp.zip (87.06 kb)



Xamarin Support - DataProvider Data Type

clock April 6, 2015 19:47 by author Administrator

Now that our latest build with Xamarin support is out, some of our customers had this question:

1. In your demo, you used NameValue as datasource, but it only generates two columns data, how do I produces more column? 

Well, basically the idea is to provide a class that inherits from Java.Lang.Object as the dataprovider to the grid, and expose its properties to the ACW using getters and exporting them.

Example:



    public class Employee : Java.Lang.Object
    {
        public string Name = "";
        public string PhoneNumber ="";
        public string Title ="";
        public string Address ="";

        [Java.Interop.Export("getName")]
        public string getName(){
            return this.Name;
        }
        [Java.Interop.Export("getPhoneNumber")]
        public string getPhoneNumber(){
            return this.PhoneNumber;
        }
        [Java.Interop.Export("getTitle")]
        public string getTitle(){
            return this.Title;
        }
        [Java.Interop.Export("getAddress")]
        public string getAddress(){
            return this.Address;
        }
    }

 

 

If you do this, you should be able to use the following XML and see the results:

      <column
          dataField="Name"
          headerText="Name" />
      <column
          dataField="PhoneNumber"
          headerText="PhoneNumber" />
    </columns>

 

 

Full code is attached to this post.

grid_config.xml (570.00 bytes)

MainActivity.cs (3.93 kb)



Android JetPack 2.1 released - Xamarin Support Added!

clock February 23, 2015 01:09 by author Administrator

As you may have see in our previous blog post, http://blog.androidjetpack.com/post/Android-DataGrid-Xamarin-Support-Added-Java-Binding-Project-Issues.aspx. we have been working on a Xamarin port of our Android JetPack DataGrid component. With 2.1 release, we have accomplished this!

API Changes

From an API perspective, there were a few changes, primarily to match the "Xamarin way" of doing things. Here are the API changes. They are very minimal, but if you are using sample code from previous versions, you may need to make these changes:

1) Removed com.flexicious.controls.core.IExtendedView#getEnabled() (Change this to .isEnabled())

2) Removed com.flexicious.controls.core.IExtendedView#setEnabled(java.lang.Boolean)

3) Removed com.flexicious.controls.interfaces.filters.IFilterControl.validateNow()

4) Minor interface changes to ISelectFilterControl, ITriStateCheckBoxFilterControl, IDataGridFilterColumn

5) Removed the toaster package, since we use built in Android Toast

6) Added setOnAllEventListener & getOnAllEventListener to FlexDataGrid. This allows you to do grid.AllEvent += delegate (Xamarin way, in case you dont want to use the regular event function call back mechanism). 

7) If you get errors in compiling StyleManager 

Please replace 

 grid.paddingBottom = 2;

              grid.paddingLeft = 2;

              grid.paddingRight = 2;

 

              grid.paddingTop = 2;

With: 

grid.cellPaddingBottom = 2;

              grid.cellPaddingLeft = 2;

              grid.cellPaddingRight = 2;

              grid.cellPaddingTop = 2;

 

8) You may also need to change .getEnabled to .isEnabled. 

These properties were renamed because they clashed with some Xamarin naming conventions


Most of these changes should not mean much to you, unless you are programming deep inside the exposed API.

Getting Started With Xamarin & Android JetPack

1) The first thing to do, is to add the usual resources to the drawable, raw, layout, folders, and making changes to AndroidManfiest.xml as demonstrated in the getting started guide. (http://www.androidjetpack.com/newdocs/html/AndroidJetPackAndroidDataGrid.html)

2) Second, is as usual, to add the reference to the XamarinStudioBindings.dll file that is included in the Sample Download

3) Third, in your Main.axml file, just add the FlexDataGrid component, similar to how it would be added in Android Studio or Eclipse. (http://www.androidjetpack.com/newdocs/html/AndroidJetPackAndroidDataGrid.html?PlacingtheAndroidDataGridinyourv.html) - You can see this in the file you downladed. 

4) In your MainActivity, you can get a handle to the grid, build it using a XML configuration, provide a Data Provider, and wire up event handlers. 

Lets take a quick look at the important pieces of the MainActivity:

using System;

using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Com.Flexicious.Nestedtreedatagrid;
using Com.Flexicious.Nestedtreedatagrid.Valueobjects;
using System.Collections.Generic;
using Java.IO;
using Java.Lang;
using Com.Flexicious.Nestedtreedatagrid.Events;
using Com.Flexicious.Nestedtreedatagrid.Interfaces;
using Com.Flexicious.Controls.Core;
using Android.Graphics;

namespace AndroidApp
{
    [Activity (Label = "AndroidApp", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {
        int count = 1;
        FlexDataGrid flexDataGrid;

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

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button> (Resource.Id.myButton);
            
            button.Click += delegate {
                button.Text = string.Format ("{0} clicks!", count++);
            };

            //Here, we get a reference to the Android JetPack DataGrid component
            flexDataGrid = FindViewById<FlexDataGrid> (Resource.Id.flexDataGrid1);

            //Here, we setup a dataprovider - the objects in the DataProvider MUST inherit from Java.Lang.Object, OR expose 
            //themselves to the ACW using the EXPORT attribute
            IList<object> list = new List<object> ();
            for (int i = 0; i < 1000; i++) {
                list.Add(new NameValue("Name " + i, "Value " + i));
            }
            //HERE, we build the grid using the XML config in grid_config.xml raw resource
            BuildGrid(flexDataGrid, Resource.Raw.grid_config);
            //Now, we set the data provider on the grid.
            flexDataGrid.DataProvider=(list);

            //Finally, if you are using ItemRenderers, they cannot be set in XML, you need to use API to set them like below. 
            //Also, please ensure that the setData and getData methods are exported via the Java.Interop.Export attribute. 
            //flexDataGrid.GetColumnByDataField ("data").ItemRenderer = new ClassFactory (new TextInputRenderer(this).Class);
        
        }
        //This is an example of a CALLBACK function. The key is to ensure 1) Both the arguments and the return value inherit from Java.Lang.Object
        //And 2) That you add the Java.Interop.Export Attribute as shown below.
        [Java.Interop.Export("getCellBackground")]
        public Java.Lang.Object getCellBackground(IFlexDataGridCell cell) {

            if (!cell.RowInfo.IsDataRow.BooleanValue()) {
                return null;
            }
            if (cell.Column.DataField==("data")) {
                return new Java.Lang.Integer (Color.Red);// null;//Color.Red;
            } else if (cell.Text==("Name 1")) {
                return new Java.Lang.Integer (Color.Blue);// null;//Color.Red;
            }
            //this makes the grid use whatever color it would have by default.
            return null;
        }

        //This is an example of a Event Handler function. The key is to ensure 1) Both the arguments and the return value inherit from Java.Lang.Object
        //And 2) That you add the Java.Interop.Export Attribute as shown below.
        [Java.Interop.Export("onItemClick")]
        public  void onItemClick(FlexDataGridEvent e){
            Toast.MakeText(this"You Clicked on : "+((NameValue) e.Cell.RowInfo.Data).Label, ToastLength.Short).Show();
        }
        [Java.Interop.Export("onChange")]
        public  void onChange(FlexDataGridEvent e){
            Toast.MakeText(this"Grid Selection Changed : Items selected : " + e.Grid.SelectedObjects.Count, ToastLength.Short).Show();
        }

        /**
        * Takes a grid, and an XML configuration, loads the XML configuration into the Grid.
        * @param grid
        * @param resource
        */
        public void BuildGrid(FlexDataGrid grid, int resource) {
            grid.Delegate = (this);
            BufferedReader reader = new BufferedReader(new InputStreamReader(this
                .Resources.OpenRawResource(resource)));
            StringBuilder builder = new StringBuilder();
            string aux = "";
            try {
                while ((aux = reader.ReadLine()) != null) {
                    builder.Append(aux);
                }
            } catch (IOException e) {
                throw new RuntimeException(e);
            }

            string text = builder.ToString();
            grid.BuildFromXml(text);
        }


    
    }
}

 

 



Android DataGrid - Xamarin Support Added - Java Binding Project Issues

clock February 22, 2015 19:58 by author Administrator

One of the most frequent requests we are getting from customers evaluating our Android DataGrid product, is support for Xamarin.

Finally, after a long period of research, and overcoming some of the technical hurdles with cross JNI method calls, we are pleased to announce, that we now have a Binding DLL ready for Xamarin!

This is a feature a a lot of you had been asking for. The task was not easy, we encountered a number of technical hurdles. Most of them were fairly basic, but here are some that took a little head scratching. 

 

1) First, when we used the Xamarin Binding Project, any RequestTask based class we had, failed to convert to C# with the following errro :

Error Message : Error CS0534: does not implement inherited abstract member 'Android.OS.AsyncTask.DoInBackground(params Java.Lang.Object[])' (CS0534) (XamarinStudioBindings)

Solution: Turns out, this is a bug with Xamarin - see http://forums.xamarin.com/discussion/31668/android-java-binding-change-method-signature . There are multiple solutions proposed, the one that worked for us was to change:

protected virtual string DoInBackground (params  string[] p0) to protected override Java.Lang.Object DoInBackground (params  Java.Lang.Object[] p0) in the generated class. 

2) Second, for some reason, when pasting text into Xamarin Studio in the grid_config.xml, we got this :

Error Message : org.xml.sax.SAXParseException: Unexpected token (position:TEXT @1:2 in java.io.StringReader@45093440)

Solution : When opened in the HEX editor, there was indeed a wierd character at position zero. Removing the corrupt character from the file resovled this issue.

3) Finally, for those of you who are familiar with our API, the grid exposes a number of events, callback functions, etc. The problem is that with Xamarin C#, these methods are not exposed to the Android Callable Wrapper. This results in :

Error Message :  E/AndroidRuntime( 2506): Caused by: java.lang.NoSuchMethodException: m

Solution : The way to fix this is to add the Java.Interop.Export attribute to your code that gets called in xamarin [Export]. You will need to add Mono.Android.Export assembly to your References in your project. For example:

 [Java.Interop.Export("onChange")]

        public  void onChange(FlexDataGridEvent e){
            Toast.MakeText(this"Grid Selection Changed : Items selected : " + e.Grid.SelectedObjects.Count, ToastLength.Short).Show();
        }

 

4) The issue with the above, is that for some methods, you will get this

Error XA4209: Failed to create JavaTypeInfo for class:due to System.NullReferenceException: Object reference not set to an instance of an object

Solution : Ensure that the return type, as well as the parameters all inherit from Java.Lang.Object. For example, instead of returning Integer from a method, return Java.Lang.Integer. 

This post In a future post, we will go over the actual usage of the library dll. This post was mainly designed for those poor folks who are in the same position as us, trying to make a Xamarin dll out of a fairly large Android Library Jar.



Android DataGrid - version 2.0 released!

clock January 26, 2015 02:30 by author Administrator

It is with great pleasure and excitement that we are releasing the next version of our Android JetPack Android DataGrid product!

We have listened to your feature requests, worked hard on fixing bugs, improving performance, and creating tons of examples and documentation for you!

So, without further ado, presenting, Android JetPack Android DataGrid v2.0

Features & Enhancements:

-> Significantly improved, downloadable, indexed and searchable user guide. More Details here

-> Implemented the custom date range picker : More details and screenshot here

-> Added support for Custom Date Ranges : More details here

-> Added support for preference persistence, and added examples to the user guide to show how to persist the state of the grid.

-> Enhanced the TextInputFilter (Edit Text Filter) with AutoComplete, Icon Support, and Hint. More details here.

-> Added the new itemLongClick event, when the user long presses a cell, this event will be dispatched.

-> Added support for columnWidthMode fixed and fitToContent. If you set columnWidthMode="fitToContent", the grid will automatically determine the longest string to be displayed and size the column wide enough to fit that string.

-> The grid will draw its own borders now.

-> The Alternating item colors will contine to fill the grid if there is no data, so it does not show a blank area if the grid does not have enough data to fill up the entire height of the grid

-> Added support for the headerAlign property, to align header cells.

-> 

Bug Fixes:

-> In certain scenarios, when you scroll to the right and scroll back quickly, certain areas of the grid did not paint correctly

-> When you scroll left and right, the header text of some columns did not refresh (if the cells are recycled, they retained the previous cells value)

-> Date ComboBox Filter was not working

-> ComboBox filter in certain scenarios was filtering on the last chosen value.

-> In the Editable Grid samples, when the keyboard was dismissed, the grid was blank. 

-> For MultiSelectComboBox, selecting all items continued to run the filter, instead of behaving as if nothing was selected.

-> The flag useLabelFunctionForFilterCompare was being ignored.

-> Bug Fix in calculation of the Last,This and Next week date range values.

-> labelFunction2, and footerFormatterPrecision were not being executed

-> On the settings popup, the pageSize checkbox was shown even if enablePaging was set to false

-> Fix for thickness of vertical and horizontal gridlines not working + fix for excludeFromSettings not working

-> Fix bug with expand collapse icon showing up where it should not.

Performance Optmizations:

->  Enhanced performance of filtering operations

-> Optmizied vertical scrolling performance (please ensure you are not running in debug mode)

 

We are very excited with this new release, and are looking forward to your feedback. Good or bad, we want to hear it! We work very hard to make sure that our product meets your requirements, and we want to hear your opinions and your ideas on how we can improve!



AndroidJetPack Team Blog


Tag cloud