[Q] URI Scheme help? - Windows Phone 8 Q&A, Help & Troubleshooting

I want to make a URI scheme favorite so that whenever you go to a YT video, you tap on the favourite and choose which app to open it with.
So far I've done this:
Code:
javascript:location.href="vnd.youtube:"
How do I code in Javascript so that it automatically copies the YouTube video ID and pastes it at the back of "vnd:youtube"?
I'm a noob at java sorry
Thanks

104082594999
I can't post links as I'm a new user, but google for "open with metrotube", it's already possible!
oh, and JavaScript isn't = Java.

Related

How can I make a simple game or app?

I've been programming for 3-4 years, about 1-2 of those years in C++(the rest in html, php, gml, js, and crapy stuff like dat). No Java, but I've heard its really easy to learn especially if you already know C++.
anyways, I've read the google tutorials and they haven't helped me since they make you download code instead of writing it (like the notepad tutorial).I've also seen all the videos that explain how android works, and I've read the stuff about it. I just want a tutorial that walks you through the process of programming an application.
basically what I want to learn is:
- How to tell if the user pressed a button, or interacted with a view
- draw an image to the screen
- open and close activities, like for a game you switch from the 1st level to the menu
- How to save data to a file, or database(whichever is best)
and things like displaying a list of items, or an alert and stuff like that.
I already setup eclipse and ran the Hello, Android application in the emulator AND my G1 with adb. So I just need to learn how to write the code
My goal(currently) is to make a picture on the screen move to the right when the user presses something(button, key, trackball, screen), but with my code, not cut & paste. I'll just turn that into a game later.
please help me with this, I've always wanted to develop apps for android(ever since I heard of it ). sorry if this sounds like a retarded question, but I've searched everywhere and I haven't found a good tutorial, and I cant buy a book
PS. I use the eclipse plugin for visually designing the layouts
http://java.sun.com/docs/books/tutorial/
I don't exactly remember from my HTML java applet days, but you can write straight to vm's frame buffer and write a simple program to change the position of the element scrolling it either way you want. Also, java input in html applets can be aided with javascript, so i used javascript to listen for user input and then have java respond to it, but that was over 10 years ago and I dont remember now T_T
really? thats helpful...
EDIT:
I've already read these tutorials on java: http://www.freejavaguide.com/corejava1.htm

Streaming mp4 from chrome with subtitles

Short information how to stream mp4 from chrome to chromecast with SUBTITLES.
1a) We download open source tools, libav from libavDOTorg. (optional)
Compiled Windows version in Download section.
Libav is available as package for some linux distributions.
1b) We download opensource free Subtitle Edit 3.3.8
wwwDOTnikseDOTdk
2) Convert mkv to mp4 (optional)
avconv -i input.mkv -codec copy output.mp4
3) Prepare subitles in VVT format
( FPS of mp4 can be checked:
avprobe output.mp4 )
(txt) SubTitle.exe /convert subs.txt WebVTT /encoding:utf-8 /fps:25
(srt) SubTitle.exe /convert subs.srt WebVTT /encoding:utf-8
4) We prepare HTML5 envelope index.html
Code:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<video src="FILE.mp4" controls preload="auto">
<track kind="subtitles" src="PLACE HERE LOCALHOST : 8080 / FILE DOT VTT" label="plsubs" srclang="pl-PL" default />
</video>
</body>
</html>
5) We start local webserver to serve directory with index.html, FILE.mp4 , FILE.vtt port 8080
( I use Mongoose one file, 45kb exec, can be any lightweight webserver)
It is necessary step. Chrome doesn't support local VTT file.
6) Open in chrome localhost:8080
P.S. I am new and cannot send web links so you have to adjust html5 example.
Enjoy
Thanks Miszak! I have to say, this was very helpful. The instructions are decently clear, but not super newb friendly for someone with no html/cmd prompt experience.
Do you know if there's any way to keep the formatting of the subs? Or just change it in some way to a default setting?
Right now they show with a white text and a black highlighted background. I'd be fine if there were just a black outline around the text though.
battlehamsta said:
Do you know if there's any way to keep the formatting of the subs? Or just change it in some way to a default setting?
Right now they show with a white text and a black highlighted background. I'd be fine if there were just a black outline around the text though.
Click to expand...
Click to collapse
I have heard that those subtitles can be styled using CSS style sheets.
If you would find some working example somewhere let me know. I will make some experiments.
I managed to do it.
It takes a bit of work (maybe too much to bother with doing) to add those styles.
Basically the tough thing is to use SubtitleEdit to edit your .vtt subtitles to add a <c> and </c> around each line of text. I used their multiple replace function and entered some regex to narrow down on what I need to wrap with classes. It seems this is necessary and there's no way to just designate a style for the whole file based on how webvtt works. (If you find out any other ways to do this easier, let me know)
This then allows you to use "::cue" in your css stylesheet likely linked in the header of your index.html file. Make sure to direct to the right .css file src of course. Lots of online resources how how to use this.
After that, just style however you want the text, like to remove the black background around the text, use "background-color: transparent;".
I hope there will be easier ways to use subtitles in the future.

Complete tool looking for tool

Hi, just DL'd Studio, playing with it, I get the basics. I'm good with html and web code, new to Java.
Q: I want to build a simple text adventure game. Read a screen, make choices, each button loads next relevant thread/storyline. I could do this in html fast, but am stumbling on the console.
Is there a set of templates, projects, themes, a repository of existing framework/hierarchy that I could use as a base? Or do I need to go through and create every individual "page", the buttons, link them up etc.
Thank you very much.
You could try inklewriter, I believe that you can export your projects a couple different ways:
https://writer.inklestudios.com

Send data to multiple activities

Hello,
I am new to android studio and java in general. I was wondering If there is an easy way to send data from one activity to multiple activities.
On my first activity the user will enter some text. I want this text to be displayed on the second activity as well as on a summary page(my 6th activity).
I have figured out how to have the text go from activity 1 to the second activity. But I cannot figure out how to make it show up on the summary page as well. Anyone have any advise?
Thanks in advance!
NewtoStudio said:
Hello,
I am new to android studio and java in general. I was wondering If there is an easy way to send data from one activity to multiple activities.
On my first activity the user will enter some text. I want this text to be displayed on the second activity as well as on a summary page(my 6th activity).
I have figured out how to have the text go from activity 1 to the second activity. But I cannot figure out how to make it show up on the summary page as well. Anyone have any advise?
Thanks in advance!
Click to expand...
Click to collapse
You should use some permanent storage. In Android it's a lot ways to save the data: simple file, preferences, database, content providers and others.
I think for you case can be appropriate use the preferences. You need to write the preferences in one activity and read in another. Please see the following code example in Kotlin for details.
In order to write the preferences:
Code:
with(getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE)) {
edit().putString(MY_MSG, "your message text").apply()
}
In order to Read preferences from destination activity:
Code:
with(getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE)) {
mString = getString(MY_MSG,"");
}

Slide from one html page to another

Hi
I am making an android book app with java using one web view and my pages in html files.
I created an assets folder , under src- main and store my pages in there
Now all I'm missing is a navigation method.
As I am new to this, I am trying to find how to slide from one html page to another instead of clicking buttons. please if you know how , set an example because like I said I am new to this.
here is a link to the app I made if you want to have a look(its very small for testing purposes, with 3 pages).
https://github.com/Philip2021-Gr/book-app-sliding-between-html-files
So far no one gave me any reliable answer that refers to a rookie like me in coding nor I find a video tutorial that saws how to do that with html pages that are stored in your assets folder.
Thank you in advance
Philip

Categories

Resources