2017년 6월 16일 금요일

How Block screen ? (Without interrupting the app)


Is it possible to have your smartphone turn off the screen while the app is running? Using the proximity sensor?

And apps created with app inventor work in the background?

My goal is to develop an application that turns off the screen using the proximity sensor ... and work in the background ... use this function to be useful in other applications in android ...

--
Currently, background services not available in MIT AI.
Apps are-not services. This means if you turn off screen, Android may kill the appwhen it requires memory.

--

activate a link from a google spreadsheet


Dear all, i have an spreadsheet some some links there. I want to get these links from my app and activate the link. So i f the link is a link to a google photo album, i want to open this photo album from the app. and the addres must be taken from a google spreadsheet cell.

--
Does the spreadsheet have to remain private?

Could you create another sheet and use importrange() to bring the links across?  (make public and protect the importranges cells)

If so just open up that sheet in a webviewer, and click the links. You could format this sheet to work well in the webviewer

The alternatives will mostly require you to sort out authentication, following the requirements for using Google Sheets as a database (search the forum for this).

Once you have the data (links) in your app, just create a list and listpicker to recall a link and use the activitystarter to open in the on board app

-- 

search results for How to start Whatsapp/send a message with Whatsapp


How to start Whatsapp/send a message with Whatsapp. Taifun.
How to start Whatsapp/send a message with Whatsapp. Taifun.
How to start Whatsapp/send a message with Whatsapp. Taifun.
How to start Whatsapp/send a message with Whatsapp. Taifun.
... awesome app, share also something depending on your app via Whatsapp. hope that helps. How to start Whatsapp/send a message with Whatsapp.
How to start Whatsapp/send a message with Whatsapp. How to send an eMail. Different eMail solutions for App Inventor. Taifun.
these are the only possibilities currently. How to start Whatsapp/send a message with Whatsapp Taifun.
How to start Whatsapp/send a message with Whatsapp. Taifun.
see the documentation about Using the Activity Starter. see also some examples, for example How to start Whatsapp/send a message with Whatsapp.
... /groups.google.com/forum/#!searchin/mitappinventortest/How$20to$20start $20Whatsapp$2Fsend$20a$20message$20with$20Whatsapp%7Csort: ...
see here for the correct class. How to start Whatsapp/send a message with Whatsapp. Taifun.
Different eMail solutions for App Inventor. what is possible using Whatsapp see here How to start Whatsapp/send a message with Whatsapp. Taifun .
How to start Whatsapp/send a message with Whatsapp. Taifun.
How to start Whatsapp/send a message with Whatsapp. Taifun.
How to start Whatsapp/send a message with Whatsapp. Taifun.
see here: SQlite Extension to access the local SQlite database. How to start Whatsapp/send a message with Whatsapp. Taifun ...
... launch Waze to look for a specified location. How to start a Skype call. How to start OsmAnd. How to start Whatsapp/send a message with Whatsapp.


How to send whatsapp message to a specific mobile numbers???


I have already tried it anyway and I still have not found a right way to send msg by whatszap app to a specific contact, could you help me please?
I tried the model below but without success.

--
How to start Whatsapp/send a message with Whatsapp
whatsapp.aia
whatsapp2.aia


It does not look like you have used the forums yet, as a search using the search box above would have returned several threads about this topic.

Advice: Before posting, it's a good idea to search in this forum. Many others have likely run into problems similar to yours. How to search see screenshot.
Hello I checked the forum and no answer was objective and certain, so far I could not find anyone that solves this problem

--

Sending message through WhatsApp By intent


How I can send massage from my app to Special number in whatsapp , I know this code to share massage to group or contact on whatsapp
Intent waIntent = new Intent(Intent.ACTION_SEND); waIntent.setType("text/plain"); String text = "Sorry For Interruption,I'm Just Trying Something"; waIntent.setPackage("com.whatsapp"); if (waIntent != null) { waIntent.putExtra(Intent.EXTRA_TEXT, text);// startActivity(Intent.createChooser(waIntent,"Share with"));
but I want send massage to Special number like "966xxxxxxx" how I can do that ?

--
this is a Solution :
private void openWhatsApp(String id) { Cursor c = getSherlockActivity().getContentResolver() .query(ContactsContract.Data.CONTENT_URI, new String[] { ContactsContract.Contacts.Data._ID }, ContactsContract.Data.DATA1 + "=?", new String[] { id }, null); c.moveToFirst(); Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse( "content://com.android.contacts/data/" + c.getString(0))); startActivity(i); c.close(); }

--
you can use this code for sending data to perticuler a number
void openWhatsappContact(String number) { Uri uri =
Uri.parse("smsto:" + number); Intent i = new Intent(Intent.ACTION_SENDTO, uri); i.setPackage("com.whatsapp"); startActivity(Intent.createChooser(i, ""));}
thats really works for me enjoy your code:)
--

how can I integrate WhatsApp with my app?


I'm an Android developer, how can I integrate WhatsApp with my app?
There are two ways to integrate with WhatsApp:
-Through a custom URL scheme 
-Through Android's intent system.
Custom URL Scheme
WhatsApp provides a custom URL scheme to interact with WhatsApp:
If you have a website and want to open a WhatsApp chat with a pre-filled message, you can use our custom URL scheme to do so. Opening whatsapp://send?text= followed by the text to send, will open WhatsApp, allow the user to choose a contact, and pre-fill the input field with the specified text.
Here is an example of how to write this on your website:
Android intent system
Like most social apps on Android, WhatsApp listens to intents to share media and text. Simply create an intent to share text, for example, and WhatsApp will be displayed by the system picker:
Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send."); sendIntent.setType("text/plain"); startActivity(sendIntent);

However, if you prefer to share directly to WhatsApp and bypass the system picker, you can do so by using setPackage in your intent:
sendIntent.setPackage("com.whatsapp");
This would simply be set right before you call startActivity(sendIntent);
Similarly you can use Android's intent system to send media through WhatsApp, once again, using setPackage to restrict the package to WhatsApp if you only want to send to WhatsApp. Check this developer page for more information.
Cheers, 
WhatsApp Support Team


Draw App(color picker tool from separate pallette/canvas, Load/Save image issue)


Hi all, I'm back. Resolved the issue with canvas getting blurry with each drawing touch.

Next things that need implementation are:
Loading a photo from Gallery, problem here is that after selecting the photo, it doesn't automatically go back to the app, it remains in the gallery.
Saving is done horribly. You cannot find them in Gallery or in a newly created folder with app's name.

Color picking. Thought it would be best if there are 2 options to choose color.
One where you click on a pick color tool/button. As you hover/drag your finger across the canvas, the pixel color you are touching should be shown in a small window. Clicking a ''Confirm color selection'' button would select the colour.

The other method should  be about the same but you get to choose from a palette if you swipe the screen to the left.

Cheers and thanks guys again for helping me get so far with this little project!
I've attached the .aia file.


--
Anyone? Help please

--
bump

-- 
Post an image of your relevant blocks please.
You say after the image is picked, it stays in the gallery. Check what you put inside the after picking event.

There's an extension from Taifun to solve the gallery refresh bug. Yes it's an Android bug. Get the extension here: http://puravidaapps.com/tools.php

You can try using the flung event, detect where the flung started and its direction. If all matches the gesture you want, then show a hidden arrangement that contains a palette.



--
First picture is from Screen1, second from Screen2

I'm trying to import the extension but I do not know how, the tutorial doesn't say how to do it. I have the code but need it in aix file or a proper url, I have none of those.








-- 
help please?

-- 
Where's the AfterPicking event?

-- 
Extension:

Download the aix file from Taifun's website.
In App Inventor 2 go here:



-- 
Thanks. I've gotten that far but when I click Import Extension is where it gets confusing
That's the Gallery Refresh code,  how do I get as an url or aix file?

Attached the afterpick event aswell






-- 
Why do you open the gallery AFTER you picked an image? Take that block out of there (the call LoadPicture open block). The image is already loaded, you are opening the gallery again.

That is not the extension. That is the source code. Download the .aix file. The link is the first one at the bottom of the page together with the other links.

-- 
Oh so stupid of me.
Thanks. Loading works good now!
Not sure where I put this block?




-- 
Put that block right after the image is saved. You have to specify the filename in it and until you don't have a file saved, you can't possibly update the gallery to show it.


--
Doesn't work. Clearly not a good spot to put that block




-- 
What "does not work" means? It doesn't show on the gallery? It doesn't save the image?
Also, you are saving the image twice but refreshing the gallery with "AppPic" which is not an image because it doesn't have a .jpg or .png at the end.
Why you use "AppPic"? That's not the name of the file you want to show in the gallery, right?

-- 
It saves the picture somewhere but not in the Gallery. AppPic is just a placeholder name
So I changed it to AppPic.jpg for the first and delete the next apppic block?

-- 
You have to use the name of the file you saved, not any name or placeholder.

-- 
Don't quite understand. I want the app to save the edited photos with a certain name(appic01, appic02 etc), don't want to save them with the original filename of the pic.

-- 
You can save it with any name you want. The refresh method should be called with the same name you used to save the picture.

-- 
I'm misunderstanding something here. Can't make the connection
I don't see the name of any picture, just apppic.jpg




-- 
Like I said before, the refresh goes AFTER you save the file. You can't refresh the gallery with a file that is not saved yet because it doesn't exist and there's nothing to refresh it with.
So invert them. Save first. Refresh AFTER


Also, take a look at your file naming blocks. 
As an example, if SaveCount = 14 then your file will be named AppPic.jpg14.jpg
You need to correct that to produce AppPic14.jpg

-- 
Good now?
It saves the photos as AppPic0.jpg AppPic1.jpg etc
That is fine I guess but they don't appear in the gallery.


-- 
So, you went back to saving the image twice? Nice!

-- 
YOU CAN'T REFRESH BEFORE SAVING! Refreshing is to make a file that you just saved show up in the gallery. If you refresh BEFORE saving, there's nothing new to add to the gallery.

-- 
So Screenshot 118 then?






-- 
118 looks good to me. Did you try it? Did it work?

-- 
It didn't

-- 
bump?

-- 
Why bump? The last post I asked you if you tried it and you said you didn't. So, did you try it now? Did it work?


--
And I replied that it did not work :)

-- 
So, what "doesn't work" means? What's doing wrong.

--
It doesn't save in the gallery.

--
Well, like I said, the blocks looks good to me, so I don't know why it doesn't show in the gallery.
I do that in my phone and it works.

--  
I guess I'll have to notify users to reboot and enter their folder explorer to see the pics...
At the begining of the thread you mentioned something about a flung event, but is that really needed? When I click a certain button it opens the second screen where I can pick color, but it does not corelate to the Line/Circle buttons.



-- 
I don't understand your question. Please give an example.



-- 
These should be all the related color picker related blocks
In screenshot 15 I've pointed out the button








--