how to access asset through onclick - Java for Android App Development

I am very new to app development. im trying to figure out if/how i could access a txt file in the assets folder through a button click.
for example. ive created a scroll list activity that contains buttons each linking to a chapter in a manual. each chapter is a txt file that ive copied to
/assets/Resources/chapters within my app
Then I would like to display that text to the user
does this sound like something that could work.

It will work. Do it as described here: http://stackoverflow.com/a/4789699

Related

where does the list of programs--> button comes from?

I'm writing a script using Mortscript, and I would like to assign it to a button.
When I go in the proper menu (Buttons), I have a list of programs.
Now, some of them are script files, but not all of them.
How can I have my script listed there?
What kind of programs are listed in that pop-up menu?
Suggest that you copy your script file & paste a shortcut in Main memory\Windows\Start Menu, it will then appear in the list of programs you can run via Programs on the Today screen as well as the place you want it. Please remember to paste a shortcut not the actual file.
You can also re-organise the Start Menu items by creating folders & moving the shortcuts into them, it saves having to scroll through long lists of icons. I have folders for things like utilities & games.
Mike
thanks Mike,
this is something I've done for a long time, and I agree it's useful.
But my aim here is to use one of the hard buttons (the video calling one) to substitute the on-off button on the left. The reason is simple: I prefer to use my right hand.
That's why I wrote a Mortscript file to do that.
Now how it is some mscr files can be seen by the "assign button" routine and others can't?
File dimension? Use?
No idea.

map programs folder to hardkey?

In HTC home plug, I can set one of the soft buttons on the launcher to "launch programs folder". Is there a way to map this function to a hardkey? I don't want to download a third party launcher--I just want to be able to press a button and open the programs folder (and not in the file explorer view).
Any help would be wonderful.
Another folder in which I could put shortcuts in would also work. I just want the icons large and finger friendly like the programs folder.
Is it possible to use folderview.exe to do this?
Check here for the solution...
http://forum.xda-developers.com/showpost.php?p=1644004&postcount=7
I used this to create a shortcut in each and every sub folder under Programs so once in a sub folder, I can easily go back to the Programs folder without having to close the window and open the Programs again from the HTC Home App.
I called the shortcut '!Back to Programs.lnk' so it appeard at the beginning of every folder and the shortcut is setup as follows...
Code:
53#\Windows\folderview.exe #?\Windows\shellres.dll,-8208
Copy the above into simple binary text editor and save to have your shortcut.
I guess you wouldn't need the '53#' and '?\Windows\shellres.dll,-8208' bits to link to hardkey. This is more to give the shortcut a nicer icon in the folder view.
Been looking for this. google search "launch programs folder" found this thread. Ought just be a 'icon view' option in file explorer dontcha think? Thanks!
Hmmm... it's not doing quite what I'm after...
As the FolderView is an application, when you click the X in the top right corner, it closes the window. If you were in the 'Start' => 'Programs' folder and were in a sub folder, pressing the OK button would simply return you to the previous folder.
I counter acted this by adding a shortcut to the FolderView app in every folder as mentioned above but for some reason this no longer works correctly. I think it has something to do with the HTC Task Manager I have upgraded to (v 2.0.30995). Works better than previous version but for this one thing, I think it's stopping multiple instances of the FolderView app.
So, this brings me to... How can you load the Programs Folder so you can go back from a sub folder?
Can anyone hack the FolderView app? A simple 'Up' button could be added to the lower left of the window, similar to the view of File Explorer. This way, the X can still be used to close the FolderView App and the 'Up' button takes you back up the Programs list.
In case your wondering, I have various apps loaded on my Pocket PC and have categorised them and placed into sub folders. I've then created an icon association to each folder so it looks a little more pleasent when viewing. However, I want to freely browse the folder. See attached Tumbnail...
the link works on sprint touch. I call it "_Up" so it always appears at first position.
I note that folderview when you close it doesn't appear in task menu like file explorer and most other app.
folderview with some options would be great because it's a fast finger friendly interface ... must faster and easier to configure than various cubes.
ps
I came across this in another thread. I haven't tried it yet but I'm gonna take a look when I get a chance.
Possibly it could be used to add some features to folderview:
http://www.angusj.com/resourcehacker/
I'm glad I stumbled across this thread because I think it's exactly what I want to do...I just need a little help as I'm not as savvy as some of you guys might be.
What I'm wanting to do is create sub directories in my programs folder like viglante_xix does (grouping Office, GPS Programs, Media Programs, etc.) and point to it as a shortcut in rlToday. I think I might have been able to figure this out on my own after tinkering, but I don't have the folderview.exe in my windows dir. Can someone send me a copy or know of an alternative?
Also, I'm not completely ignorant to programming; I know a little VB, Java, and C++. I understand how the code above works, but what program do I use to make this shortcut...preferably something free.
Thanks in advance.

