2

I am trying to develop an encryption and decryption app where user will input text and password and click on encrypt/ decrypt and the respective operation will be performed.

1). The problem I am facing is how to include Java Packages like :-

import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;

import java.security.InvalidAlgorithmParameterException;

import java.security.NoSuchAlgorithmException;

import javax.crypto.BadPaddingException;

import javax.crypto.Cipher;

2) The second thing I want to know is How to share that text (encrypted) through other apps if I place share button.

3) I also want to save the text with extension as abc.myapp

Rick
  • 373
  • 5
  • 19

1 Answers1

3

Not all packages are available in Codename One see the JavaDocs for what's available.

Encryption and decryption should be done via the Bouncy Castle cn1lib. You can see a sample of that here.

Codename One has a share button API and a share API that works with text and images.

The last question is a bit problematic. Mobile devices don't have a file system in the way desktop OS's have them. Every app runs in its own locked down environment and can't really access other files. I suggest rephrasing the question in more general terms explaining what you are trying to achieve ideally with examples of apps that already do that.

Community
  • 1
  • 1
Derek Johnson
  • 812
  • 5
  • 6
  • Like if u save a file it will be saved with extensin .myapp which can be opened through myapp only and not via any other app – Rick Jan 09 '16 at 17:25
  • Mobile devices don't have a file browser in the sense that desktops have them. You generally work by opening URI's e.g. https://www.codenameone.com/blog/can-execute.html – Shai Almog Jan 10 '16 at 05:28