Linking one xml to another xml using ImageButton in Eclipse ADT? - eclipse

I am new to Android App Development and i am using Eclipse ADT. Basically I made my Home page for my app and my problem is I don't know how to link one xml file to another xml file. What i want to happen is, When I click the "Payment" on my homepage (Please refer to the screenshot..) I want it to redirect to another page (specifically on the 2nd screenshot). Please help me and I am having a hard time. I'm starting from scratch. :(( The "Payment" Button is an IMAGEBUTTON.
Btw. The homepages xml name is activity_main.xml and i want to redirect it to payvia.xml (Blank XML file). I just want to know how to do it. I know theres something to edit on the MainActivity.java and in the AndroidManifest.xml
Please I need your expert advices.
I cant attach screenshots because i lack reputation pts.

Oh man. You have to make two activity. One for your activity_main.xml and one for your payvia.xml . And after you have made the activity than you define your button on your main activity and set a Intent and say when you click the button then open a new intentand that new intent will be the second activity. I hope you have solved it till now. otherwise tell me again. Anyway it is the basic thing of building apps on eclipse.

Related

K2: How may I open a file in a new window unless I already have such a window open?

I have a K2 Smartform that displays a list of file names. When the user clicks a file name, the program opens that file (all of them are PDFs) in a new tab in the browser (IE). This is good so far. If you click on a second file from the list, it opens in a third tab. That is not what the user wants.
They want the second file selection to open in the same window as the first file.
This is the process I can see:
Click on the file in the list.
Open in a tab.
Click on a second file in the list.
If there is already a tab open with a file from the list, open this file there. Otherwise, open a new tab for the file.
I suppose automatically closing the first tab when they click on the second file would accomplish the same thing.
How can this be done?
When you deal with opening links, first of all, what you can do is limited. Indeed, browsers (IE, Chrome, etc...) can be configured by the users to open links in new tabs, windows, etc... and you as form developer cannot change that.
I have made a jsfiddle to reproduce your situation and propose a solution you can test. I don´t guaranty it will work as I use a Mac but I also describe a better solution below.
You can find it here:
https://jsfiddle.net/chevdor/45k40npv/
I guess the first example (#1) is what happens for you at the moment.
Using the 'target' attribute, I tried to implement a solution that may work for you. Click on #2 and #3 and check whether this work.
I cannot test that since I use a Mac.
You can read more about the target attribute here:
http://www.w3schools.com/tags/att_a_target.asp
Another solution that would give you more control is to use an iFrame control. I think it comes in standard with SmartForms now. If not, you can for sure get it from the community site. I recommend you create a new View with this iFrame and define one parameter (string) called "url".
Let´s speak in K2 rules languages :)
"When the parameter changed", "and the parameters is defined", if you 'Transfer data' passing your URL to the iFrame control, it will display your doc. If the user clicks another document, it will update the SAME iFrame. With this solution, no tab will ever be involved.
Please note that it will work great for any document supported by your browser. Some types may require a plugin. Other documents (ie zip, etc..) will NOT appear but be downloaded instead.
I hope this helps.
Best regards,
-chevdor

Page Navigation in GWT Application

I want to navigate to another page in my application. I don't want the page to reload(i.e.. application should be a single URL application).
I know only one way to accomplish this by changing the proper div attached in the RootPanel by whatever data I want to display. But I fell that might get cumbersome if there are many navigations(I haven't tried it though :P).
Is there any other way to accomplish this or make the above said approach better?
Thanks in advance.
I guess you need GWT Development with Activities and Places
Well ,its time to have a look on MVP
With that you can do
History.newItem(tokenOfYourPresenterScreen);
A nice single EntryPoint demo app is here : (BrowserHistoryExample.java)
http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsHistory.html
I added the below to the example to demonstrate links.
vertPanel.add(new Label("Access history via Hyperlinks"));
vertPanel.add(new Hyperlink("External Page 0","page0"));
vertPanel.add(new Hyperlink("External Page 1","page1"));
vertPanel.add(new Hyperlink("External Page 2","page2"));

Open MWPhotoBrowser with a link and loop

I'm fairly new at iOS development so please forgive my ignorance.
I have web view with a search form, sending request to display different pages depending on the search query. When displaying a selected page I want to have a normal html link at the top which will give the user the possibility to display all images available using the very nice MWPhotoBrowser.
So somehow I need to tell Xcode to open MWPhotoBrowser using a link and when this link is pressed send a variable to MWPhotoBrowser and in that viewController somehow loop through a my url.com/variable.
Is this the best way to do this and is it even possible? I have searched as much as possible but I'm not sure what to look for so I would really appreciate if you could point me in the right direction.
Judging from this link at github project it should be fine.

How to build web clips like http://brdrck.me/settings/

I am very interested in building an app like http://brdrck.me/settings/. My first questions are what is inside a web clip file? Is it a html or something else? The second question is how to add the icon to home screens programmatically. As you can see from the page I mentioned above http://brdrck.me/settings/. I tried to check its source code from browser but it turns out to be some normal CSS and javascript code in my Chrome browser and I don't know how to check the source in my Mobile Safari. Any one help?
You won't be able to get any valuable code from the source. Trust me. :D
But, I can help you out.
I use two different methods: The "Add to Homescreen" and .mobileconfig files (the one you have to install)
For adding to the homescreen check out this resource. With the help of some creative work-arounds, it isn't too difficult.
http://mobile.tutsplus.com/tutorials/iphone/iphone-web-app-meta-tags/
The mobileconfig file is a bit more difficult, esp trying to get it signed, but this might help you a bit. Try to create one with a webclip then view the generated files source: http://support.apple.com/kb/DL1465
Hope this helps.

Access to hyperlink in a pdf(iPhone)?

I am working on a small app, which can open a pdf. My question is, if it is possible to access a hyperlink from a pdf? Because when am trying to click on hyperlink nothing is happening and it's not redirecting me to the link. I tried searching a lot but didn't got any luck on this. Am expecting a quick response as my work is getting delayed because of this issue. If it's possible then what would be the approach? Right now am using UIWebView to open the pdf. Any sample app or code will be of great help.
Thanks for your time .
The only way I know is to use a third party library (or perhaps parse the PDF yourself), find the links, get their rects and catch user taps and compare that to the list of link/hyperlinks/gotos for that particular page.
Unfortunatelly - nothing in the SDK that can help. You can search for a opensource pdf library, like muPDF for instance.
There is a reason why not many applications have that functionality :D