•   almost 12 years ago

Android Dev

Hi, has anyone been able to install and run the application on android?
I installed the application with the given apk file but it gives me an error mint chip could not be initialized..

As for doing it from eclipse the app does not even open..

  • 19 comments

  •   •   almost 12 years ago

    Yes i inserted one of the mintchips provided into my android running gingerbread(2.3) My phone is LG P999.

  •   •   almost 12 years ago

    I did not have a problem with my Galaxy Note.

    As for running from eclipse I was having trouble (which may have been caused by me) with the application being unable to resolve the MintChipException class. I solved this by moving the MintChipAndroidApi.jar and MintChipCommon.jar to project/libs/ , removing the references from the .classpath file and then I used the GUI to add the jars back to the classpath. The application will now handle the exceptions correctly.

  •   •   almost 12 years ago

    Hey, thanks moving the jars to /libs worked!.
    I am still having the same issue now in both ways. The App opens up, in native .apk install, and through eclipse. but everytime i click a a button it gives me a dialog Error "ca.mintchip.contract.MintChipException: MintChip could not be initialized." I have tried both the mintchips provided.
    Also in the app when it opens it shows "Account: " empty and "Balance:" empty, im guessing the mintchips are not correctly configured ?

  •   •   almost 12 years ago

    I'm having the same issue, I think. The chips work fine with the Windows sample app. But when I run the Android sample (either the supplied apk or if I build the project myself) I get the MintChip could not be initialized exception...

    Moving the JARs around and adding them to the build path, etc. does not solve the problem. Does anyone from Developer Support have a solution to this issue?

  •   •   almost 12 years ago

    Still unable to use MintChips on Android.
    Running the sample code from Eclipse on a 4.0.3 tablet always gives the "ca.mint.mintchip.contract.MintChipException: MintChip could not be initialized." I was hoping that running this way in debug mode might make a difference but it didn't.

    LogCat output shows both libSDSCi.so and libMintChip.so are loaded, so that's not the problem.
    04-18 20:27:46.579: I/libMintChip(11308): eCoin_nativeInit is called
    04-18 20:27:46.579: I/libMintChip(11308): importFuncs is called
    04-18 20:27:46.579: I/libMintChip(11308): Functions are Loaded
    04-18 20:27:46.579: I/libMintChip(11308): testDriveName is called
    04-18 20:27:46.619: E/MintChip Sample(11308): Error
    04-18 20:27:46.619: E/MintChip Sample(11308): ca.mint.mintchip.contract.MintChipException: MintChip could not be initialized.

    The MintChip sdcard is obviously being recognized as LogCat has plenty of output from plugging it in and it getting mounted.

  •   •   almost 12 years ago

    Hey, I'm having the same problem as RC. Readding the libs to the buildpath allowed me to run the application but my sdcard is still not being recognized, and I have tried a few different things. I give a detailed description of how to get the added libraries added over at mintchipr: http://forums.mintchipr.com/topic/14/android-development/

    What android devices have you guys been trying on? Do we know its compatible with all android devices? I'm trying mine on an HTC G1 (running android 2.3) and am running into problems what about you guys?

  •   •   almost 12 years ago

    Can anyone from RCMint comment on what Android devices this code was tested with so we can get some kind of idea? Thanks!

  •   •   almost 12 years ago

    GaryR has figured out a workaround for the MintChip is not recognized problem on Android devices. He posted about it over at MintChipr: http://forums.mintchipr.com/post/46/#p46

    Basically you need to create a directory called external_sd on the microSD card and place the SMART_IO.CRD file in it. Thanks again so much to GaryR for figuring this out!

  •   •   almost 12 years ago

    Hey, not sure if they have fixed it since you guys last tried, but it works fine with my Samsung S2 (running 2.3). Hope this is resolved for you guys!

  •   •   almost 12 years ago

    Like Calum B said, GaryR found the solution.
    http://forums.mintchipr.com/post/46/#p46

    You need to mount the SD Card to the directory /mnt/sdcard/external_sd this way, the API will be able to reach the file.

  •   •   almost 12 years ago

    I can report they are working well, and I was able to specify anything as the location for the MintChip. Thanks for this fast fix guys!

  •   •   almost 12 years ago

    Has anyone gotten this to work through the emulator? I've tried specifying the path (mnt/sdcard/smartcard_io.crd and other variations) but it doesn't seem to work. I don't have an android and was hoping to avoid having to buy one.

    Thanks!

  •   •   almost 12 years ago

    Dickson W,
    AFAIK, the android emulators can only access a virtual sdcard, created with the SDK's mksdcard utility. There does not appear to be any way to make the emulator use a real sdcard connected via usb or sd reader.

  •   •   almost 12 years ago

    Hi Gary,

    I'm not sure if thats entirely true. I was able to get the app to run and if you go into the "Receive Payment" screen, you can click on the "Browse" button to explore the file system. From there, I was able to find the smartcard_io.crd under mnt/sdcard/

    In any case, thanks for the response! Maybe I'll just save myself time and get a cheap android device.

  •   •   over 11 years ago

    Greg/a MC developer,

    The updated API seems to be working better as I was able to use the MintChip on a few devices after that. Unfortunately as I'm trying to assure the compatibility of my app with other phones currently, I seem to be running into this issue again. It seems that some phones/tablets are not mounting the 3 partitions correctly and/or not to the right place. I've gotten 2/4 devices to mount correctly by themselves, but the Asus Transformer and the Droid Razr do not want to mount the secure portion of the disk. I see that you've added the new function createMintChip(String). I'm assuming I need to send it the location of smartcard_io.crd and not of the mount point /mnt/sdcard? I can try both, but since there does not seem to be any API reference I want to be sure. I was looking at http://developer.mintchipchallenge.com/api/java/ca/mint/mintchip/android/MintChipFactory.html

    --Andrew

  •   •   over 11 years ago

    I was able to get the sample app to recognize the mount on all of my test devices by passing the mount location as a string to creatMintChip(). Is seems to be different on most devices, but I haven't tried it on a Transformer or Razr. I think I have access to a Razr I can run my code on and I will let you know if it works. Good luck!

  •   •   over 11 years ago

    Calum,

    My question was not "createMintChip(String) is not working please help", it was "what is the intended string to send to createMintchip? /mnt/sdcard or the location of smartcard_io.crd? There is no API spec for this function."

    --Andrew

  •   •   over 11 years ago

    Andrew,

    Considering that location of an SD card can differ from one Android device to another, the following method has been added to the MintChipFactory class:

    public IMintChip createMintChip(String pathToChip) throws MintChipException

    where the pathToChip is a path to the external SD card that houses the MintChip. For example, "/mnt/sdcard/external_sd/".

    This method compliments the default one

    public IMintChip createMintChip() throws MintChipException

    which tries to connect to the MintChip using a list of well known paths to the external SD card used by many popular implementations of Android. In those cases when the default method fails, createMintChip(String pathToChip) can be used to explicitly provide a path to the external SD card.

    Since createMintChip(String pathToChip) has only been added recently we only communicated about it on this forum. We will be updating the reference documentation shortly.

    Vladimir
    Developer Support
    MintChip Team

  •   •   over 11 years ago

    I'm using a Galaxy Nexus device, which doesn't have an SD card slot. This means that I need to use the Hosted APIs.

    I'm happy to report that I've been able to port the MintChipSample app to use the hosted APIs instead of the local SDcard storage.

    It wasn't easy, but considering I've never done any Android development before, I'm happy to have accomplished it.

Comments are closed.