Modifying application icons

Hello,
I've been searching all day for any information on how to change the icons for various applications. I'm somewhat at a dead-end.
I've read that to change application icons you have to edit the .lnk file. However, I've discovered that applications seem to have multiple .lnk files associated with them, for example; my 1-calclite.exe program has a .lnk file in both \windows\ and in \windows\start menu. Which of these am I supposed to edit to change the icon throughout the system?
Also, the only information I've seen to edit states that you add a comma and then the name of the .dll to use as the icon. This, needless to say, is a bit confusing. I have a whole rack of .png files that I'd like to use as icons (I can easily convert them to .ico if needed) that I would like to associate with programs. Do I need to somehow compress them into a .dll file, or can I just store them into a directory (say, \my documents\icons) and just point the .lnk file to there?
Alternatively, is there any program (free or otherwise) which simplifies this whole process in a GUI?
Thanks for any help you all can give!

How can i create a shortcut to Program & Setting Folders in Start menu

How can i create a shortcut to "Program Folder " & for "Setting Folder" in Start menu .. as example make the right soft key open setting folder and the left one open programs
Bro' use this - WM 5 NewMenu
Programs > Create shortcut to \Windows\Start Menu\Programs
Dr.Mazika said:
How can i create a shortcut to "Program Folder " & for "Setting Folder" in Start menu .. as example make the right soft key open setting folder and the left one open programs
Click to expand...
Click to collapse
You should have two programs in your \Windows folder, one called "htcPrograms.exe" and the other is "htcSettings.exe" These programs open the folder that is implied in their name, so if you create a shortcut to these programs it should work. Thay are down a bit.
T M Z
tmz said:
You should have two programs in your \Windows folder, one called "htcPrograms.exe" and the other is "htcSettings.exe" These programs open the folder that is implied in their name, so if you create a shortcut to these programs it should work. Thay are down a bit.
T M Z
Click to expand...
Click to collapse
No htcSettings.exe Or htcPrograms.exe
Any Help
Without that htcsettings file I don't think anything will work. And I also don't have that file. I just know that I've tried making a shortcut to the "settings folder" before and no one seemed to know how. The problem is its not actually a "folder". It's something else. You can make shortcuts to the individual .cpls but not the whole "folder"... The programs folder is actually a folder so you can just make a shortcut to that but the settings is a whole other ball game. If you figure it that that'll be great!
Do you have the file \Windows\folderview.exe? If so, this works on my Touch XL to shortcut to the programs listing - icon list, just as if you press programs in the start menu.
Hey guys, these two shortcuts exist. Go to windows, it's not in a folder, but down below the folders. Use your sidebar and scroll it half way down. Start looking for those two. Their about 3 to 4 files apart from each other. Roughly in alphabetical order. After you find them hold down on them with your stylus and copy them to whereever your like to create a shortcut for them. i copy them both to my documents and had no problem creating shortcuts to both of them. Hop that helps. I tried posting a picture. I just can't get it to copy in this bo
This is it.
not exist in my windows folder
Dr.Mazika said:
not exist in my windows folder
Click to expand...
Click to collapse
what WM are you running?
am i missing something here, or can't tmz just post those two files from his/her windows folder? it'd be much faster than going through asking people what ROM they're running, etc.
tmz said:
This is it.
Click to expand...
Click to collapse
This? T M Z
I'm some what new at this. I don't know what you mean by "post the files." I thought the picture showing the files in windows is what you were looking for.
try these apps. copy them to any folder and create a shortcut. works perfectly
here are the two programs
just install them where you want
woops, someone already posted files!
asefsef said:
woops, someone already posted files!
Click to expand...
Click to collapse
This is the one.
The setting icons have a quite large text, but it is ok.
Folderwiev for programs looks perfect on duttys rom 3.x
Number of icons per row
Thanks - great applications.
In my regular settings, I have changed registry settings so that I get 4 icons per row (Horizontal icon spacing, vertical icon spacing). How do I do that for these programs? Is there a parameter I can pass to them? Or can your program read those values from the registry and adapt the display accordingly?
Hi, Guys, if you don't want to add any additional apps to your phone, here's the pure-shortcuts way:
Please check these two threads for more info:
In this thread ([Guide] How to create .LNK files and use parameters) you'll know how to make a full set of shorcuts for all control-panel settings items, and a ready-made set already there.
In this thread (Control Panel links and icons wm2003se and higher) you can also know how to associate those shortcuts with system icons.
Hence, for 'settings', just creat a new folder in \windows\start menu\programs\ named 'settings' and put inside all the control panel shortcuts.
Edit: The advantage of this wayis: You can map any single item of settings into the softkeys or a hardware button. So shortcuts become shortcut to your target within one touch.
For 'programs', just create a shortcut for the folder \windows\start menu\programs\ inside the folder itself.
Thank you egoist6 for Files
You saved me from HardReset
My problem was crushed manila and no settings shortcut in ROM, there is no htcsettings.exe , no settings.exe , no cplmain.cpl
thank you

