Creating a landing page similar to twitter app and others - java

I am wanting to make a reusable 'landing page' activity similar to like the activity when you first launch the official twitter app, facebook, or google io app, etc. Reusable is really the key here I would like for the activity to dynamically populate its gridview with the other activities in the application.
Is it possible to parse through the android manifest file to find my other activities? If so is it also possible to add my own xml attributes to the manifest file to distinguish which activities should show up in the gridview?
Or, is there some other way to find all existing activity classes in the package? Is there a way in java to look for any Class in a package that implements a particular interface?
edit: here is a screen shot as per request

Is it possible to parse through the android manifest file to find my other activities?
No, but you can iterate over your activities via PackageManager and getPackageInfo().
If so is it also possible to add my own xml attributes to the manifest file to distinguish which
activities should show up in the gridview?
You should be able to use a <meta-data> element to point to an XML resource file that contains your extra data, just like app widgets and searching do. Use loadXmlMetaData() to access the contents.
That being said, I agree with Juri -- you're using a Buick to swat a fly here. Having a reusable dashboard activity is great -- working out the details of one is on my 18,000-item to-do list. Having one that tries to dynamically populate itself seems overkill.

I guess what you want is a dashboard. For ideas on how to implement it you could look at the source code of the Google I/O android app, more specifically at the activity_home.xml.
Parsing the manifest.xml could be an idea although I'm not sure whether you're able to access it. Honestly, being on a mobile where you want to use as little resources as possible I'd suggest you to reference your items hardcoded in the xml file, just as they did it on the Google I/O app.
The reason is that you probably want to promote just the most important activities of your app, not the detail views of a list or some custom popup alert which is also registered in the manifest and would therefore be difficult to distinguish from others.

How many activities do you have to put on the dashboard? Will the user ever be able to promote inactive activities because they want them? I think you have to consider those factors as well. Otherwise, you would weight the ones you want to show up first (different ways to do this) and then let them trickle into the dashboard.
As far as how to display which where, if you're using HTML/CSS then you could use a set width and a float model. Otherwise, just iterate through the list of promoted activities. I've done both in HTML/CSS dashboards I've done. It's just according to what your parameters are.
It's relatively easy to build a list in memory and loop from 1 to 6 assigning values to each of 6 locations on screen. Making them dynamically sized could be tricky.
Looking for more info to help you out, but not sure exactly how you're having issues. Unless you have something directly patentable, I would suggest showing code and what you're struggling with ...

Related

How to check if images in an android app are current?

I am in the middle of writing an android app while teaching myself java all at the same time and my project is a bit cumbersome for a first time app. NOTE:
I am not a newbie to programming, I know several languages with the exception of java and writing code for mobile devices. With this all said and done, I don't want to have to force my users to have to update the app every time there is a new image.
Is there a way, I am assuming there is, to check on startup if all the images are up to date and if not download the new ones to the drawable resource folder for use in the app?
I have searched and found ways to remotely fetch items but nothing specifically for updating app images. For example: Splash Screen Image, or background image etc.
Thanks for your time and apologize if this does not conform to stackoverflow form of asking a question.
Shawn Mulligan
Based on my knowledges, there is no way to do why you're asking for. Resources are static contents and there no way to modify or update them programatically.
To achieve a kind of feature that you describe, it should be through a distant server, eventually with a local cache of your images on disc, associate to a download date.
But you won't be able to use them in the exact same way that you can use drawable resources.
Also depends of what you really mean by "if images are up to date".

pop up window when message selected in other app - Android

Is it possible to pop up a window for a selected text within another android app ?
for example a user is using some pdf reader and selects a word and a small window pops up that provides the options to highlight the text or Define and ... , I want to know is it possible to add another option to that window (or add a small window next to that) that defines the meaning using my dictionary app, not the pdf reader's dictionary?
basically I want to know if it is possible to have the user to use my dictionary app for all his needs , surfing web, reading pdf , looking up words directly ..
No, its not possible.
Only way of do that if you upload your app to Google Play and shared the options with other apps (using PendingIntents and Broadcast actions), but the code of other apps must use your code, you can not modify other app installed.
If I have understood your question correctly then NO.
It is not possible to edit the behavior of other apps with your own since then you would have to edit that apps source code. As far as I know the system does not provide any overhead setting for what your asking as it does for sharing things whith different apps (email, social media etc.)

Custom Map in Android Application

Ok, so I am going to do my best to convey exactly what I am looking to accomplish. I have thus far completed some minor Java courses at school and working on some android tutorials.
I have access to a google map that has consistently updated information regarding conditions in an area. Is it possible for me to write a program that shows the map on this link and stays current? Can this be done without the use of webview? Or is that link going to be dynamic and change as the overlay does? Would it be possible to instead call upon the website then to utilize that specific area of the webpage that has the map?
https://www.google.com/maps/d/embed?mid=zEDHoFPoYHv4.kHYurQFY7s8s&hl=en
I am doing this all for self educational purposes, not looking to create anything commercial, other wise I realize I would likely want to contact the host and ask them for permission to use their data.
I've read through several of the Google Maps API information, but I can not find anything specifically that states I can do this.
By "have access to a map", do you mean that you have access to the map tiles? If so, you can add a TileOverlay to a base Google Map, which will download the tiles from your server.

How to change the snapshot shown by recent apps list?

In the newer versions of Android (> 3.0) there is an onscreen button that
will display a list of the recent apps with their names and snapshots.
Even though my app itself is password protected, this overview might
show sensitive data in that snapshot. So is there any way to force a
certain image (like a logo) to be shown rather than let the OS decide?
It seems to be impossible for now. There's a method called onCreateThumbnail but it is not used currently by the system I guess, since it is not called. I see two possible solutions:
1. To disable thumbnail on the activity containing sensitive data by adding FLAG_SECURE to your window: getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
2. To exclude your activities from recent apps, set android:excludeFromRecents attribute to true for activities in AndroidManifest.xml
The solution provided by Azat continues to be valid also in Lollipop.
Just a note, if you want to continue to not see snapshots in recent list for the entire app, ALL the implemented activities should specify in the onCreate() method the flag getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
before setContentView();
Otherwise a snapshot in the recent list will show the first activity without the flag if the user navigated through it.
There is an approach to archive this requirement besides using that flag is HardwareKeyWatcher but it can not cover all of the cases due to fragmented device configurations and custom ROMs, then we have to fulfill missing cases with other approaches.
To ease the way of implementation, we had built a lib for Recent Apps thumbnail hiding mechanism, which supports implement a custom layout to show an empty screen with the app's logo when the app is going to Recents Screen.

Does Android have a standard Add/Edit/Delete list convention?

Similar question, but this one is about Android.
On the iPhone, there is a standard convention for editing lists. There is an Edit button and the + button above the list. You click on the Edit button and the list changes slightly notifying the user of change of status.
I have a dozen apps on Android that manage lists in some way and they all seem to do it slightly differently. Does Android have some type of a standard convention for editing lists? Perhaps something that's recommended by the Android team?
I am sure there is no such standard exist but for that you have create custom title bar with Edit/Post options same as Wordpress for Android application, you can also download this code of wordpress application because its open source application. So if you download this code, then it may be helpful to you to understand the Edit functionality for the listview.
Update:
In short, i just want to say that you have to define custom and efficient adapter for ListView.

Categories

Resources