hi
i got error in first use of data grid in android .
this is my code
public class TestData extends ArrayList<TestDataItem> { Random r = new Random(); public TestData() { Populate(); } public void Populate() { Random r = new Random(); double curr = 10.0; for (int i = 0; i < 1000; i++) { TestDataItem item = new TestDataItem(); item.setLabel(((Integer) i).toString()); curr += -2.0 + r.nextDouble() * 4.0; item.setValue((int) Math.round(curr)); add(item); } }}
public class TestDataItem { private int _value; public int getValue() { return _value; } public int setValue(int value) { _value = value; return value; } private String _label; public String getLabel() { return _label; } public String setLabel(String value) { _label = value; return value; }}
DataGridView dataGrid = new DataGridView(this);TestData data = new TestData();dataGrid.setDataSource(data);RelativeLayout layout = (RelativeLayout)findViewById(R.id.RelLayout1);layout.addView(dataGrid);and this is the error:/AndroidRuntime: FATAL EXCEPTION: main Process: smartview.oceanwide.com.androidsmartview, PID: 21714 java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference at android.icu.text.DecimalFormat.appendAffix(DecimalFormat.java:4317) at android.icu.text.DecimalFormat.subformat(DecimalFormat.java:1395) at android.icu.text.DecimalFormat.subformat(DecimalFormat.java:1331) at android.icu.text.DecimalFormat.format(DecimalFormat.java:928) at android.icu.text.DecimalFormat.format(DecimalFormat.java:784) at java.text.DecimalFormat.format(DecimalFormat.java:617) at java.text.NumberFormat.format(NumberFormat.java:289) at com.infragistics.controls.NumericCellPresenter.formatCellValue(NumericCellPresenter.java:53) at com.infragistics.controls.NumericCellPresenter.modelUpdatedOverride(NumericCellPresenter.java:26) at com.infragistics.controls.CellPresenterBase.modelUpdated(CellPresenterBase.java:13) at com.infragistics.controls.GridContentLayout.doRefresh(GridContentLayout.java:253) at com.infragistics.controls.GridContentLayout.scheduleRefresh(GridContentLayout.java:65) at com.infragistics.controls.GridContentLayout.refresh(GridContentLayout.java:27) at com.infragistics.controls.GridImplementation.refreshPosition(GridImplementation.java:1493) at com.infragistics.controls.GridImplementation.setViewport(GridImplementation.java:1734) at com.infragistics.controls.DataGridView.onSizeChanged(DataGridView.java:196) at android.view.View.sizeChange(View.java:19719) at android.view.View.setFrame(View.java:19680) at android.view.View.layout(View.java:19583) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080) at android.view.View.layout(View.java:19586) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:19586) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635) at android.widget.LinearLayout.onLayout(LinearLayout.java:1544) at android.view.View.layout(View.java:19586) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at com.android.internal.policy.DecorView.onLayout(DecorView.java:758) at android.view.View.layout(View.java:19586) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2484) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2200) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911) at android.view.Choreographer.doCallbacks(Choreographer.java:723) at android.view.Choreographer.doFrame(Choreographer.java:658) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Hello Azi,
I have been investigating into this behavior you are referring to, and I cannot seem to reproduce this exception you are seeing against the latest (and final) release of the Infragistics for Android .jars.
I would recommend that you ensure that you are using the latest version of the Infragistics for Android .jar files by visiting your account on the Infragistics website at https://www.infragistics.com/my-account/keys-and-downloads and clicking on the 2016.1 product that you are registered to. This will open a new set of tabs, where one reads “Service Releases” and there will be an Android service release for the 16.1.20161.2025 .jar files.
I had mentioned the “(and final)” bit above, because our Android-specific product has been retired and is no longer receiving development. As such, and if at all possible, I would highly recommend moving to usage of our Xamarin.Forms product for mobile development using Infragistics. This product also includes a much-improved data grid control. You can read further about the latest Infragistics for Xamarin.Forms release using our documentation: https://www.infragistics.com/help/xamarin/.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewSoftware Developer
hello,
i hope you are doing well.
you mean if we use your datachart and datagrid in our pure android project if there was a problem you can't support us?
if there was a bug in your library you can't reolve it?
thanks
Thank you for your update on this matter.
Using the exact code that you have provided in a sample project of my own against the latest jars, I cannot seem to reproduce the behavior you are seeing. This leads me to believe that this issue is environment-related. It would be helpful if you can provide some information related to the following:
1. What is the full list of Infragistics jar files are you including in your project?2. Are you using the latest jar files that are downloadable from the 16.1.20161.2025 link on your account on the website, as mentioned above?3. What are the Android settings that you are targeting? Do they match the environments listed under the “Android” tree item here: https://www.infragistics.com/support/supported-environments ?
With respect to bug fixes, the Java-based Infragistics for Android product is retired, and so there will not be any further releases for it. The Infragistics focus on mobile development currently lies with Xamarin.Forms. If you need to develop for just native-Android or iOS, we do also support usage of Xamarin.Android and Xamarin.iOS for this. As such, if there does still exist a bug in the Java-based Infragistics for Android product’s code-base, it unfortunately will not be fixed as no further development is happening on that product.
Sincerely, AndrewSoftware Developer
would you please send me the jar file that you used for datagrid?
I cannot attach the Infragistics jar files to this forum thread, but I can lead you to where you can download the same jars that I had used.
If you sign into your account on the Infragistics website and visit https://www.infragistics.com/my-account/keys-and-downloads, this should result in a list of the Infragistics products you are registered to. The latest Infragistics jars are part of the Infragistics 2016.1 control suite, and so if you are registered to a 2016 Volume 1 product, I would recommend clicking on it.
This will open a new set of tabs, where one will read "Service Releases." In the content of this tab, there will be a tree-item that reads Infragistics Android. Opening this will give you a pair of links for the 16.1.20161.2025 version of the Infragistics for Android jars, which is what I used.
i just downloaded a FREE trial i didn't register anything .and it make me a folder by the name of 2016.1 i think my jar is ok !
I apologize, as I was not aware you were on a Trial of the Infragistics for Android product and was under the impression that you were registered to it. If this Trial was downloaded recently, then the jar files that you are using are the latest jars.
As such, we are using the same jar files and the same code, which leads me to believe that this is likely an environmental issue. Would it be possible for you to please provide some information regarding the following?
1. What is the full list of Infragistics jar files are you including in your project?2. What are the Android settings that you are targeting? Do they match the environments listed under the "Android" tree item here: https://www.infragistics.com/support/supported-environments ?
these are the jar files i have .
i'm using android studio .my windows is 8
and this is the version i'm using
android { compileSdkVersion 26 defaultConfig { applicationId "smartview.oceanwide.com.androidsmartview" minSdkVersion 15 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" }
I have modified the sample project that I am using to use the same SDK-settings that you are testing against, but I am still unable to reproduce any exception. It is also worth noting that your minSdkVersion is targeting an Android version that is outside of our supported environments as we support 4.1 and later. SDK version 15 is 4.0.
Looking at the stack trace that you have provided, it looks like the issue with respect to our stuff is coming from some sort of formatting in the NumericCellPresenter class. This makes me curious as to whether it could be a culture-related issue, as perhaps the formatting between a decimal separator of "." versus "," is not happening correctly. Would it be possible for you to please provide some information regarding the language and culture settings of the device or simulator that you are testing on?
there is nothing special it's a sample app there is nothing else in it .how can i send it to you it's 38 kb
it's a sample app i have nothing else in it .how can i send it to you ? it's 38 kb