[APP] Control Panel Settings to Links (.lnk)

Hi guys,
I know it's a 10 seconds job to create a link for items inside the control panel (settings) such as "Usb to PC" or "Power" but I'm too lazy to do it every time I try a new rom,
also I found some of the values change from rom to rom, so I create a really simple app that goes through the registry key which holds the settings items (KLM\Security\Shell\StartInfo\Start) and creates a .lnk file for each of these entries.
Having a direct link allows me to add that option as a quick link which is handy 8)
Anyway, here is the tool in case someone wants it.
The exe must be installed in "\Program Files\CplLinks" (Device). It only takes 11.5 kb. The only reason the .exe is needed after the lnk are created is to provide an icon.
When you run it, it reads the HKEY mention above and creates .lnk for each item in the "Settings" menu. The lnks are created in "\Windows\Start Menu\Programs\CplLinks" so are directly accessible through the Programs menu.
There are no messages, it runs and creates the links, no interaction whatsoever so do not expect any nice popup window 8)
Next version will use specific icons for each item, right now, all the links use the same icon from the cpllink.exe executable.
The icons for most of the Settings are .png files rather than .ico, and WM doesn't have an easy way to convert from .png into .ico, the idea for a "future version" is to collect all the .png files,converted to icons and create a dll on the fly with the icons as resources, so they can be referenced from the .lnk files
Couple of screen shots from the emulator.
Great application! It works like a charm! Thank you for this convenient time saver
EDiT (another time saver)
After applying a Hard Reset WE have to reinstall all programs if you have previously installed them in the memory card. Often it is sufficient to recreate the shortcut in the start menu. ShortCutCreator helps you to recover the exe files and to recreate the desired shortcut.
Thanks for sharing!
I guess would be better if I manage to provide a different icon for each link, but Icon support is quite limited inside VM. Need to work in the PNG to Icon -> .dll routine 8)
I though having the app in internal memory was a better solution than in \Storage Card, so it will take less time to load the icon from the program, but I can change it and allow that option, so the icons in the links are pointing to \Storage.. rather than \Programs..
Anyway, it just a time-saver thingy 8)
Nice app. It does not seem to work on WM6.1 though.
It does create a new folder structure: CplLinks\System inside the Start Menu.
Very nice. It does seems to create a bunch of redundant or non-used links though
Yep, I saw it only works on WM6.5, on WM6.1 there are no "StartInfo\Start" in the "KLM\Security\Shell\". Not sure where it keeps that info, maybe somewhere else in the registry.
I finally managed to convert PNG to ICO, so I think next version would allow you to choose which items you want to create links for rather than just dump everything 8)
dubidu said:
Yep, I saw it only works on WM6.5, on WM6.1 there are no "StartInfo\Start" in the "KLM\Security\Shell\". Not sure where it keeps that info, maybe somewhere else in the registry.
I finally managed to convert PNG to ICO, so I think next version would allow you to choose which items you want to create links for rather than just dump everything 8)
Click to expand...
Click to collapse
WM6.1 control panel is "HKLM\ControlPanel" if I remember correctly. There will be numbers for the mycpl stuff and words for some other control panel items like backlight, etc.
I think this post got lost in the last database disaster 8)
I wrote a new version of this tool that now gives you the icons for the control panel settings, check it out here:
http://forum.xda-developers.com/showthread.php?t=791682

Categories

Resources