Error when getting protocol from preferences

Hi!

I'm having some problems when getting the protocol entry value from
preferences using:

(PreferencesActivity.java)

ListPreference lp = (ListPreference) findPreference(KEY_PROTOCOL);
lp.setSummary(lp. getEntry());
String protocol = lp.getValue();

That code is returning the entry (localized string like "ODK Aggregate") in
both methods (getEntry and getValue) but it should return the entry
in getEntry and the entry value (odk_default) in getValue. Anyone saw this
problem before? Any idea on why this is happening?

I just updated today, so I'm up to date.

Thanks in advance!
Alejandro De Gregorio Tort

Try force closing the app then clearing the app data ( Applications /
Manage Applications / ODK Collect )

When ODK Collect next starts up, it will repopulate the preferences to
their default settings.

The value would also likely be reset if you chose an alternate option,
saved, then reopened and chose the ODK Aggregate choice.

Mitch

··· On Mon, Oct 29, 2012 at 9:11 AM, Alejandro De Gregorio Tort < alejandro@degregorio.me> wrote:

Hi!

I'm having some problems when getting the protocol entry value from
preferences using:

(PreferencesActivity.java)

ListPreference lp = (ListPreference) findPreference(KEY_PROTOCOL);
lp.setSummary(lp. getEntry());
String protocol = lp.getValue();

That code is returning the entry (localized string like "ODK Aggregate")
in both methods (getEntry and getValue) but it should return the entry
in getEntry and the entry value (odk_default) in getValue. Anyone saw this
problem before? Any idea on why this is happening?

I just updated today, so I'm up to date.

Thanks in advance!
Alejandro De Gregorio Tort

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

I'm deploying the application from eclipse with Debug As directly to the
phone. And in the phone there isn't any data saved.

So, this is what I'm doing:

  • Download the odk code with hg.
  • Import the project into Eclipse.
  • Add a breakpoint in line 470 of PreferencesActivity.java
  • Debug As Android Application
  • When the application loads: Menu / Change Settings (Then the debug stops
    in the breakpoint but at that time the preference is ok, so continue)
  • Change the Server Platform to ODK Aggregate
  • Then the debugger stops again and now the code is getting the preferences
    from the file. If you look at that moment, the getValue is returning "ODK
    Aggregate" but it should return odk_default

Previously I was working with the version 1.1.7 and everything worked
perfectly. I don't understand why this is happening, since the code that
get the preferences from the file is from the Android libraries and I
didn't find anything that says that this function have changed.

Saludos.
Alejandro De Gregorio Tort

··· 2012/10/29 Mitch S

Try force closing the app then clearing the app data ( Applications /
Manage Applications / ODK Collect )

When ODK Collect next starts up, it will repopulate the preferences to
their default settings.

The value would also likely be reset if you chose an alternate option,
saved, then reopened and chose the ODK Aggregate choice.

Mitch

On Mon, Oct 29, 2012 at 9:11 AM, Alejandro De Gregorio Tort < alejandro@degregorio.me> wrote:

Hi!

I'm having some problems when getting the protocol entry value from
preferences using:

(PreferencesActivity.java)

ListPreference lp = (ListPreference) findPreference(KEY_PROTOCOL);
lp.setSummary(lp. getEntry());
String protocol = lp.getValue();

That code is returning the entry (localized string like "ODK Aggregate")
in both methods (getEntry and getValue) but it should return the entry
in getEntry and the entry value (odk_default) in getValue. Anyone saw this
problem before? Any idea on why this is happening?

I just updated today, so I'm up to date.

Thanks in advance!
Alejandro De Gregorio Tort

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

After some time I tried this again and I found the problem. There is a bug
in the disableFeaturesInDevelopment method of the PreferencesActivityclass.
When adding the entries and entry values it adds the entries in both
entries and entry values.

346 CharSequence entries = protocols.getEntries();
347 CharSequence entryValues = protocols.getEntryValues();
348
349 CharSequence newEntries = new
CharSequence[entryValues.length - 1];
350 CharSequence newEntryValues = new
CharSequence[entryValues.length - 1];
351 for (int k = 0, j = 0; j < entryValues.length; ++j) {
352 if (j == i)
353 continue;
354 newEntries[k] = entries[j];
355 newEntryValues[k] = entries[j]; // <==== This should
be newEntryValues[k] = entryValues[j];
356 ++k;
357 }

Regards,
Alejandro De Gregorio Tort

