How to read magnetic card data? - encode

I work with the magnetic card reader "MiniMag II" (ref. IDMB-334133B and datasheet here) on Windows 7. A driver has ben automatically installed, adding the card reader as a standard input device to Windows recognized devices.
When I swipe a card in the reader, card data is sent to the pc and written in the current window.
My problem concerns the card data format : I receive strings such as "méà(è&('&_é"(à&&à=àààààààààààààààààààà§", do you recognize a format here ?
I am not aware of the exact data format, but I know that the following numbers are included in their corresponding card data :
412835 : méà(è&'&é_"(à"&é-=&çà"'àçà(&àààààààààà§
418559 : méà(è&'&_((çà'&&-=&(&à'&'&à&àààààààààà§
2989449 : méà(è&éç_ç''çà&&à=àààààààààààààààààààà§
5418235 : méà(è&('&_é"(à&&à=àààààààààààààààààààà§
Do you have any lead to help me to understand how the received card data is built ?
Thank you

I found the solution, my system was in AZERTY mode and the reader input me QWERTY data... so when I changed the settings I have obtained the numbers I was looking for. Hope it can help someone.

Related

How to copy from Storage to FileSystemStorage in Codenameone and display in BrowserComponent

I've been reading a lot of StackOverflow posts that discuss copying data from FileSystemStorage to Storage in CodenameOne, such as described in this answer from Shai, as seen below:
InputStream stream =
FileSystemStorage.getInstance().openInputStream(i);
OutputStream out =
Storage.getInstance().createOutputStream("MyImage");
Util.copy(stream, out);
Util.cleanup(stream);
Util.cleanup(out);`
I've been trying to do the reverse: save from Storage to FileSystemStorage in order to show a PDF in the BrowserComponent (while using iOS), but have not been able to do so. I need to show the PDF within the app (so I don't want to use Display.getInstance().execute()).
Basically, I'm trying to dynamically populate a Container with whatever files the user selects-- I am using the FileChooser library for CN1 from Steve Hannah. (Disclaimer: I have made slight modifications to this library as it used in the app I'm working on-- HOWEVER, when I choose images with this library and pull them from Storage to an Image via InputStream, they display perfectly in an ImageViewer so I know that all files are being saved correctly in Storage.)
Here is my code (with help from Steve Hannah's comment on GitHub):
//fileLocation and fileName are slightly different but both end with file extension
File file = new File(fileToUpload.getFileName());
FileSystemStorage fss = FileSystemStorage.getInstance();
InputStream is = Storage.getInstance().createInputStream(fileToUpload.getLocation());
OutputStream os = fss.openOutputStream(file.getAbsolutePath());
Util.copy(is, os);
ToastBar.Status status = ToastBar.getInstance().createStatus();
String message = file.exists() + " " + file.isFile() + file.getAbsolutePath();
status.setMessage(message);
status.setExpires(3000);
status.show();
NativeLogs.getNativeLogs();
if (Display.getInstance().getPlatformName().equals("ios")) {
//Log.p("in ios !!!!");
BrowserComponent browserComponent = new BrowserComponent();
browserComponent.setURL(file.getPath());
horizontalContainer.add(browserComponent);
}
The ToastBar displays true and true for file.exists() and file.isFile().
I stipulate iOS because as far as I've seen while researching previewing PDFs within an app, I've seen that Android needs to have a different implementation, like adding a NativeInterface with an Android library. I also saw in different answers on the Google Group that this functionality (using browserComponent to view PDFs) is only available for iOS and not on the simulator. In the simulator, I see a blank space. My iPhone just freezes and/or crashes after displaying the ToastBar (and I work on a Windows machine, so not much ability to see native logs....)
What can I do to access the file and show it in the BrowserComponent?
Thank you!
Simple solution -- the file had a space in it (eg. "Test page.pdf") and didn't show! When I used files that didn't have spaces this worked and after removing spaces in the file names, thankfully everything worked. I'll have to add code to handle this scenario.
Thanks for your help!

Can I create a single QR code that contains the url, vcard and geo location info?

Is it possible to create a single QR code that contains the url, vcard and geo location all in one?
QR Codes can contain anything you want, they are just data.
There are no norms for the data inside QR Codes, but there are good practice such as MeCARD, Wireless network, Geolocation. It's hard to predict whether the phone/OS/QR Code reader
will read it correctly or not.
Here is a great list maintained by ZXing: https://code.google.com/p/zxing/wiki/BarcodeContents.
Anyway, the best is to create a QR Code with a web link, and do your thing in a web page or with a file to download. You can create editable web links for QR Code at http://www.unitag.fr, they are called QR Code Live.
There are lots of QR code generators.
Here is one:
http://www.qrstuff.com/
Click on "text" and you can put in all kinds of stuff - up to 1000 characters.
Here is the first line of the Gettysburg Address:
One QR code generator is also at zxing QR code generator. I used it and generated a QR code and scanned that code with QR code reader app on my Windows 8 phone. Works great. Many thanks to those guys at zxing. Moreover, you can generate QR code in any app (Windows Phone/Android/iPhone/WinForms/Windows 8 desktop app) using the libraries for respective platform.
An example in .NET 4.0 follows. This code doesn't use any obsolete classes/methods.
string contact = File.ReadAllText(#"C:\Users\****\Documents\****.vcf");
BarcodeWriter bcWriter = new BarcodeWriter();
ZXing.Rendering.BitmapRenderer renderer = new ZXing.Rendering.BitmapRenderer();
bcWriter.Renderer = renderer;
bcWriter.Format = BarcodeFormat.QR_CODE;
Bitmap bm = bcWriter.Write(contact);
pictureBoxQrCode.Image = bm;
bm.Save(#"C:\Users\****\Documents\****.png");

How to find that current Blackberry device support Hindi(or Gujarathi) or not?

Hi blackberry developers,
I am implemented one application targeted to OS6 and above.
Here i am loading url which is contain some Indian (Gujarathi) language into the browserField.
Here My problem is that text displaying some devices correctly but not all.
it is showing text properly in Bold 9780 OS6, But Tourch 9800 OS7 is not showing properly.It is showing only Rectangular Boxes.
So i need to know that is my devise support gujarathi language are not first.
I am using some code to get list of available languages
Locale []loc1=Locale.getAvailableInputLocales();
for(int i=0;i<loc1.length;i++)
{
System.out.println("=====1: "+loc1[i].getLanguage()+"======"+loc1[i].getDisplayLanguage());
RichTextField rh1=new RichTextField("ISO: "+loc1[i].getLanguage()+"==name: "+loc1[i].getDisplayLanguage(),Field.FOCUSABLE);
add(rh1);
}
String []loc2=Locale.getISOLanguages();
for(int i=0;i<loc2.length;i++)
{
System.out.println("=====2: "+loc2[i]);
RichTextField rh2=new RichTextField("ISO: "+loc2[i],Field.FOCUSABLE);
add(rh2);
}
in both cases it is displaying as attachment.
And strange thing is that in both array's i am not finding any language named as "Gujarathi" or "gu(ISO code)". But perfectly displaying data on my 9780 but 9800 not showing.
So Here i want to know what is the reason behind this ?
1) If suppose my devise is supporting "Gujarathi" Language then why it is not showing it's name in Locale.getISOLanguages(); or Locale.getAvailableInputLocales();?
2)How can we know that current device can support required language language?
I also tried using desktop-manager--->Applications------->available languages even here also i am not finding anything related to indian languages
I need to give answer to Client that what is the reason behind this ?
I goggled for 12Hrs. But no use So i decided that you are my only hope?
Try Checking Localization Demo
http://docs.blackberry.com/en/developers/deliverables/33805/Localization_sample_app_files_1791764_11.jsp

MonoTouch Way to get Own phone number and Sim Id(SSID)?

Im stuck to get own phone number and Sim ID (SSID) using Monotouch
I tryed:
var v = NSUserDefaults.StandardUserDefaults.ValueForKey((NSString)#"SBFormattedPhoneNumber");
var t = NSUserDefaults.StandardUserDefaults.ValueForKey((NSString)#"ICCID");
new UIAlertView("Ur phone Number",""+v.ToString(),null,"Ok",null).Show();
new UIAlertView("Ur ICCID",""+t.ToString(),null,"Ok",null).Show();
and all other ValueFor***
it always return null or " "
Tried on iphone 3g. Please help.
Apple does not want to to access this information as it can easily be misused. Any application doing so is likely to be rejected from the AppStore. See the comment (with more than 30 up votes) from this answer.
Also note that your code above does not read from the SIM - it reads from the iTunes registration data, which does not have to be set to any value (i.e. you can't trust it).

camera programming in black berry

my following code returns null ,
byte[] image1 = _videoControl.getSnapshot(null);
any suggestion please
Few important moments about VideoControl.getSnapshot method:
some manufacturers may not implement getSnapshot() method;
the viewfinder must actually be visible on the screen prior to calling getSnapShot();
if you attempt to take pictures too quickly, however, getSnapShot() may
return null. The camera requires time to clear out its buffer and
prepare for the next shot;
you may check MMAPI System Property for "video.snapshot.encodings" before capturing:
if (System.getProperty("video.snapshot.encodings") == null) {
// getSnapshot() is not supported
}
You may read this chapter from book "Advanced BlackBerry Development":
http://books.google.com/books?id=F4Qu-lpoVncC&pg=PA53&lpg=PA53#v=onepage&q&f=false
Since VideoControl.getSnapshot method is not supported by all devices I'd recommend to use another approach. You can start the native BB Camera app with this line of code:
Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments());
and then using the FileSystemJournalListener catch the taken image.
The BB SDK on your PC contains samples. Search for 'fileexplorerdemo' sample to see the rest of details.

Resources