NativeDialogs
NativeDialogs copied to clipboard
Android not built correctly
Hi,
I was looking into why your ANE context wasn't being found when working for android and I think it seems your ant script isn't building the jar files correctly.. When I unzipped and decompiled your NativeDialogsExtension class you can see: "Unresolved compilation problems: String cannot be resolved to a type".
I have taken your source code and put it into my own ANE template, rebuilt it and it now seems to be working.
Good work on the ANE, but you might want to look over your build script.
Thanks Matt
I have uploaded the rebuilt ane file which I have been using and is working. File can be downloaded here:
http://rancondev.com/NativeDialogs/NativeDialogs.ane
Thanks mattmurton! This fix was a lifesaver for me.
I'm using Flash CS6. What is the import path?
import ????.???.NativeDialogs;
Thanks
CJM
Once the .ANE is loaded properly these are the import statements needed to initialize the functions:
import pl.mateuszmackowiak.nativeANE.dialogs.NativeAlertDialog; import pl.mateuszmackowiak.nativeANE.dialogs.NativeDatePickerDialog; import pl.mateuszmackowiak.nativeANE.dialogs.NativeListDialog; import pl.mateuszmackowiak.nativeANE.dialogs.NativePickerDialog; import pl.mateuszmackowiak.nativeANE.dialogs.NativeProgressDialog; import pl.mateuszmackowiak.nativeANE.dialogs.NativeTextInputDialog; import pl.mateuszmackowiak.nativeANE.dialogs.support.NativeTextField; import pl.mateuszmackowiak.nativeANE.dialogs.support.PickerList; import pl.mateuszmackowiak.nativeANE.dialogs.support.iNativeDialog; import pl.mateuszmackowiak.nativeANE.events.NativeDialogEvent; import pl.mateuszmackowiak.nativeANE.events.NativeDialogListEvent; import pl.mateuszmackowiak.nativeANE.notifications.Toast; import flash.events.Event;
thanks for this !! New ane works fine in android
Where is the new .ANE?
For me the issue is that on Android using AIR 3.4 DATE_AND_TIME shows two date dialogs and no time dialog. Is anyone else seeing this?
It's in the above comments, but here it is again:
http://rancondev.com/NativeDialogs/NativeDialogs.ane
That is the one that is only displaying Date for me without time but rather multiple date dialogs.
Speedclimb - Looking at the native code in the original ANE this type of dialog was not finished. If I get a bit of time I push my template to git so everyone can get the working source, and then write the native code for the date/time picker. Both date and time should work individually though.
Matt,
Thanks for the reply. I have tried: d.displayMode = NativeDatePickerDialog.DISPLAY_MODE_DATE_AND_TIME; d.displayMode = NativeDatePickerDialog.DISPLAY_MODE_TIME;
Neither of these will bring up the time dialog. Each brings up the Date dialog. I have tested on HTC EVO 4G and Nexus 7. Any help would be appreciated.
Here is the entire code
import pl.mateuszmackowiak.nativeANE.dialogs.NativeAlertDialog; import pl.mateuszmackowiak.nativeANE.dialogs.NativeDatePickerDialog; import pl.mateuszmackowiak.nativeANE.dialogs.NativeListDialog; import pl.mateuszmackowiak.nativeANE.dialogs.NativePickerDialog; import pl.mateuszmackowiak.nativeANE.dialogs.NativeProgressDialog; import pl.mateuszmackowiak.nativeANE.dialogs.NativeTextInputDialog; import pl.mateuszmackowiak.nativeANE.dialogs.support.NativeTextField; import pl.mateuszmackowiak.nativeANE.dialogs.support.PickerList; import pl.mateuszmackowiak.nativeANE.dialogs.support.iNativeDialog; import pl.mateuszmackowiak.nativeANE.events.NativeDialogEvent; import pl.mateuszmackowiak.nativeANE.events.NativeDialogListEvent; import pl.mateuszmackowiak.nativeANE.notifications.Toast; import flash.events.Event;
recallDatePicker_btn.addEventListener(MouseEvent.CLICK,showDatePicker);
function showDatePicker(e:Event = void):void { var d:NativeDatePickerDialog = new NativeDatePickerDialog(); d.addEventListener(NativeDialogEvent.CLOSED,onCloseDialog); d.addEventListener(NativeDialogEvent.CANCELED,trace); d.addEventListener(NativeDialogEvent.OPENED,trace); d.addEventListener(Event.CHANGE,function(event:Event):void { var n:NativeDatePickerDialog = NativeDatePickerDialog(event.target); trace(event); output_txt.text = "Date set to:"+String(n.date); trace("Date set to:"+String(n.date)); }); d.buttons = Vector.<String>(["Cancel","OK"]); //d.displayMode = NativeDatePickerDialog.DISPLAY_MODE_DATE_AND_TIME; d.displayMode = NativeDatePickerDialog.DISPLAY_MODE_TIME; //d.displayMode = NativeDatePickerDialog.DISPLAY_MODE_MULTIPLE;//Doesn't work d.title = "DatePicker"; d.message = "Select date:"; d.show(false); }
function onCloseDialog(event:NativeDialogEvent):void { var m:iNativeDialog = iNativeDialog(event.target); m.removeEventListener(NativeDialogEvent.CLOSED,onCloseDialog); trace(event); m.dispose();//Must be called if not used again }
showDatePicker();
Hi Speedclimb, I have just tested your code exactly as above (except there was an error in your vector instantiation, I think you meant " new <String>["Cancel","OK"]; ") using the linked ANE and the Date and Time picker both work on the devices I have to test here. These include a couple of Samsung tablets, Samsung galaxy s2 + HTC Desire X. I suspect, and I am just guessing here, that the issue lies with the fact that the time dialog isn't supported on the your HTC / Nexus or the version of android running on both..
Maybe try opening the dialog with logcat running on your machine and see if any relevant errors or warnings come up.
Matt
I have a problem..So I need someone's help~ I using the linked NativeDialogs.ANE It is perfectly working on ios, but on Android,,It is not working,, Android phone is Samsung galaxy s2, ver 4.0.4 I hope any error message's show,,but It doesn't show any error messages,, I think..source code doesn't have problems;;So...What is my problem???? ahahahahahahah OTL my source code is copy and paste from templete;; please help me.. I tested on AIR3.4 and AIR3.7.0.1530
ps.) I'm sorry,, I'm not good at English..
public function AppMain() {
var m:NativeListDialog = new NativeListDialog();
m.addEventListener(NativeDialogEvent.CANCELED,trace);
m.addEventListener(NativeDialogEvent.OPENED,trace);
m.addEventListener(NativeDialogEvent.CLOSED,readSelected);
m.addEventListener(NativeDialogListEvent.LIST_CHANGE,function(event:NativeDialogListEvent):void
{
trace(event);
var m:iNativeDialog = iNativeDialog(event.target);
m.shake();
});
m.buttons = Vector.<String> (["OK","Cancle"]);
m.title = "Title";
m.message = "Message";
m.dataProvider = Vector.<Object>(["one","two","three"]);
m.displayMode = NativeListDialog.DISPLAY_MODE_MULTIPLE;
m.show();
}
private function readSelected(event:NativeDialogEvent):void
{
var m:NativeListDialog = NativeListDialog(event.target);
trace(event);
trace("selectedIndex: "+m.selectedIndex);
trace("selectedIndexes: "+m.selectedIndexes);
trace("selectedItem: "+m.selectedItem);
trace("selectedItems: "+m.selectedItems);
this["txt"].text = m.selectedItems;
m.dispose();
}
commit 7f79e49 should resolve this problem.
Thank you so much for fixing this issue.
Is DISPLAY_MODE_MULTIPLE no longer valid? If so is the resolution to use DISPLAY_MODE_DATE_AND_TIME?
Thank you again. This is a lifesaver.
@mattmurton can you reupload fixed NativeDialogs.ane cause http://rancondev.com/NativeDialogs/NativeDialogs.ane is not available.