··· El lunes, 29 de octubre de 2012 15:28:04 UTC-2, Alejandro De Gregorio Tort escribió: > > I'm deploying the application from eclipse with Debug As directly to the > phone. And in the phone there isn't any data saved. > > So, this is what I'm doing: > > - Download the odk code with hg. > - Import the project into Eclipse. > - Add a breakpoint in line 470 of PreferencesActivity.java > - Debug As Android Application > - When the application loads: Menu / Change Settings (Then the debug stops > in the breakpoint but at that time the preference is ok, so continue) > - Change the Server Platform to ODK Aggregate > - Then the debugger stops again and now the code is getting the > preferences from the file. If you look at that moment, the getValue is > returning "ODK Aggregate" but it should return odk_default > > Previously I was working with the version 1.1.7 and everything worked > perfectly. I don't understand why this is happening, since the code that > get the preferences from the file is from the Android libraries and I > didn't find anything that says that this function have changed. > > > Saludos. > Alejandro De Gregorio Tort > > > > 2012/10/29 Mitch S > >> Try force closing the app then clearing the app data ( Applications / >> Manage Applications / ODK Collect ) >> >> When ODK Collect next starts up, it will repopulate the preferences to >> their default settings. >> >> The value would also likely be reset if you chose an alternate option, >> saved, then reopened and chose the ODK Aggregate choice. >> >> Mitch >> >> >> On Mon, Oct 29, 2012 at 9:11 AM, Alejandro De Gregorio Tort < alejandro@degregorio.me> wrote: >> >>> Hi! >>> >>> I'm having some problems when getting the protocol entry value from >>> preferences using: >>> >>> (PreferencesActivity.java) >>> >>> ListPreference lp = (ListPreference) findPreference(KEY_PROTOCOL); >>> lp.setSummary(lp. getEntry()); >>> String protocol = lp.getValue(); >>> >>> That code is returning the entry (localized string like "ODK Aggregate") >>> in both methods (getEntry and getValue) but it should return the entry >>> in getEntry and the entry value (odk_default) in getValue. Anyone saw this >>> problem before? Any idea on why this is happening? >>> >>> I just updated today, so I'm up to date. >>> >>> Thanks in advance! >>> Alejandro De Gregorio Tort >>> >> >> >> >> -- >> Mitch Sundt >> Software Engineer >> University of Washington >> mitchellsundt@gmail.com >> > >

Hi,
I'm facing the similar issue in latest build(1.4) in PreferenceActivity.java (line 297), where preference screen is being typecasted to ListPreference. I checked out the 'default' branch and pulled the latest code. An error occurs when I deploy the app to my smartphone and click on general settings.

Regards,
Deepthi Chand

