Accessing drawables when using view binding in Android Studio - binding

Prior to changing to view binding in Android Studio I could access drawables using R.drawable.filename - As far as I can make out when using view binding the R file is not generated - Any ideas as to how I get round this - Thanks - Rob
Sorry - I should have mentioned that I am trying to load it as an image using BitmapDescriptor.fromResource(R.drawable.filename)
I have now solved this problem by moving the images to an assets directory and using
BitmapDescriptor.fromAsset(filename)
Thanks
Rob

Related

Using OpenElement to open an Attachment with a URL

Trying to open an attachment with this url and it doesn't work. Any idea why?
https://Blah-apps.com/Development/StrongB.nsf/0/(Attach)/0/B3B9D4480BEF667C852588310078E1AE/$File/golf.pdf!%20&OpenElement
Thanks for any ideas
The attachment was originally created on the web and was an embedded object. I then wrote code to move it to a Rich Text Field and that didn't help. The error I get is
HTTP Web Server: Couldn't find design note
This is from a note that I pulled together for HCL some time ago listing the issues we had with Domino 11 having upgraded from 9. This might help although it is not clear what version you are on.
Broken Download links for LZ1 compressed attachments. - CS0313452
After upgrading to FP5 customers found that they could not download some attachments.
We were able to reproduce this issue 100% and provided HCL with a database.
https://eon.focul.net/eon/apps/moc.nsf/xp_f_mod.xsp?action=openDocument&documentId=67BC79B86B06BAFD802582B30042ACFB FoCul determined that this happens to attachments that are automatically compressed with LZ1 even when the database settings do not enable compression.
+SPR# GRHEBVYNW7 - Server - DAOS - Fixed an issue where after upgrading to 11.x,
running dbmt -c on DAOS enabled databases results in duplicate DAOS objects being stored.
This regression was introduced in 11.0.
The URL syntax affected is the old style https://<>//<>/<database.nsf>>/<>/$FILE/<>.jpg
whereas the newer “XPage”style syntax works fine
We modified our applications to use the XPages style syntax as a good work around.
This is the XPages url style
https://acme.focul.net/apps/moc.nsf/xp_f_mod.xsp?action=openDocument&documentId=67BC79B86B06BAFD802582B30042ACFB
Your use of /0/(Attach)/0 looks wrong. Try this format instead: http://host/Database/View/Document/$File/Filename?OpenElement (source: https://help.hcltechsw.com/dom_designer/9.0.1/appdev/H_ABOUT_URL_COMMANDS_FOR_OPENING_IMAGE_FILES_ATTACHMENTS_AND_OLE_OBJECTS.html)
So in your case:
https://blah-apps.com/Development/StrongB.nsf/0/B3B9D4480BEF667C852588310078E1AE/$File/golf.pdf?OpenElement

Appcelerator App Designer assets path issue and RGBA

I have an issue with Appcelerator App Designer.
I have an image path in assets like app/assets/iphone/images/MainBG.png
In xml i need to use path like /images/MainBG.png
But App Designer set path like /iphone/images/MainBG.png that does not work when i run my app... Yes, i can change this path, but after that i cant see image in App Designer view.
And second question:
App Designer cant use alpha... Yes, i can manualy set BGcolor like rgba(150,0,0,0.5) but in App Designer view i cant see result.
Can any one help me?
Sorry for my English))
Though I have not used App Designer, but following might help you:
put all your image files in app/assets/images folder
now set path in XML like image='/images/MainBG.png'
Set background color manually, you can use following combos:
you can use backgroundColor:"#fff"
also you can use backgroundColor:"#ffffff"
this one also works backgroundColor:"white"
this one works for alpha - backgroundColor:"#abcd", in this syntax, alpha will be 'aa' & r/g/b will be bb/cc/dd.
so this one will also work for alpha - backgroundColor:"#aabbccdd", 2 digits for each alpha/red/green/blue

Load multiple images from web directory in Objective C

I require a simple but potentially complex solution that I can't seem to find code that translates from Android for my iOS version APP.
I simply need a imageview grid such as shown here from a single web directory: https://www.youtube.com/watch?v=fIX4SnBLaZg
I have a working version on Android but can't seem to figure it out on Objective C.
My working version uses JSON to find each file in the directory and associated text, then simply adds each entry to the grid. The iOS version doesn't need to be as complicated if anyone has any examples?
Would anyone have any examples/snippets/APIs of implementing something like this into iOS?
Or even a simplified version such as only images from a directory. Simply have the thread read an entire folder from URL, file by file, and populate it in imageview's. Then once a user clicks on an image, simply view it full screen?
For your requirement you can use collection view . Please follow the below tutorial
uicollectionview-basic-tutorial
And to get images of jpg stored in bundle under folder named Images
NSArray *imagesOfjpgType = [[NSBundle mainBundle]pathsForResourcesOfType:#"jpg"
inDirectory:#"Images"];
To customize the cell to your design Please use the below code
https://stackoverflow.com/a/16579595/1142743
Also Please find sample from above tutorial which has a label below the image
https://www.dropbox.com/s/1uymyrwtx2yn9fs/RecipePhoto.zip?dl=0

Skobbler not picking up content from meta-folder in PreinstalledMaps (iOS)

I am trying to make an offline application with a bundled map. The map is running in SKConnectivityMode.Offline, so I have put the map data in: SKMaps.Bundle/PreinstalledMaps/v1/20150413/package
I have also copied the metadata into:
SKMaps.Bundle/PreinstalledMaps/v1/20150413/meta
The problem is that the data in the meta-folder is not picked up, and the map does not render. I tried to copy the meta-folder into the Library/Caches-location of a Simulator app, and then the map renders as expected.
A workaround I had in mind was to copy the meta-folder into the Library/Caches-area when the application is started the first time - but it will lead to double storage of files, and seems a bit dirty.
Any ideas what I might be doing wrong?
The version of the Skobbler API is 2.5.
I found a solution to the problem, with help from the API developers. The SKMaps.bundle was for some reason not being replaced in the application package by the build script, and I needed to run a Product->Clean from XCode.

xna published project without content pipeline?

I'm working on a personal project for learning purposes in XNA. I've read online that using the content pipeline requires people to have the xna runtime installed. So i've decided to load files using Texture2D.FromStream.
Everything is fine when I'm running the project from visual c#, but when I publish the project and run it, it crashed immediatly. I'm not sure if there is a way to see more info on the crash, but I assume not. I'm thinking it's down to not using the content pipeline.
When I look inside the application files for the published project I only see .xnb files. and no raw .png and .xml files that I'm using.
I tried to place the files in there manually but that didn't work aswell.
The files are all in the "Projectname\bin\x86\Debug\Content" folder.
Anyone has any idea?
edit
I have just rewritten my contentmanager so it uses the content pipeline, and the published project now works fine on my pc. So I have to figure out a way to get it to work without the content pipeline
if you work with Texture2D.FromStream, you have to care about two facts:
You have to change some resource's properties:
Compile action: None
Copy to result folder: Always
This way the xnb won't be builded and you will get your resources instead
You have to set the appropiate path, now you have not "bin\Debug" in your path.
As #Blau mentions, changing the image's properties will fix your problem. As you can see, the FromStream method is fully supported on the framework on all platforms now:
http://blogs.msdn.com/b/shawnhar/archive/2010/05/10/image-codecs-in-xna-game-studio-4-0.aspx.
As far as seeing errors ... you can always put a try catch around the statement that you think is throwing the error and then write out the error text to the screen so you can see it. Something like
try
{
//The offending code
}
catch(Exception ex)
{
WriteError(ex.Message);
}

Resources