• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Content Resolver: Need some real help on a basic app

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Need some big help on a basic app.

I have the content URI for a content provider and in a toast popup that displays the content from the URI.

I need to change this to a text view, and also I need to put in some code to AES decrypt (256 bytes) the PASSWORD values. I have the key already.



 
Rancher
Posts: 515
15
Notepad Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll try to answer.

(A)
In the line 9: Cursor c = getContentResolver().query(pwds, null, null, null, "_id");

In this line the variable pwds should be pwd, I think. The first argument the method takes is a Uri. Or, is pwds altogether another variable defined elsewhere.

(B)

I have the content URI for a content provider and in a toast popup that displays the content from the URI.
I need to change this to a text view,



The value of the result in the Toast is displayed using the code in line 31: Toast.makeText(this, result, Toast.LENGTH_LONG).show();

To show the result in a TextView:

- Define a TextView in the UI XML / layout file. For example,


- In the Java code:
TextView resultTextView = (TextView) findViewById(R.id.result_text);
resultTextView.setText(result);


In case you need the output as a list, you need to work with a ListView.

(C)

also I need to put in some code to AES decrypt (256 bytes) the PASSWORD values. I have the key already.



I found this link which has some example code, AES encrypt/decrypt example: https://howtodoinjava.com/security/java-aes-encryption-example/

 
Pol Denais
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Prasad. I will try the above. In regards to printing a file that is stored by another application would you know how? I have the file path.
 
Prasad Saya
Rancher
Posts: 515
15
Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks Prasad.



You are welcome.

In regards to printing a file that is stored by another application would you know how? I have the file path.



I think you should post a new message with the question. Also, you may want to provide more information regarding that: like what are the contents of the file and what is it you are planning to print, etc.
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic