[mono-android] Help with Binding EcoGallery

2013-03-01 Thread Kosta Mihajlov
Hi, 
  I'm trying to bind the EcoGallery widget in Monodroid 
https://github.com/falnatsheh/EcoGallery 
  wich is a replacement of the current gallery widget with additional 
functionality for GCing the views.

Did someone managed to successfully bind this widget ?
Unil now i have managed to display it on screen, the only thing left is to bind 
to the eventListeners

   OnItemClickListener and OnItemSelectedListener
Can you please give me some guidance how to do it manually? or some link where 
i can have a look at it?
Thanks,
   Costa Halicea


___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] Enhancement code for Spinner

2013-03-01 Thread Paul Johnson

Hi,


hi,its glad to tell i saved spinner value(courseNumbers) in database with ur
assistance code...but when i click on retreive button now i want to populate
that spinner with courses based on the value(courseNumber) in database based
on sno...
ex data in database:
snocourseaddress
1000   303uk
1001404  india
1002505  usa
here my requiremnt is when i give value in sno edittext and click on
retreive button the data should populate in spinner and edittextfor
example i enter 1000 in sno edittext and click on retreive button the
spinner should populate with Biology and  address edittext sholud populate
with ukthe spinner should set with coursename based on courseNumber in
database...


This is where the use of a dictionary object comes in handy. My original 
code constructed two Lists (an int and string) which contained the 
course names and course values. This was fine for my demonstration 
purpose, but now we're doing searches. Of course, you can do them on 
List objects and we'll use both so you can decide which works best.


A dictionary has the advantage of being a key/value system, I have a key 
(say "German") and this has an associated value (505). To set up the 
dictionary...


Dictionary  name = new Dictionary();

where keyType is the type of object the key is (for example, string, 
int, double, class, List etc) and valueType is the type of object the 
value is (string, double etc).


As with a List, you add to the dictionary using the .Add method, so if I 
have a Dictionary foo, it would be


foo.Add("German", 505);

There are plenty of ways to get values out of the dictionary object, but 
possibly the most useful for you will be to use TryGetValue. This looks 
up a given key in the dictionary and returns a value.


To get a value from foo...

int outValue = 0;
if (foo.TryGetValue("German", out outValue))
Console.WriteLine("value found = {0}, outValue);
else
Console.WriteLine("key not found");

There is a very slight performance hit using a Dictionary; it is 
slightly slower than searching a list, but consider this. If I want to 
search a list for a string, I can do this


if (foo.Contains("German"))

but then I have to find where in the list "German", so the code becomes

int position = 0;
if (foo.Contains("German"))
{
position = foo.IndexOf("German");
Console.WriteLine("position of German = {0}", position;
}
else
Console.WriteLine("German not found");

In effect, there are two lookups. I've not done any sort of performance 
timing on using this "double lookup", but I'd expect it now to be slower 
than a dictionary.



 conn.Open();
 SqliteDataReader sdr = cmd.ExecuteReader();
 while (sdr.Read())
 {
 string str = Convert.ToString(sdr["SCOURSE"]);

  /* here have to write the code for population of
spinner here i have taken courseNumber in string variable str...based on
this value spinner should set with course...  */


Here then you would want to be using Dictionary

the parameter to search though would need to be an int, so

int strToFind = Convert.ToInt32(sdr["SCOURSE"]);
then

if (myDictionary.ContainsKey(strToFind))
etaddspinner.Text = Convert.ToString(sdr["SADD"]);

However, as you're just drawing from the database rather than anything 
else, you can ignore the dictionary and use the list as before. Again 
though, you will need to be using an int to look up the course number, 
so the code would be


int strToFind = Convert.ToInt32(sdr["SCOURSE"]);
if (myCourseList.Contains(strToFind))
etaddspinner.Text = Convert.ToString(sdr["SADD"]);

At this point you may be wondering how to make this even more flexible. 
That's simple, follow this logic


1. Set up your container(s) (either List<> or Dictionary)
2. Read in from the database the available courses and course numbers 
into the containers

3. That's it

Once you've read in from the database to propagate the containers, you 
don't need to do it anymore. Database access slows things down big time!


Paul
--
"Space," it says, "is big. Really big. You just won't believe how 
vastly, hugely, mindbogglingly big it is. I mean, you may think it's a 
long way down the road to the chemist's, but that's just peanuts to 
space, listen..."

Hitch Hikers Guide to the Galaxy, a truly remarkable book!

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


[mono-android] the version of 4.4.54

2013-03-01 Thread qinyi
how can i download this version?please tell me the website!
not 4.4.55 version



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/the-version-of-4-4-54-tp5712929.html
Sent from the Mono for Android mailing list archive at Nabble.com.
___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


[mono-android] Auto-close alert dialog after a specific time

2013-03-01 Thread zia
Auto-close alert dialog after a specific time using Mono for Android



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Auto-close-alert-dialog-after-a-specific-time-tp5712930.html
Sent from the Mono for Android mailing list archive at Nabble.com.
___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] How to use Orientation OnConfiguration method in monoandroid

2013-03-01 Thread pushtest82
How to use Orientation in mono for android?

Here I post my code ,

[Activity (Label = "Setting",Theme =
"@android:style/Theme.Black.NoTitleBar.Fullscreen",ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation|Android.Content.PM.ConfigChanges.KeyboardHidden)]
//,ScreenOrientation = ScreenOrientation.Sensor 
public class Setting : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);

//SetContentView(Resource.Layout.settingscreen);
   
onConfigurationChanged(getResources().getConfiguration());

}