··· On Tuesday, 15 January 2013 02:25:21 UTC+5:30, Alejandro De Gregorio Tort wrote: > After some time I tried this again and I found the problem. There is a bug in the disableFeaturesInDevelopment method of the PreferencesActivity class. > When adding the entries and entry values it adds the entries in both entries and entry values. > > > > 346 CharSequence[] entries = protocols.getEntries(); > 347 CharSequence[] entryValues = protocols.getEntryValues(); > 348 > 349 CharSequence[] newEntries = new CharSequence[entryValues.length - 1]; > 350 CharSequence[] newEntryValues = new CharSequence[entryValues.length - 1]; > 351 for (int k = 0, j = 0; j < entryValues.length; ++j) { > 352 if (j == i) > 353 continue; > 354 newEntries[k] = entries[j]; > 355 newEntryValues[k] = entries[j]; // <==== This should be newEntryValues[k] = entryValues[j]; > 356 ++k; > 357 } > > > > > Regards, > Alejandro De Gregorio Tort > > > > El lunes, 29 de octubre de 2012 15:28:04 UTC-2, Alejandro De Gregorio Tort escribió:I'm deploying the application from eclipse with Debug As directly to the phone. And in the phone there isn't any data saved. > > > So, this is what I'm doing: > > > - Download the odk code with hg. > > > - Import the project into Eclipse. > - Add a breakpoint in line 470 of PreferencesActivity.java > - Debug As Android Application > - When the application loads: Menu / Change Settings (Then the debug stops in the breakpoint but at that time the preference is ok, so continue) > > > - Change the Server Platform to ODK Aggregate > - Then the debugger stops again and now the code is getting the preferences from the file. If you look at that moment, the getValue is returning "ODK Aggregate" but it should return odk_default > > > > > > Previously I was working with the version 1.1.7 and everything worked perfectly. I don't understand why this is happening, since the code that get the preferences from the file is from the Android libraries and I didn't find anything that says that this function have changed. > > > > > > > Saludos. > Alejandro De Gregorio Tort > > > > > 2012/10/29 Mitch S > > > Try force closing the app then clearing the app data ( Applications / Manage Applications / ODK Collect ) > > When ODK Collect next starts up, it will repopulate the preferences to their default settings. > > The value would also likely be reset if you chose an alternate option, saved, then reopened and chose the ODK Aggregate choice. > > > > > Mitch > > > > > On Mon, Oct 29, 2012 at 9:11 AM, Alejandro De Gregorio Tort wrote: > > > > Hi! > > I'm having some problems when getting the protocol entry value from preferences using: > > (PreferencesActivity.java) > > > > > ListPreference lp = (ListPreference) findPreference(KEY_PROTOCOL); > lp.setSummary(lp. getEntry()); > String protocol = lp.getValue(); > > That code is returning the entry (localized string like "ODK Aggregate") in both methods (getEntry and getValue) but it should return the entry in getEntry and the entry value (odk_default) in getValue. Anyone saw this problem before? Any idea on why this is happening? > > > > > > I just updated today, so I'm up to date. > > > Thanks in advance! > Alejandro De Gregorio Tort > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com

On Tuesday, 15 January 2013 02:25:21 UTC+5:30, Alejandro De Gregorio Tort wrote:

After some time I tried this again and I found the problem. There is a bug in the disableFeaturesInDevelopment method of the PreferencesActivity class.
When adding the entries and entry values it adds the entries in both entries and entry values.

346 CharSequence entries = protocols.getEntries();
347 CharSequence entryValues = protocols.getEntryValues();
348
349 CharSequence newEntries = new CharSequence[entryValues.length - 1];
350 CharSequence newEntryValues = new CharSequence[entryValues.length - 1];
351 for (int k = 0, j = 0; j < entryValues.length; ++j) {
352 if (j == i)
353 continue;
354 newEntries[k] = entries[j];
355 newEntryValues[k] = entries[j]; // <==== This should be newEntryValues[k] = entryValues[j];
356 ++k;
357 }

Regards,
Alejandro De Gregorio Tort

El lunes, 29 de octubre de 2012 15:28:04 UTC-2, Alejandro De Gregorio Tort escribió:I'm deploying the application from eclipse with Debug As directly to the phone. And in the phone there isn't any data saved.

So, this is what I'm doing:

  • Download the odk code with hg.

  • Import the project into Eclipse.

  • Add a breakpoint in line 470 of PreferencesActivity.java

  • Debug As Android Application

  • When the application loads: Menu / Change Settings (Then the debug stops in the breakpoint but at that time the preference is ok, so continue)

  • Change the Server Platform to ODK Aggregate

  • Then the debugger stops again and now the code is getting the preferences from the file. If you look at that moment, the getValue is returning "ODK Aggregate" but it should return odk_default

Previously I was working with the version 1.1.7 and everything worked perfectly. I don't understand why this is happening, since the code that get the preferences from the file is from the Android libraries and I didn't find anything that says that this function have changed.

Saludos.
Alejandro De Gregorio Tort

2012/10/29 Mitch S mitche...@gmail.com

Try force closing the app then clearing the app data ( Applications / Manage Applications / ODK Collect )

When ODK Collect next starts up, it will repopulate the preferences to their default settings.

The value would also likely be reset if you chose an alternate option, saved, then reopened and chose the ODK Aggregate choice.

Mitch

On Mon, Oct 29, 2012 at 9:11 AM, Alejandro De Gregorio Tort alej...@degregorio.me wrote:

Hi!

I'm having some problems when getting the protocol entry value from preferences using:

(PreferencesActivity.java)

ListPreference lp = (ListPreference) findPreference(KEY_PROTOCOL);
lp.setSummary(lp. getEntry());
String protocol = lp.getValue();

That code is returning the entry (localized string like "ODK Aggregate") in both methods (getEntry and getValue) but it should return the entry in getEntry and the entry value (odk_default) in getValue. Anyone saw this problem before? Any idea on why this is happening?

I just updated today, so I'm up to date.

Thanks in advance!
Alejandro De Gregorio Tort

--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

And did you try what Mitch suggested?

Try force closing the app then clearing the app data ( Applications /
Manage Applications / ODK Collect ). When ODK Collect next starts up,
it will repopulate the preferences to their default settings.

Yaw

··· -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Mon, Aug 18, 2014 at 11:08 PM, eopoxf@gmail.com wrote:

Hi,
I'm facing the similar issue in latest build(1.4) in PreferenceActivity.java (line 297), where preference screen is being typecasted to ListPreference. I checked out the 'default' branch and pulled the latest code. An error occurs when I deploy the app to my smartphone and click on general settings.

Regards,
Deepthi Chand

On Tuesday, 15 January 2013 02:25:21 UTC+5:30, Alejandro De Gregorio Tort wrote:

After some time I tried this again and I found the problem. There is a bug in the disableFeaturesInDevelopment method of the PreferencesActivity class.
When adding the entries and entry values it adds the entries in both entries and entry values.

346 CharSequence entries = protocols.getEntries();
347 CharSequence entryValues = protocols.getEntryValues();
348
349 CharSequence newEntries = new CharSequence[entryValues.length - 1];
350 CharSequence newEntryValues = new CharSequence[entryValues.length - 1];
351 for (int k = 0, j = 0; j < entryValues.length; ++j) {
352 if (j == i)
353 continue;
354 newEntries[k] = entries[j];
355 newEntryValues[k] = entries[j]; // <==== This should be newEntryValues[k] = entryValues[j];
356 ++k;
357 }

Regards,
Alejandro De Gregorio Tort

El lunes, 29 de octubre de 2012 15:28:04 UTC-2, Alejandro De Gregorio Tort escribió:I'm deploying the application from eclipse with Debug As directly to the phone. And in the phone there isn't any data saved.

So, this is what I'm doing:

  • Download the odk code with hg.

  • Import the project into Eclipse.

  • Add a breakpoint in line 470 of PreferencesActivity.java

  • Debug As Android Application

  • When the application loads: Menu / Change Settings (Then the debug stops in the breakpoint but at that time the preference is ok, so continue)

  • Change the Server Platform to ODK Aggregate

  • Then the debugger stops again and now the code is getting the preferences from the file. If you look at that moment, the getValue is returning "ODK Aggregate" but it should return odk_default

Previously I was working with the version 1.1.7 and everything worked perfectly. I don't understand why this is happening, since the code that get the preferences from the file is from the Android libraries and I didn't find anything that says that this function have changed.

Saludos.
Alejandro De Gregorio Tort

2012/10/29 Mitch S mitche...@gmail.com

Try force closing the app then clearing the app data ( Applications / Manage Applications / ODK Collect )

When ODK Collect next starts up, it will repopulate the preferences to their default settings.

The value would also likely be reset if you chose an alternate option, saved, then reopened and chose the ODK Aggregate choice.

Mitch

On Mon, Oct 29, 2012 at 9:11 AM, Alejandro De Gregorio Tort alej...@degregorio.me wrote:

Hi!

I'm having some problems when getting the protocol entry value from preferences using:

(PreferencesActivity.java)

ListPreference lp = (ListPreference) findPreference(KEY_PROTOCOL);
lp.setSummary(lp. getEntry());
String protocol = lp.getValue();

That code is returning the entry (localized string like "ODK Aggregate") in both methods (getEntry and getValue) but it should return the entry in getEntry and the entry value (odk_default) in getValue. Anyone saw this problem before? Any idea on why this is happening?

I just updated today, so I'm up to date.

Thanks in advance!
Alejandro De Gregorio Tort

--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

On Tuesday, 15 January 2013 02:25:21 UTC+5:30, Alejandro De Gregorio Tort wrote:

After some time I tried this again and I found the problem. There is a bug in the disableFeaturesInDevelopment method of the PreferencesActivity class.
When adding the entries and entry values it adds the entries in both entries and entry values.

346 CharSequence entries = protocols.getEntries();
347 CharSequence entryValues = protocols.getEntryValues();
348
349 CharSequence newEntries = new CharSequence[entryValues.length - 1];
350 CharSequence newEntryValues = new CharSequence[entryValues.length - 1];
351 for (int k = 0, j = 0; j < entryValues.length; ++j) {
352 if (j == i)
353 continue;
354 newEntries[k] = entries[j];
355 newEntryValues[k] = entries[j]; // <==== This should be newEntryValues[k] = entryValues[j];
356 ++k;
357 }

Regards,
Alejandro De Gregorio Tort

El lunes, 29 de octubre de 2012 15:28:04 UTC-2, Alejandro De Gregorio Tort escribió:I'm deploying the application from eclipse with Debug As directly to the phone. And in the phone there isn't any data saved.

So, this is what I'm doing:

  • Download the odk code with hg.

  • Import the project into Eclipse.

  • Add a breakpoint in line 470 of PreferencesActivity.java

  • Debug As Android Application

  • When the application loads: Menu / Change Settings (Then the debug stops in the breakpoint but at that time the preference is ok, so continue)

  • Change the Server Platform to ODK Aggregate

  • Then the debugger stops again and now the code is getting the preferences from the file. If you look at that moment, the getValue is returning "ODK Aggregate" but it should return odk_default

Previously I was working with the version 1.1.7 and everything worked perfectly. I don't understand why this is happening, since the code that get the preferences from the file is from the Android libraries and I didn't find anything that says that this function have changed.

Saludos.
Alejandro De Gregorio Tort

2012/10/29 Mitch S mitche...@gmail.com

Try force closing the app then clearing the app data ( Applications / Manage Applications / ODK Collect )

When ODK Collect next starts up, it will repopulate the preferences to their default settings.

The value would also likely be reset if you chose an alternate option, saved, then reopened and chose the ODK Aggregate choice.

Mitch

On Mon, Oct 29, 2012 at 9:11 AM, Alejandro De Gregorio Tort alej...@degregorio.me wrote:

Hi!

I'm having some problems when getting the protocol entry value from preferences using:

(PreferencesActivity.java)

ListPreference lp = (ListPreference) findPreference(KEY_PROTOCOL);
lp.setSummary(lp. getEntry());
String protocol = lp.getValue();

That code is returning the entry (localized string like "ODK Aggregate") in both methods (getEntry and getValue) but it should return the entry in getEntry and the entry value (odk_default) in getValue. Anyone saw this problem before? Any idea on why this is happening?

I just updated today, so I'm up to date.

Thanks in advance!
Alejandro De Gregorio Tort

--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

--
You received this message because you are subscribed to the Google Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Please pay attention to the date of a post. The original post's problem was
resolved with their code change many many months ago.

See https://code.google.com/p/opendatakit/wiki/CollectTroubleshooting for
how to provide a log which will be necessary to identify the cause of the
crash.

··· On Tue, Aug 19, 2014 at 6:42 AM, Yaw Anokwa wrote:

And did you try what Mitch suggested?

Try force closing the app then clearing the app data ( Applications /
Manage Applications / ODK Collect ). When ODK Collect next starts up,
it will repopulate the preferences to their default settings.

Yaw

Need ODK services? http://nafundi.com provides form design, server
setup, professional support, and software development for ODK.

On Mon, Aug 18, 2014 at 11:08 PM, eopoxf@gmail.com wrote:

Hi,
I'm facing the similar issue in latest build(1.4) in
PreferenceActivity.java (line 297), where preference screen is being
typecasted to ListPreference. I checked out the 'default' branch and pulled
the latest code. An error occurs when I deploy the app to my smartphone and
click on general settings.

Regards,
Deepthi Chand

On Tuesday, 15 January 2013 02:25:21 UTC+5:30, Alejandro De Gregorio Tort wrote:

After some time I tried this again and I found the problem. There is a
bug in the disableFeaturesInDevelopment method of the PreferencesActivity
class.

When adding the entries and entry values it adds the entries in both
entries and entry values.

346 CharSequence entries = protocols.getEntries();
347 CharSequence entryValues = protocols.getEntryValues();
348
349 CharSequence newEntries = new
CharSequence[entryValues.length - 1];

350 CharSequence newEntryValues = new
CharSequence[entryValues.length - 1];

351 for (int k = 0, j = 0; j < entryValues.length; ++j) {
352 if (j == i)
353 continue;
354 newEntries[k] = entries[j];
355 newEntryValues[k] = entries[j]; // <==== This
should be newEntryValues[k] = entryValues[j];

356 ++k;
357 }

Regards,
Alejandro De Gregorio Tort

El lunes, 29 de octubre de 2012 15:28:04 UTC-2, Alejandro De Gregorio
Tort escribió:I'm deploying the application from eclipse with Debug As
directly to the phone. And in the phone there isn't any data saved.

So, this is what I'm doing:

  • Download the odk code with hg.

  • Import the project into Eclipse.

  • Add a breakpoint in line 470 of PreferencesActivity.java

  • Debug As Android Application

  • When the application loads: Menu / Change Settings (Then the debug
    stops in the breakpoint but at that time the preference is ok, so continue)

  • Change the Server Platform to ODK Aggregate
  • Then the debugger stops again and now the code is getting the
    preferences from the file. If you look at that moment, the getValue is
    returning "ODK Aggregate" but it should return odk_default

Previously I was working with the version 1.1.7 and everything worked
perfectly. I don't understand why this is happening, since the code that
get the preferences from the file is from the Android libraries and I
didn't find anything that says that this function have changed.

Saludos.
Alejandro De Gregorio Tort

2012/10/29 Mitch S mitche...@gmail.com

Try force closing the app then clearing the app data ( Applications /
Manage Applications / ODK Collect )

When ODK Collect next starts up, it will repopulate the preferences to
their default settings.

The value would also likely be reset if you chose an alternate option,
saved, then reopened and chose the ODK Aggregate choice.

Mitch

On Mon, Oct 29, 2012 at 9:11 AM, Alejandro De Gregorio Tort < alej...@degregorio.me> wrote:

Hi!

I'm having some problems when getting the protocol entry value from
preferences using:

(PreferencesActivity.java)

ListPreference lp = (ListPreference) findPreference(KEY_PROTOCOL);
lp.setSummary(lp. getEntry());
String protocol = lp.getValue();

That code is returning the entry (localized string like "ODK
Aggregate") in both methods (getEntry and getValue) but it should return
the entry in getEntry and the entry value (odk_default) in getValue. Anyone
saw this problem before? Any idea on why this is happening?

I just updated today, so I'm up to date.

Thanks in advance!
Alejandro De Gregorio Tort

--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

On Tuesday, 15 January 2013 02:25:21 UTC+5:30, Alejandro De Gregorio Tort wrote:

After some time I tried this again and I found the problem. There is a
bug in the disableFeaturesInDevelopment method of the PreferencesActivity
class.

When adding the entries and entry values it adds the entries in both
entries and entry values.

346 CharSequence entries = protocols.getEntries();
347 CharSequence entryValues = protocols.getEntryValues();
348
349 CharSequence newEntries = new
CharSequence[entryValues.length - 1];

350 CharSequence newEntryValues = new
CharSequence[entryValues.length - 1];

351 for (int k = 0, j = 0; j < entryValues.length; ++j) {
352 if (j == i)
353 continue;
354 newEntries[k] = entries[j];
355 newEntryValues[k] = entries[j]; // <==== This
should be newEntryValues[k] = entryValues[j];

356 ++k;
357 }

Regards,
Alejandro De Gregorio Tort

El lunes, 29 de octubre de 2012 15:28:04 UTC-2, Alejandro De Gregorio
Tort escribió:I'm deploying the application from eclipse with Debug As
directly to the phone. And in the phone there isn't any data saved.

So, this is what I'm doing:

  • Download the odk code with hg.

  • Import the project into Eclipse.

  • Add a breakpoint in line 470 of PreferencesActivity.java

  • Debug As Android Application

  • When the application loads: Menu / Change Settings (Then the debug
    stops in the breakpoint but at that time the preference is ok, so continue)

  • Change the Server Platform to ODK Aggregate
  • Then the debugger stops again and now the code is getting the
    preferences from the file. If you look at that moment, the getValue is
    returning "ODK Aggregate" but it should return odk_default

Previously I was working with the version 1.1.7 and everything worked
perfectly. I don't understand why this is happening, since the code that
get the preferences from the file is from the Android libraries and I
didn't find anything that says that this function have changed.

Saludos.
Alejandro De Gregorio Tort

2012/10/29 Mitch S mitche...@gmail.com

Try force closing the app then clearing the app data ( Applications /
Manage Applications / ODK Collect )

When ODK Collect next starts up, it will repopulate the preferences to
their default settings.

The value would also likely be reset if you chose an alternate option,
saved, then reopened and chose the ODK Aggregate choice.

Mitch

On Mon, Oct 29, 2012 at 9:11 AM, Alejandro De Gregorio Tort < alej...@degregorio.me> wrote:

Hi!

I'm having some problems when getting the protocol entry value from
preferences using:

(PreferencesActivity.java)

ListPreference lp = (ListPreference) findPreference(KEY_PROTOCOL);
lp.setSummary(lp. getEntry());
String protocol = lp.getValue();

That code is returning the entry (localized string like "ODK
Aggregate") in both methods (getEntry and getValue) but it should return
the entry in getEntry and the entry value (odk_default) in getValue. Anyone
saw this problem before? Any idea on why this is happening?

I just updated today, so I'm up to date.

Thanks in advance!
Alejandro De Gregorio Tort

--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Sorry about that message popped up in Gmail as new. Will check dates next time.

··· On Tue, Aug 19, 2014 at 9:43 AM, Mitch Sundt wrote: > Please pay attention to the date of a post. The original post's problem was > resolved with their code change many many months ago. > > See https://code.google.com/p/opendatakit/wiki/CollectTroubleshooting for > how to provide a log which will be necessary to identify the cause of the > crash. > > > On Tue, Aug 19, 2014 at 6:42 AM, Yaw Anokwa wrote: >> >> And did you try what Mitch suggested? >> >> Try force closing the app then clearing the app data ( Applications / >> Manage Applications / ODK Collect ). When ODK Collect next starts up, >> it will repopulate the preferences to their default settings. >> >> Yaw >> -- >> Need ODK services? http://nafundi.com provides form design, server >> setup, professional support, and software development for ODK. >> >> On Mon, Aug 18, 2014 at 11:08 PM, wrote: >> > Hi, >> > I'm facing the similar issue in latest build(1.4) in >> > PreferenceActivity.java (line 297), where preference screen is being >> > typecasted to ListPreference. I checked out the 'default' branch and pulled >> > the latest code. An error occurs when I deploy the app to my smartphone and >> > click on general settings. >> > >> > Regards, >> > Deepthi Chand >> > >> > On Tuesday, 15 January 2013 02:25:21 UTC+5:30, Alejandro De Gregorio Tort wrote: >> >> After some time I tried this again and I found the problem. There is a >> >> bug in the disableFeaturesInDevelopment method of the PreferencesActivity >> >> class. >> >> When adding the entries and entry values it adds the entries in both >> >> entries and entry values. >> >> >> >> >> >> >> >> 346 CharSequence[] entries = protocols.getEntries(); >> >> 347 CharSequence[] entryValues = >> >> protocols.getEntryValues(); >> >> 348 >> >> 349 CharSequence[] newEntries = new >> >> CharSequence[entryValues.length - 1]; >> >> 350 CharSequence[] newEntryValues = new >> >> CharSequence[entryValues.length - 1]; >> >> 351 for (int k = 0, j = 0; j < entryValues.length; ++j) { >> >> 352 if (j == i) >> >> 353 continue; >> >> 354 newEntries[k] = entries[j]; >> >> 355 newEntryValues[k] = entries[j]; // <==== This >> >> should be newEntryValues[k] = entryValues[j]; >> >> 356 ++k; >> >> 357 } >> >> >> >> >> >> >> >> >> >> Regards, >> >> Alejandro De Gregorio Tort >> >> >> >> >> >> >> >> El lunes, 29 de octubre de 2012 15:28:04 UTC-2, Alejandro De Gregorio >> >> Tort escribió:I'm deploying the application from eclipse with Debug As >> >> directly to the phone. And in the phone there isn't any data saved. >> >> >> >> >> >> So, this is what I'm doing: >> >> >> >> >> >> - Download the odk code with hg. >> >> >> >> >> >> - Import the project into Eclipse. >> >> - Add a breakpoint in line 470 of PreferencesActivity.java >> >> - Debug As Android Application >> >> - When the application loads: Menu / Change Settings (Then the debug >> >> stops in the breakpoint but at that time the preference is ok, so continue) >> >> >> >> >> >> - Change the Server Platform to ODK Aggregate >> >> - Then the debugger stops again and now the code is getting the >> >> preferences from the file. If you look at that moment, the getValue is >> >> returning "ODK Aggregate" but it should return odk_default >> >> >> >> >> >> >> >> >> >> >> >> Previously I was working with the version 1.1.7 and everything worked >> >> perfectly. I don't understand why this is happening, since the code that get >> >> the preferences from the file is from the Android libraries and I didn't >> >> find anything that says that this function have changed. >> >> >> >> >> >> >> >> >> >> >> >> >> >> Saludos. >> >> Alejandro De Gregorio Tort >> >> >> >> >> >> >> >> >> >> 2012/10/29 Mitch S >> >> >> >> >> >> Try force closing the app then clearing the app data ( Applications / >> >> Manage Applications / ODK Collect ) >> >> >> >> When ODK Collect next starts up, it will repopulate the preferences to >> >> their default settings. >> >> >> >> The value would also likely be reset if you chose an alternate option, >> >> saved, then reopened and chose the ODK Aggregate choice. >> >> >> >> >> >> >> >> >> >> Mitch >> >> >> >> >> >> >> >> >> >> On Mon, Oct 29, 2012 at 9:11 AM, Alejandro De Gregorio Tort wrote: >> >> >> >> >> >> >> >> Hi! >> >> >> >> I'm having some problems when getting the protocol entry value from >> >> preferences using: >> >> >> >> (PreferencesActivity.java) >> >> >> >> >> >> >> >> >> >> ListPreference lp = (ListPreference) findPreference(KEY_PROTOCOL); >> >> lp.setSummary(lp. getEntry()); >> >> String protocol = lp.getValue(); >> >> >> >> That code is returning the entry (localized string like "ODK >> >> Aggregate") in both methods (getEntry and getValue) but it should return the >> >> entry in getEntry and the entry value (odk_default) in getValue. Anyone saw >> >> this problem before? Any idea on why this is happening? >> >> >> >> >> >> >> >> >> >> >> >> I just updated today, so I'm up to date. >> >> >> >> >> >> Thanks in advance! >> >> Alejandro De Gregorio Tort >> >> >> >> >> >> >> >> -- >> >> Mitch Sundt >> >> Software Engineer >> >> University of Washington >> >> mitche...@gmail.com >> > >> > >> > >> > On Tuesday, 15 January 2013 02:25:21 UTC+5:30, Alejandro De Gregorio Tort wrote: >> >> After some time I tried this again and I found the problem. There is a >> >> bug in the disableFeaturesInDevelopment method of the PreferencesActivity >> >> class. >> >> When adding the entries and entry values it adds the entries in both >> >> entries and entry values. >> >> >> >> >> >> >> >> 346 CharSequence[] entries = protocols.getEntries(); >> >> 347 CharSequence[] entryValues = >> >> protocols.getEntryValues(); >> >> 348 >> >> 349 CharSequence[] newEntries = new >> >> CharSequence[entryValues.length - 1]; >> >> 350 CharSequence[] newEntryValues = new >> >> CharSequence[entryValues.length - 1]; >> >> 351 for (int k = 0, j = 0; j < entryValues.length; ++j) { >> >> 352 if (j == i) >> >> 353 continue; >> >> 354 newEntries[k] = entries[j]; >> >> 355 newEntryValues[k] = entries[j]; // <==== This >> >> should be newEntryValues[k] = entryValues[j]; >> >> 356 ++k; >> >> 357 } >> >> >> >> >> >> >> >> >> >> Regards, >> >> Alejandro De Gregorio Tort >> >> >> >> >> >> >> >> El lunes, 29 de octubre de 2012 15:28:04 UTC-2, Alejandro De Gregorio >> >> Tort escribió:I'm deploying the application from eclipse with Debug As >> >> directly to the phone. And in the phone there isn't any data saved. >> >> >> >> >> >> So, this is what I'm doing: >> >> >> >> >> >> - Download the odk code with hg. >> >> >> >> >> >> - Import the project into Eclipse. >> >> - Add a breakpoint in line 470 of PreferencesActivity.java >> >> - Debug As Android Application >> >> - When the application loads: Menu / Change Settings (Then the debug >> >> stops in the breakpoint but at that time the preference is ok, so continue) >> >> >> >> >> >> - Change the Server Platform to ODK Aggregate >> >> - Then the debugger stops again and now the code is getting the >> >> preferences from the file. If you look at that moment, the getValue is >> >> returning "ODK Aggregate" but it should return odk_default >> >> >> >> >> >> >> >> >> >> >> >> Previously I was working with the version 1.1.7 and everything worked >> >> perfectly. I don't understand why this is happening, since the code that get >> >> the preferences from the file is from the Android libraries and I didn't >> >> find anything that says that this function have changed. >> >> >> >> >> >> >> >> >> >> >> >> >> >> Saludos. >> >> Alejandro De Gregorio Tort >> >> >> >> >> >> >> >> >> >> 2012/10/29 Mitch S >> >> >> >> >> >> Try force closing the app then clearing the app data ( Applications / >> >> Manage Applications / ODK Collect ) >> >> >> >> When ODK Collect next starts up, it will repopulate the preferences to >> >> their default settings. >> >> >> >> The value would also likely be reset if you chose an alternate option, >> >> saved, then reopened and chose the ODK Aggregate choice. >> >> >> >> >> >> >> >> >> >> Mitch >> >> >> >> >> >> >> >> >> >> On Mon, Oct 29, 2012 at 9:11 AM, Alejandro De Gregorio Tort wrote: >> >> >> >> >> >> >> >> Hi! >> >> >> >> I'm having some problems when getting the protocol entry value from >> >> preferences using: >> >> >> >> (PreferencesActivity.java) >> >> >> >> >> >> >> >> >> >> ListPreference lp = (ListPreference) findPreference(KEY_PROTOCOL); >> >> lp.setSummary(lp. getEntry()); >> >> String protocol = lp.getValue(); >> >> >> >> That code is returning the entry (localized string like "ODK >> >> Aggregate") in both methods (getEntry and getValue) but it should return the >> >> entry in getEntry and the entry value (odk_default) in getValue. Anyone saw >> >> this problem before? Any idea on why this is happening? >> >> >> >> >> >> >> >> >> >> >> >> I just updated today, so I'm up to date. >> >> >> >> >> >> Thanks in advance! >> >> Alejandro De Gregorio Tort >> >> >> >> >> >> >> >> -- >> >> Mitch Sundt >> >> Software Engineer >> >> University of Washington >> >> mitche...@gmail.com >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "ODK Developers" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> > an email to opendatakit-developers+unsubscribe@googlegroups.com. >> > For more options, visit https://groups.google.com/d/optout. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "ODK Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to opendatakit-developers+unsubscribe@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitchellsundt@gmail.com > > -- > You received this message because you are subscribed to the Google Groups > "ODK Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to opendatakit-developers+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.