[Solved] Help starting B&N standard Reader from Android Launcher - Nook Touch Android Development

Hi, I am trying to start B&N Reader app from ADW (or any other launcher...).
I found the 'am' command that should be able to send an intent to an app but, being an absolute beginner with Android coding and its inner working I am not able to use it as I want.
What I am doing is:
Code:
# am start -a android.intent.action.VIEW -n com.bn.nook.reader.activities/.ReaderActivity
but, while it doesn't give any error, it doesn't do anything ...
As I told before, I am an absolute beginner with this stuff, so I could have totally misunderstood everything.
Any hints?

If you look into the AndroidManifest.xml the answer is simple enough
Code:
am start -a android.intent.action.VIEW -d file:///media/Digital\ Editions/George_R_R_Martin_-_A_Dance_Wit.epub -t application/epub -n com.bn.nook.reader.activities/.ReaderActivity

ros87 said:
If you look into the AndroidManifest.xml the answer is simple enough
Code:
am start -a android.intent.action.VIEW -d file:///media/Digital\ Editions/George_R_R_Martin_-_A_Dance_Wit.epub -t application/epub -n com.bn.nook.reader.activities/.ReaderActivity
Click to expand...
Click to collapse
If you know how to read it, yes It was the second/third AndroidManifest I look at...
Any hope to launch it without an explicit book and make it open the last one, as it does when you tap on the "reading now "icon in the status bar?

...lol. I'm spending so much time just with the hacking that I haven't gotten around to reading ADWD

met67 said:
Any hope to launch it without an explicit book and make it open the last one, as it does when you tap on the "reading now "icon in the status bar?
Click to expand...
Click to collapse
No, not directly in Reader, but you can do it like this:
Code:
am broadcast -a com.bn.nook.launch.LAST_BOOK -n com.bn.nook.home/.HomeBroadcastReceiver

ros87 said:
No, not directly in Reader, but you can do it like this:
Code:
am broadcast -a com.bn.nook.launch.LAST_BOOK -n com.bn.nook.home/.HomeBroadcastReceiver
Click to expand...
Click to collapse
NICE! It works, thank you so much!
Now, any suggestion for a GScript alternative to launch this command with less flickering?

met67 said:
NICE! It works, thank you so much!
Now, any suggestion for a GScript alternative to launch this command with less flickering?
Click to expand...
Click to collapse
Why GScript? What are you trying to do?

met67 said:
Hi, I am trying to start B&N Reader app from ADW (or any other launcher...).
I found the 'am' command that should be able to send an intent to an app but, being an absolute beginner with Android coding and its inner working I am not able to use it as I want.
What I am doing is:
Code:
# am start -a android.intent.action.VIEW -n com.bn.nook.reader.activities/.ReaderActivity
but, while it doesn't give any error, it doesn't do anything ...
As I told before, I am an absolute beginner with this stuff, so I could have totally misunderstood everything.
Any hints?
Click to expand...
Click to collapse
I can build you an app that will send broadcast.
Sent from my SAMSUNG-SGH-I777 using xda premium

ros87 said:
Why GScript? What are you trying to do?
Click to expand...
Click to collapse
I want a button/widget/big icon in adw home that launches the last book, Ala the Reading Now box in B&N home.
I found Manual Intent Shortcuts, will try it tomorrow ...

XorZone said:
I can build you an app that will send broadcast.
Sent from my SAMSUNG-SGH-I777 using xda premium
Click to expand...
Click to collapse
Thank you for your offer, but Manual Intent Shortcuts works just fine
Actually I'm trying to out together a poor man's implementation of your dedicated launcher

met67 said:
Thank you for your offer, but Manual Intent Shortcuts works just fine
Actually I'm trying to out together a poor man's implementation of your dedicated launcher
Click to expand...
Click to collapse
Oh well, I had already written the app (shortcut)
http://www.multiupload.com/I2SW3LSI4B
Feel free to use it as you want.
---------- Post added at 10:52 PM ---------- Previous post was at 10:07 PM ----------
Also forgot the source:
Code:
package com.bitloom.nst.readingnow;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
public class ReadingNowActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent broadcastIntent = new Intent();
broadcastIntent.setAction("com.bn.nook.launch.LAST_BOOK");
sendBroadcast(broadcastIntent);
finish();
}
}