public override void OnConfigurationChanged
(Android.Content.Res.Configuration newConfig)
{
base.OnConfigurationChanged (newConfig);



if(newConfig.Orientation==Android.Content.Res.Orientation.Landscape)
{

SetContentView(Resource.Layout.settingscreen_ls);

Button 
logout_btn=FindViewById(Resource.Id.logout_btn);
logout_btn.Click+= delegate {
StartActivity(typeof(LoginScreen));
};

}
else 
if(newConfig.Orientation==Android.Content.Res.Orientation.Portrait){
SetContentView(Resource.Layout.settingscreen);

Button 
logout_btn=FindViewById(Resource.Id.logout_btn);
logout_btn.Click+= delegate {
StartActivity(typeof(LoginScreen));
};
}

}

}
}


onConfigurationChanged(getResources().getConfiguration()); calling this
method in onCreate ,its showing error.what method we have to call it?
Bcoz I am new to monoandroid,Comparing to Android(native) is easy to use
orientation...Y?,its not easy way to use orientation in monoandroid?CAN
ANYONE HELP ME!!!.



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/OnConfiguration-is-not-being-called-tp5566767p5712943.html
Sent from the Mono for Android mailing list archive at Nabble.com.
___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


[mono-android] How to use Orientation onConfigurationChanged method in monoandroid?

2013-03-01 Thread pushtest82
Hi All,

Anyone one can help me...I don't know how to use both landscape and portrait
mode ...When I design and modify the landscape and portrait means ,its
automatically  design was also changed in other mode ..So I plan to use two
different screens name and call it in onConfigurationChanged method.But I
don't know how to call it in oncreate method.if I call  means its showing
some error..
Anyone can say whether  ,a proper way of using orientation in mono for
android..Here I post my code also.

[Activity (Label = "Setting",Theme =
"@android:style/Theme.Black.NoTitleBar.Fullscreen",ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation|Android.Content.PM.ConfigChanges.KeyboardHidden)]
//,ScreenOrientation = ScreenOrientation.Sensor 
public class Setting : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);

//SetContentView(Resource.Layout.settingscreen);
//OnConfigurationChanged();
//SetContentView(OnConfigurationChanged);

//OnConfigurationChanged();

 
onConfigurationChanged(getResources().getConfiguration());
}

public override void OnConfigurationChanged
(Android.Content.Res.Configuration newConfig)
{
base.OnConfigurationChanged (newConfig);



if(newConfig.Orientation==Android.Content.Res.Orientation.Landscape)
{

SetContentView(Resource.Layout.settingscreen_ls);

Button 
logout_btn=FindViewById(Resource.Id.logout_btn);
logout_btn.Click+= delegate {
StartActivity(typeof(LoginScreen));
};

}
else 
if(newConfig.Orientation==Android.Content.Res.Orientation.Portrait){
SetContentView(Resource.Layout.settingscreen);

Button 
logout_btn=FindViewById(Resource.Id.logout_btn);
logout_btn.Click+= delegate {
StartActivity(typeof(LoginScreen));
};
}

}

}
}


Give me a exact solution for using  orientation in monoandroid!

Thanks & Regards

Pushtest82



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/How-to-use-Orientation-onConfigurationChanged-method-in-monoandroid-tp5712944.html
Sent from the Mono for Android mailing list archive at Nabble.com.
___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


[mono-android] Android.Text.Format.DateFormat.GetDateFormat is missing

2013-03-01 Thread kruzo
Hi.
I want to format date and time in user's locale.
I know about DateTimeFormatInfo class. This is phone locale info, but user
can override it and set current date and time format in Settings -> Date &
time.
In Android we have android.text.format.dateFormat.getDateFormat and
getTimeFormat.
But I can't find these classes in Monodroid.
Can anybody help with this issue?
Thanks.




--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Android-Text-Format-DateFormat-GetDateFormat-is-missing-tp5712953.html
Sent from the Mono for Android mailing list archive at Nabble.com.
___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] Java.Lang.NoClassDefFoundError: java.lang.ICharSequence

2013-03-01 Thread m3rb1n
Hi,

Is there any way to fix the problem below?  I got this when running an
application using a java binding library for Zebra Printer.

