Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Content Resolver: Need some real help on a basic app

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • 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: 508
15
Notepad Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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: 508
15
Notepad Java
  • Mark post as helpful
  • send pies
  • 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.
 
That new kid is a freak. Show him this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic