Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7654743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:20:04+00:00 2026-05-31T12:20:04+00:00

I wrote a module that creates a cameraview overlayed with an imageView to shoot

  • 0

I wrote a module that creates a cameraview overlayed with an imageView to shoot the photo, my problem is that since i can’t pass the image in the “res” folder i need to place it in “assets”, in pure java it all works fine, but i heaven’t understood where to place “assets” file in the titanium project once i exported the module.
And it crashes when i call the method with an IOException.
Thanks

    FrameLayout fl = new FrameLayout(this);
    SurfaceView preview = new SurfaceView(this);
    ImageView footerCam = new ImageView(this);
    LinearLayout ll = new LinearLayout(this);

    LinearLayout.LayoutParams shareParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    footerCam.setLayoutParams(shareParams);
    ll.setGravity(Gravity.CENTER_VERTICAL | Gravity.RIGHT);

    ll.addView(footerCam);
    fl.addView(preview);
    fl.addView(ll);

    setContentView(fl);
    camera = Camera.open();

    try 
    {
     AssetManager am = getAssets();
     BufferedInputStream buf = new BufferedInputStream(am.open("footer1.png"));
     Bitmap bitmap = BitmapFactory.decodeStream(buf);
     footerCam.setImageBitmap(bitmap);
     buf.close();
   }   
   catch (IOException e) 
   {
       Log.e("IMG","@@@@@@@@@@@@@@@@@@@@@@@ ERROR LOADING IMAGE");
       e.printStackTrace();
   }

this is the piece of code where i declare the button and assign it an image from the assets folder, but works only in android, when i deploy the module and include it in titanium it falls in IOException, where do i need to place the file “footer1.png” or the “assets” folder?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:20:06+00:00Added an answer on May 31, 2026 at 12:20 pm

    I managed it with this sort of worksround

    int resID = getResources().getIdentifier("IMG.png", "drawable", "it.temp");
    // or
    int resID = getResources().getIdentifier("it.temp:drawable/icon",null,null);
    
    button.setBackgroundResource(resID);// or whatever you need
    

    but you have to put the image in the same package as the sourcecode.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to write a kernel module that creates a directory in /proc named mymod
I have created a custom module that creates a custom Database table. I have
I've got a wrapper I wrote around the sqlite3 module that lets me serialize
I have a Python program that consists of several modules. The main module creates
I need to write a module that gives me a page will all possible
I need to write a module that sends order data to an epayment service,
Has anyone come across a Perl module that will parse (and write) kerberos configuration
I'm trying to write a unit test for a module that will give me
I wrote a python module. Running python filename.py, only checks for syntax errors. Is
I wrote a custom URL rewriting module, to take certain paths and map them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.