I'm currently developing a mobile quiz app that is going to be used by multiple participants they will connect to the local server via wifi and I have this idea of issuing a command from the server that chooses what activity/screen to show in my app. Is this possible?
I just want to know the main logic of this, I'm still at the android app development and haven't started on the server side for my mobile app. I'm planning on using php, json and wamp to connect to my local server, is this a good idea? if not, what software should I use for this particular system? Any answer would be appreciated.
A am a newbie in android, and I want to make a color detection app, but don't know where to start.
Can someone please point me in the right direction, and suggest some articles I could read and some examples I could view to make this app?
I found this example: Color detection in android - Android Discussion Boards
But I don't know how to get int values for red green and blue from a camera.
If someone could please tell me how to do so, I would really appreciate it.
Thanks in advance.
What example? The link points to your original question.
Member 10850253 wrote:
how to get int values for red green and blue from a camera.
See this[^] SO answer to retrieve the image taken by the camera. Once you have the image, use the bitmap's getPixels() method to retrieve its pixels.
If you're just getting started in Android, you may have bitten off more than you can chew. I'm not saying you won't be able to solve your problem, but you may want to proceed step by step and first gain more familiarity with programming in Android.
I'm working on an android app for cardboard. The purpose of the app is to make augmented reality and for the moment the only thing you can do with it is to see through the smartphone's camera. I got this functionnality from this project : https://github.com/SalahEddin/CardboardPassthrough
My problem is that I would like to show some text to the user but I don't know how to make it properly in order for the text to be shown in the two squares of the GvrView. In oder words I would like something like this : screenshot
Here are some code elements that you can find in the GitHub project.
This is not a programming question, but I'll go ahead and offer:
1) What kind of attachment is it?
2) What happens when other people send you a text message with an attachment?
3) Does it happen with all of your boss' text messages to you, or just this particular one?
4) Are you using the stock messaging app, or a custom one?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
First tell us, where did you even the get the source code, and how is it Android Studio project?
Typically, most of the projects come with a directory structure, that lets your IDE easily pick up, Android Studio is smart enough to do that, secondly you can easily read the methods from the location where you downloaded the project from.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
It's been a while since I've participated on CP, and I'm back with a doozy
I'm having a problem with MediaExtractor and using a MemoryFile as the data source. In the real world, this media viewer is part of a larger app that supplies a chunk of bytes that contains a complete MP4 video. To eliminate all the other stuff, I have created a little demo app that only contains the viewer and a test MemoryFile. Please note that not using a MemoryFile, i.e. saving the video data to storage and playing from there, is not an option.
First, the code. I create the MemoryFile in the test app's MainActivity.onCreate
// these lines are only in the test app
InputStream inS = getResources ().getAssets ().open ("testmp4.mp4");
int length = inS.available ();
byte data = new byte[length];
// in the real world, the other stuff gives me a byte array and my code starts here
m_memFile = new MemoryFile (null, length);
m_memFile.writeBytes (data, 0, 0, length);
Method getFD = MemoryFile.class.getMethod ("getFileDescriptor");
m_memFileFD = (FileDescriptor) getFD.invoke (m_memFile);
This is in the MainActivity's Play button click listener:
if (m_player == null)
m_player = new MyPlayer (MainActivity.this.m_events, MainActivity.this.m_memFileFD, MainActivity.this.m_memFile.length (), (SurfaceView) findViewById (R.id.viewerMediaVideo));
The video player is in the class MyPlayer that extends Runnable:
Now for the problem. I have tested the same APK on different devices, both actual physical phones and emulators and the results are:
S5 with 4.4.2 / API:19 emulator --> works
M9 with 5.0.2 / API:21 emulator / API:22 emulator --> works
Nexus6 with 6.0 / API:23 emulator --> works
S7 with 6.0.1 / (no emulator for this point release) --> fails
Nexus6 with 7.0 / API:24 emulator --> fails
works means the video plays correctly fails means I get the error "can't create extractor: Failed to instantiate extractor". This is the catch at the very beginning of the player's run method
6.0.1 logcat shows thirteen lines like (only varying between the digit 0 and 4): FileSource: seek to 0 failed
7.0 / API:24 emulator logcat contains a single line: FileSource: offset/length adjusted from 0/547251 to 0/0
I've tried two versions of the app on the physical devices. One has a minimumSDK set to 19 and the targetSDK / compileSDK / build tools are version 21. The second version has minSDK 19 and the rest 23. The version running on the emulators has minSDK19, targetSDK 23, and compileSDK/ buildTools 25 -- the latest that I just downloaded yesterday. All three different builds of the same code fail in the same pattern based on OS version.
This points me to a change between OS versions 6.0 and 6.0.1 causing the issue. However, I've done some poking into the sources available on the net and don't see anything suspicious.
Any ideas? Do I need to go report a bug to Google?
Be wary of strong drink. It can make you shoot at tax collectors - and miss. Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
Last Visit: 31-Dec-99 18:00 Last Update: 1-Oct-23 7:58