Related

static route

Anyone know of a way to set a static route in wm6.5 in XP its done by typing this in a command line
"route add -p xxx.xxx.xxx.xxx MASK 255.255.255.255 xxx.xxx.xxx.xxx."
You have to use iphelper APIs:
GetIpForwardEntry
CreateIpForwardEntry
SetIpForwardEntry
stepw said:
You have to use iphelper APIs:
GetIpForwardEntry
CreateIpForwardEntry
SetIpForwardEntry
Click to expand...
Click to collapse
Whats the name of one of those apps that have those features?
There's no good app for this. You can get console IP tools (including route.exe) from Microsoft, but you will also need a console software to make use of it.
See
http://www.tomshardware.com/forum/21869-36-manipulate-routing-table-windows-mobile-2003
for other possible solutions.

[Q] Dynamic UI Creation XAML, C#

this is my first post. I am pretty desperate at the moment.
I would like to dynamically create the UI for the WP7 based on a CSV file in Isolated Storage. right now I would settle for just being able to write the UI in XAML from the code behind in C#.
steps that I would like to execute:
1. user clicks a muscle group button which passes a value to another page-done
2. users data is pulled from CSV file and placed in array for easy storage-done
3. for each data element create a XAML TextBlock with the data which is displayed in the UI <-- need some serious help
best I can do is show the XAML code with the <> tags as a string in the UI.
is what I am asking possible?
Thanks for helping.
Knudmt said:
this is my first post. I am pretty desperate at the moment.
I would like to dynamically create the UI for the WP7 based on a CSV file in Isolated Storage. right now I would settle for just being able to write the UI in XAML from the code behind in C#.
steps that I would like to execute:
1. user clicks a muscle group button which passes a value to another page-done
2. users data is pulled from CSV file and placed in array for easy storage-done
3. for each data element create a XAML TextBlock with the data which is displayed in the UI <-- need some serious help
best I can do is show the XAML code with the <> tags as a string in the UI.
is what I am asking possible?
Thanks for helping.
Click to expand...
Click to collapse
Sounds like what you really want to do is dynamically create controls in the code-behind. I would forget about generating "XAML".
Code:
private void AddTextboxesFromCSV(string[] CSVData) {
foreach(string str in CSVData) {
TextBlock tb = new TextBlock();
tb.Name = "txtUserSelectedValue" + CSVData.IndexOf(str);
tb.Text = str;
<YourObject>.Controls.Add(tb);
}
}
Where <YourObject> is the object you want to place the controls into, some sort of layout Panel.
Thanks for the response
I think that is the direction I will be going. Just out of curiosity do you know if what I wanted to do is even possible?
UN app for WP7 does something like this. Go to http://unitednations.codeplex.com/releases/view/57722 and grab the source. Open the source in Visual Studio and browse to the "Framework" folder and open up "BasePage.cs". At the bottom there's a method called AddNavigatingText() that does what I think you are looking to do.
Here's the method:
Code:
protected Grid AddNavigatingText()
{
var NavigatingText = (Grid) XamlReader.Load(
@" <Grid xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" Height=""30"" VerticalAlignment=""Top"" Background=""#CCFFFFFF"">
<TextBlock HorizontalAlignment=""Left"" TextWrapping=""Wrap"" Text=""Navigating..."" Width=""129"" FontSize=""{StaticResource PhoneFontSizeNormal}"" Margin=""24,0,0,0"" FontFamily=""{StaticResource PhoneFontFamilySemiBold}""/>
<ProgressBar Style=""{StaticResource PerformanceProgressBar}"" RenderTransformOrigin=""0.5,0.5"" Margin=""135,0,0,0"" UseLayoutRounding=""False"" Background=""White"" IsIndeterminate=""True"" LargeChange=""0"" />
</Grid>");
this.Content.As<Grid>().Children.Add(NavigatingText);
return NavigatingText;
}
Thanks for the reply. Looks pretty simple. I downloaded the source and signed up for codeplex. However I can not connect to the tfs.codeplex.com
It's not possible to use dynamically created XAML; code is the way to go and much easier IMHO.
When you open the project just hit cancel at the login screen and it will load.
sulphuricaciduk said:
It's not possible to use dynamically created XAML; code is the way to go and much easier IMHO.
Click to expand...
Click to collapse
Agreed, doing it via code with a very basic XAML based page is likely to be faster, and will actually work. It's also a lot easier to fix things than trying to work out what went wrong in XAML you can't see...
I would agree with the statement that creating the controls dynamically would be faster. And def a great deal easier to read It just bugs me when I know this can be accomplished, yet I cant get it to work
Blade0rz said:
Sounds like what you really want to do is dynamically create controls in the code-behind. I would forget about generating "XAML".
Code:
private void AddTextboxesFromCSV(string[] CSVData) {
foreach(string str in CSVData) {
TextBlock tb = new TextBlock();
tb.Name = "txtUserSelectedValue" + CSVData.IndexOf(str);
tb.Text = str;
<YourObject>.Controls.Add(tb);
}
}
Where <YourObject> is the object you want to place the controls into, some sort of layout Panel.
Click to expand...
Click to collapse
Well that worked very well, thanks! I am having a little formatting issue .. my textblocks show up right on top of each other. any ideas?
Thanks again
Knudmt said:
Well that worked very well, thanks! I am having a little formatting issue .. my textblocks show up right on top of each other. any ideas?
Thanks again
Click to expand...
Click to collapse
I solved this silly issue. just added a listbox control to the xaml front end and added my elements with an ugly cast
listbox1.items.add((TextBlock)myBlock);
Knudmt said:
I solved this silly issue. just added a listbox control to the xaml front end and added my elements with an ugly cast
listbox1.items.add((TextBlock)myBlock);
Click to expand...
Click to collapse
If you had a StackPanel as the parent control, you could have each new textblock stacked...

[q] xml-rpc & wp7.

In my search to find out a good way (or any way) to post comments on a wordpress article using C# on windowsphone, someone suggested looking into XML-RPC.
Ive done a search & it looks like the right lines, but I have no idea how to actually use it.
Anyone fancy giving me a little example or some sort of push in the right direction about how I can use XML-RPC in my WP7 app.
cris_rowlands said:
In my search to find out a good way (or any way) to post comments on a wordpress article using C# on windowsphone, someone suggested looking into XML-RPC.
Ive done a search & it looks like the right lines, but I have no idea how to actually use it.
Anyone fancy giving me a little example or some sort of push in the right direction about how I can use XML-RPC in my WP7 app.
Click to expand...
Click to collapse
XML-RPC is just reading/writing XML. You could easily just use the built-in Xml classes to build your XML, then use the WebClient to post/receive it from the server. You can use the spec from here to see what XML needs to be generated:
http://www.xmlrpc.com/spec
I don't know of any complete libraries for Windows Phone 7 right now, but you can check this out to get you started:
http://xml-rpc.net/
I've used this silverlight lib called xmlrpc-silverlight. It can be found on google code.
It works perfectly on wp7.
Best regards,
Mateusz
emfor said:
I've used this silverlight lib called xmlrpc-silverlight. It can be found on google code.
It works perfectly on wp7.
Best regards,
Mateusz
Click to expand...
Click to collapse
This will come in handy for one of my projects also, thanks for this!
emfor said:
I've used this silverlight lib called xmlrpc-silverlight. It can be found on google code.
It works perfectly on wp7.
Best regards,
Mateusz
Click to expand...
Click to collapse
Thanks
I found this here: http://code.google.com/p/xmlrpc-silverlight/
But it doesnt seem to have any downloads or code to actually use
Dont suppose you have a copy of it still?
I have too few posts... On the page, go to "Source" tab, than "Browse" and in the "trunk" folder there is file XmlRpc.cs - that's it!
Best regards,
Mateusz
thank you thank you thank you
Found it! Now Im gonna play with it a bit & see if I can get this working ;D
Well, Ive played with it a bit & I think I understand some of it, but I really have never used XML-RPC before & cant get it to work
Any chance you could give me a hint as to how I could post a comment to (for example) this page: http://www.1800pocketpc.com/2011/02/03/fireworks-an-amazing-free-app-for-windows-phone-7.html
Its just a random post from the site Im creating the app for.
On the wordpress page about XML-RPC it says this:
wp.newComment
Create new comment.
If you want to send anonymous comments, leave the second and third parameter blank.
Parameters
■ int blog_id
■ string username
■ string password
■ int post_id
■ struct comment ■ int comment_parent
■ string content
■ string author
■ string author_url
■ string author_email
Return Values
■ int comment_id
Click to expand...
Click to collapse
Sadly Im not quite sure what to do with that. Plus I havent a clue what the "blog_id" or "post_id" would be :/
Ive been coding for 4 years & I still feel like a total newbie half the time >_<
I think something like that shoud work:
Code:
XmlRpcService service = new XmlRpcService("Url_to_the_service");
XmlRpcRequest req = new XmlRpcRequest(service, "wp.NewComment", new object[] {
1,
"UserName",
"Pass",
1,
?,
1,
...
});
req.XmlRpcCallCompleteHandler
+= new XmlRpcCallComplete(req_XmlRpcCallCompleteHandler);
req.Execute(null);
generally this should work. There is an struct element, so you should implement this struct in C# and pass it there...
I don't know WP so i can't help with parameters meaninig...
Good luck!
Best regards,
Mateusz

[howto] get Orbot (Tor network) transparent proxying working

*REQUIRES ROOT*
Warning: Follow these directions at your own risk! I take no responsibility for any damage to your phone, personal information, dog, cat, or grandmother that may result from you voluntarily following these directions. If you blame me, I will laugh at you.
This information is partially from: http://forum.xda-developers.com/showthread.php?t=760472
This is my first topic post, so please let me know if you find it helpful!
I could not find a tutorial on getting Orbot transparent proxying to work on my SPH-D710, so this is how I got it working. I hope this is not a repost, but as I said I could not find a specific tutorial/howto.
It seems to me that the issue with Orbot on our phones has to do with the iptables that is included with Orbot. Even if you tell Orbot to use the default iptables (/system/bin/iptables), it still does not work.
(1) Install "Droidwall" and "Orbot" from the Android market.
(2) Open Droidwall so that it installs the necessary binaries.
(3) Do the following in adb or the terminal: (I prefer using adb)
Code:
[B]# cd /data/data/[/B]
[B]# find ./ -iname "*iptables*"[/B]
./com.mgranja.iptables
./org.torproject.android/app_bin/iptables
./com.googlecode.droidwall.free/app_bin/iptables_armv5
[B]# cp ./com.googlecode.droidwall.free/app_bin/iptables_armv5 ./org.torproject.android/app_bin/[/B]
[B]# cd /data/data/org.torproject.android/app_bin/[/B]
[B]# mv ./iptables ./iptables.ORIGINAL[/B]
[B]# mv ./iptables_armv5 ./iptables[/B]
(4) Open Orbot and go to (menu) -> Settings. Make sure to enable "Request Root Access," "Transparent Proxying" and "Tor Everything."
(5) On the bottom of the settings page, ensure that "Use Default Iptables" is NOT selected!
(6) Open Orbot, long press the 'power' button to start Tor. In the menu there is an option to make sure ("check") that you are connected through the Tor network.
Enjoy!
Sent from my SPH-D710 using Tapatalk
IPTABLES is your firewall.
So I wouldn't mess with them unless you know what you are doing.
You sound like you don't know what your doing if you have to "download" it.
kthejoker20 said:
IPTABLES is your firewall.
So I wouldn't mess with them unless you know what you are doing.
You sound like you don't know what your doing if you have to "download" it.
Click to expand...
Click to collapse
I agree that you shouldn't mess with it unless you know what you're doing. The app mentioned simply updates the version in /system/bin that came with your ROM -- whether or not you want to do this is up to you. (I just edited and removed the portion you made reference to.)
Regardless, in order to get Orbot working on the phone with transparent proxying, the main thing is to tell Orbot to use the default iptables in the ROM rather than the one Orbot comes with (/data/data/org.torproject.android/app_bin/iptables).
EDIT: With the edits made to my original post, this is now irrelevant.
I use to do this back in the day. At times it's handy however, the speeds are insanely slow so I stopped using it and just dealt with the fact that the carrier would see my every move on the network. They can do that regardless of the fact that you're using a proxy anyway so it just seemed like a waste. Slow speeds + they can still track me or fast speeds + they can still track me. Using Tor on a phone only prevents the site you're visiting from knowing who and where you are - not the carrier.
Just wanted to make that clear for anyone that doesn't know.
The speed is definitely a pain, but if you are willing to sacrifice some anonymity (probably a lot) you can configure Tor to only use nodes within your country - which I tested and got much faster speeds.
While your carrier can track that you are using their network, they cannot see what specifically you are doing. Tor encrypts all traffic from your phone -> entrance node -> intermediary nodes -> exit node (and vice versa). The only unencrypted leg of the journey is between the exit node and the destination host.
If anyone wants to read more https://www.torproject.org/about/overview.html.en
Sent from my SPH-D710 using Tapatalk
working
This worked for me, thank you so much. im runing a modded stock rom on my Lg Optimus black and it hasnt iptables, now everithing is fully working, thanks! now i can use facebook from mi phone on my work "restricted" network hehe
tor
You can also run tor from the terminal and from /data/data/*. It's much easier and you can delete all the iptables and orbot stuff. The default datadir for tor isn't working so I started tor with -datadir. For example tor -datadir /mnt/sdcard/tor.
Thank you I have been trying to get this running on my phone for a second.
Phpdna said:
You can also run tor from the terminal and from /data/data/*. It's much easier and I have deleted all the iptables and orbot stuff. Because the default datadir for tor isn't working on my device I started tor with -datadir. For example tor -datadir /mnt/sdcard/tor.
Click to expand...
Click to collapse
What are you doing exactly?
Can You explain more?
santasolo said:
What are you doing exactly?
Can You explain more?
Click to expand...
Click to collapse
I was trying to run tor without orbot. Orbot is too heavy for my mobile. I find tor is an app in /data and we can start it from the terminal with the datadir switch. I guess Orbot works, too, but I'm not so sure.
Very interesting post. Thanks for the info.
DankVader said:
Very interesting post. Thanks for the info.
Click to expand...
Click to collapse
If my answer is helpful please consider to thank me. Thank you!
I thought I did. But I must have forgotten to. Correcting that now. :victory:

URIs for URI Launching items

This is an expansion on this thread
Pre-requisites
URI Launcher
Knowledge of URI Schemas
Now, if you haven't already, download URI Launcher.
For most MS Settings subitems, the schema goes like so
ms-settings-bluetooth:
ms-settings-mobilehotspot:
Seeing a pattern yet? It's ms-settings-<item name in lowercase without spaces>
So far, those are the only items that I've added to my URI Launcher.
Since I'm unable to know all of the possible URIs that MSFT uses in Windows 10 Mobile or below, I implore other users here to reply below with URIs they know of or ones they use themselves and I will attempt to edit this OP with an updated list as it grows.
http://forum.xda-developers.com/windows-10/windows-10-mobile/equaliser-pinned-to-start and others apps from store with uri definitions.
EDIT: uri can be launched from edge.
HKCU\Software\Classes
There are a lot of uri definition.
Can this URI Launcher parse URL and open the right app automatically? Like YouTube links to MyTube, Facebook to Facebook app.
@SammaelAkuma https://msdn.microsoft.com/en-us/windows/uwp/launch-resume/launch-settings-app
augustinionut said:
HKCU\Software\Classes
There are a lot of uri definition.
Click to expand...
Click to collapse
They gone on build 10.0.15213.0
This may be the reason why this command in edge ms-cortana://Reactive/?StartMode=Reactive&ListeningMode=True
result in this command ms-cortana//Reactive/?StartMode=Reactive&ListeningMode=True and don"t execute.
augustinionut said:
They gone on build 10.0.15213.0
This may be the reason why this command in edge ms-cortana://Reactive/?StartMode=Reactive&ListeningMode=True
result in this command ms-cortana//Reactive/?StartMode=Reactive&ListeningMode=True and don"t execute.
Click to expand...
Click to collapse
OMG thank you for this sooo much for posting this! I was looking for a way to launch cortana in listening mode for my app!
This Uri does work in the Creators Update by the way
And the app is.......?
augustinionut said:
And the app is.......?
Click to expand...
Click to collapse
Track Goals: https://www.microsoft.com/store/apps/9NBLGGH52RSB

Categories

Resources