{Java.Lang.NoClassDefFoundError: Exception of type
'Java.Lang.NoClassDefFoundError' was thrown.
  at Android.Runtime.JNIEnv.FindClass (System.String classname) [0x00087] in
/Users/builder/data/lanes/monodroid-mac-monodroid-4.2.4-branch/9f7cbd60/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:275
 
  at Android.Runtime.JNIEnv.FindClass (System.String className,
System.IntPtr& cachedJniClassHandle) [0x00014] in
/Users/builder/data/lanes/monodroid-mac-monodroid-4.2.4-branch/9f7cbd60/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:288
 
  at Com.Zebra.Android.Discovery.BluetoothDiscoverer.get_class_ref ()
[0x0] in :0 
  at Com.Zebra.Android.Discovery.BluetoothDiscoverer.FindPrinters
(Android.Content.Context p0, IDiscoveryHandler p1) [0x0] in :0 
  at BTPrinting.Discovery+<>c__DisplayClass4.b__0 () [0xd] in
C:\Android\BTPrinting\BTPrinting\Discovery.cs:49 
  --- End of managed exception stack trace ---
java.lang.NoClassDefFoundError:
com/zebra/android/discovery/BluetoothDiscoverer
at dalvik.system.NativeStart.run(Native Method)
Caused by: java.lang.ClassNotFoundException:
com.zebra.android.discovery.BluetoothDiscoverer
at 
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
... 1 more
}



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Java-Lang-NoClassDefFoundError-java-lang-ICharSequence-tp5052036p5712970.html
Sent from the Mono for Android mailing list archive at Nabble.com.
___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] Java.Lang.NoClassDefFoundError: java.lang.ICharSequence

2013-03-01 Thread Jonathan Pryor
On Mar 1, 2013, at 5:23 AM, m3rb1n  wrote:
>  --- End of managed exception stack trace ---
> java.lang.NoClassDefFoundError: 
> com/zebra/android/discovery/BluetoothDiscoverer

You're getting an error because the type 
com.zebra.android.discovery.BluetoothDiscoverer cannot be found.

Where is this type supposed to be located? Is this a .jar that's supposed to be 
present on your target device, like Google Maps? If so, you'll need a 
 in your AndroidManifest.xml.

Is this a .jar that's supposed to be included with your app? Then you need to 
add the .jar to your project with a Build action of AndroidJavaLibrary.

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] Can't start remove service

2013-03-01 Thread Jonathan Pryor
On Feb 28, 2013, at 11:48 PM, johnbowick  wrote:
> I'm currently trying to develop an application under Android using Mono.

Plugins are problematic:

http://forums.xamarin.com/discussion/comment/5245/#Comment_5245

You cannot have a Plugin which inherits from Java types or requires entries in 
AndroidManifest.xml, i.e. no Activities, no Services, etc. (This is as much an 
Android limitation as a Xamarin.Android limitation.)

Even if you have plugins which don't inherit from Java types or require 
AndroidManifest.xml generation, you still have the linker to deal with, as the 
code your plugin wants to use may not actually exist as it's been linked away.

I would suggest making your plugins separate `.apk` packages, using 
s/etc. to "register" the "plugin", and using StartActivity() to 
launch activities in the new .apk.

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] Android.Text.Format.DateFormat.GetDateFormat is missing

2013-03-01 Thread Jonathan Pryor
On Feb 27, 2013, at 12:26 PM, kruzo  wrote:
> In Android we have android.text.format.dateFormat.getDateFormat and 
> getTimeFormat. But I can't find these classes in Monodroid.

Unfortunately they are not bound at this time. We are looking into binding them 
in a future release.

In the meantime, you could use JNI to invoke the method.

IntPtr DateFormat_class;
using (var d = new Android.Text.Format.DateFormat ())
DateFormat_class = d.Class.Handle;

IntPtr DateFormat_getDateFormat = JNIEnv.GetStaticMethodID 
(DateFormat_class, "getDateFormat", 
"(Landroid/content/Context;)Ljava/text/DateFormat;");
IntPtr formatInstance   = JNIEnv.CallStaticObjectMethod 
(DateFormat_class, DateFormat_getDateFormat, new JValue (c));
// ...
JNIEnv.DeleteLocalRef (formatInstance);

Is there are particular DateFormat method you want to use?

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] Dynamic assembly loading issues

2013-03-01 Thread Jonathan Pryor
On Feb 27, 2013, at 12:10 AM, johnbowick  wrote:
> I have to compile application against correct Microsoft.Data.SqlXml.dll 
> assembly.

Bundle the assembly with your project so that everyone uses the same version.

Furthermore, you probably should be building this from source so that it uses 
the correct Xamarin.Android profile assemblies (unless it's a PCL assembly, 
maybe; PCL support is something we're still working on).

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] the version of 4.4.54

2013-03-01 Thread Jonathan Pryor
On Feb 24, 2013, at 11:57 AM, qinyi <120742...@qq.com> wrote:
> how can i download this version?please tell me the website! not 4.4.55 version

What's wrong with the 4.4.55 version? The difference between them is that 
4.4.55 will more reliably create an MfaActivation.dat file when activation 
fails.

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid